Function at 0x498dc0
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x528
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 4], ecx
test edi, edi
je 0x498ddc
cmp word [edi], 0
jne 0x498de6
mov dword [ebp + 8], str._TEMP_ConEmu
mov edi, dword [ebp + 8]
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x498df3
cmp word [esi], 0
jne 0x498df8
mov esi, str.ConEmu.tmp
push 0x25
push edi
call fcn.004b03ac
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpynW]
add esp, 8
push 0x104
test eax, eax
je 0x498e4b
lea eax, [ebp - 0x528]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x498e2b
cmp eax, 0x104
jb 0x498e55
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 4]
push eax
push edi
push str.CreateTempFile.ExpandEnvironmentStrings__s__failed__code_u
call fcn.00498100
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc
push edi
lea ecx, [ebp - 0x528]
push ecx
call ebx
lea edx, [ebp - 0x528]
push 0x3a
push edx
call fcn.004b03ac
add esp, 8
test eax, eax
je 0x498e9d
add eax, 2
push 0x3a
push eax
call fcn.004b03ac
add esp, 8
test eax, eax
je 0x498e9d
mov ecx, dword [ebp - 4]
push 0
lea eax, [ebp - 0x528]
push eax
push str.Invalid_download_path____TEMP___variable___n_s
call fcn.00498100
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc
lea ecx, [ebp - 0x528]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
jg 0x498ec9
mov ecx, dword [ebp - 4]
push 0
push edi
push str.CreateTempFile.asDir__s__failed__path_is_null
call fcn.00498100
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp word [ebp + eax*2 - 0x52a], 0x5c
lea edi, [ebp + eax*2 - 0x528]
je 0x498ef0
mov edx, 0x5c
inc eax
mov word [edi], dx
lea edi, [ebp + eax*2 - 0x528]
xor eax, eax
mov word [edi], ax
lea ecx, [ebp - 0x528]
push ecx
call fcn.00441380
push esi
mov dword [ebp - 0xc], eax
call fcn.004ad2c0
mov esi, eax
add esp, 8
test esi, esi
je 0x498f1c
movzx eax, word [esi]
test ax, ax
je 0x498f1c
cmp ax, 0x2e
jne 0x498f21
mov esi, str.ConEmu
push esi
call fcn.004ad2f0
add esp, 4
mov dword [ebp + 0xc], eax
test eax, eax
jne 0x498f38
mov dword [ebp + 0xc], str..tmp
push 0x70
push esi
lea edx, [ebp - 0x114]
push edx
call ebx
lea eax, [ebp - 0x114]
push 0x2e
push eax
call fcn.004b135e
xor esi, esi
add esp, 8
cmp eax, esi
je 0x498f60
xor ecx, ecx
mov word [eax], cx
mov ebx, dword [ebp + 0x10]
lea eax, [ebp - 0x114]
sub eax, edi
mov dword [ebp - 8], esi
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x14], eax
jmp 0x498f80
mov edx, 0x104
mov eax, edi
jmp 0x498f90
lea ecx, [edx + 0x7ffffefa]
test ecx, ecx
je 0x498fb3
mov ecx, dword [ebp - 0x14]
movzx ecx, word [ecx + eax]
test cx, cx
je 0x498fb3
mov word [eax], cx
add eax, 2
sub edx, 1
jne 0x498f90
jmp 0x498fb7
test edx, edx
jne 0x498fba
sub eax, 2
xor edx, edx
mov word [eax], dx
test esi, esi
je 0x498ff2
mov eax, edi
lea edx, [eax + 2]
jmp 0x498fd0
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x498fd0
sub eax, edx
sar eax, 1
push esi
lea eax, [edi + eax*2]
push 0x4e25a8
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
mov ecx, dword [ebp + 0xc]
push ecx
push 0x104
push edi
call fcn.00401880
push 0
push 0x180
push 1
push 0
push 1
push 0x40000000
lea edx, [ebp - 0x528]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebx], eax
test eax, eax
je 0x49902b
cmp eax, 0xffffffff
jne 0x49904d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x10], eax
cmp eax, 3
jne 0x49904d
test esi, esi
jne 0x49904d
mov eax, dword [ebp - 0xc]
push eax
call fcn.004acee0
add esp, 4
test eax, eax
je 0x49909f
mov eax, dword [ebx]
test eax, eax
je 0x499058
cmp eax, 0xffffffff
jne 0x4990b4
inc esi
cmp esi, 0x270f
jb 0x498f80
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp - 4]
push edx
lea eax, [ebp - 0x528]
push eax
push str.Cant_create_temp_file__s___code_u
call fcn.00498100
mov dword [ebx], 0
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x499093
push eax
call fcn.00441300
add esp, 4
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [ebp + 8]
push 0
push ecx
mov ecx, dword [ebp - 4]
push str.CreateTempFile.asDir__s__failed
call fcn.00498100
jmp 0x499083
lea edx, [ebp - 0x528]
push edx
call fcn.00441380
mov esi, eax
add esp, 4
test esi, esi
jne 0x4990ef
mov eax, dword [ebx]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x528]
push ecx
mov dword [ebx], esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, dword [ebp - 4]
push eax
push str.Cant_allocate_memory___i_bytes_
call fcn.004980a0
mov dword [ebp - 8], esi
jmp 0x499083