Function at 0x404867
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x848
mov eax, dword [0x407014]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
and dword [ebp - 0x82c], 0
mov dword [ebp - 0x828], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x848], eax
mov eax, dword [ebp + 0x1c]
push ebx
mov ebx, dword [ebp + 8]
push esi
mov dword [ebp - 0x824], eax
xor esi, esi
mov eax, dword [ebp + 0x10]
inc esi
push edi
push ebx
push 0x401100
mov eax, dword [eax]
mov dword [ebp - 0x814], eax
lea eax, [ebp - 0x20c]
push eax
mov dword [ebp - 0x81c], esi
call fcn.00404750
add esp, 0xc
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0x400
push 0x407888
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov edi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcstok_s]
dec eax
cmp eax, 0x3fe
ja 0x40494a
lea eax, [ebp - 0x82c]
push eax
push 0x401108
push 0x407888
jmp 0x404930
mov ecx, pe_nt_image_headers32
cmp esi, ecx
je 0x40493b
mov dword [ebp + esi*4 - 0x814], eax
lea eax, [ebp - 0x82c]
push eax
inc esi
push 0x401108
mov dword [ebp - 0x81c], esi
push 0
call edi
add esp, 0xc
test eax, eax
jne 0x40490b
jmp 0x404966
push ecx
push ebx
push 0x4a
push ebx
call fcn.00404712
jmp 0x404a3e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xcb
je 0x404966
lea eax, [ebp - 0x20c]
push eax
push 0x48
push ebx
call fcn.004046d8
cmp dword [ebp + 0xc], 1
jle 0x404999
mov edx, dword [ebp + 0x10]
xor ecx, ecx
inc ecx
add edx, 4
mov eax, pe_nt_image_headers32
cmp esi, eax
je 0x4049e8
mov eax, dword [edx]
mov dword [ebp + esi*4 - 0x814], eax
inc esi
push 4
pop eax
add edx, eax
mov dword [ebp - 0x81c], esi
inc ecx
cmp ecx, dword [ebp + 0xc]
jl 0x404975
push ebx
lea eax, [ebp - 0x414]
push 0x40110c
push eax
call fcn.00404750
add esp, 0xc
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0x400
push 0x408088
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
dec eax
cmp eax, 0x3fe
ja 0x404a22
lea eax, [ebp - 0x82c]
push eax
push 0x401108
push 0x408088
jmp 0x404a17
push eax
jmp 0x40493c
mov ecx, pe_nt_image_headers32
cmp esi, ecx
je 0x40493b
mov dword [ebp + esi*4 - 0x814], eax
lea eax, [ebp - 0x82c]
push eax
inc esi
push 0x401108
mov dword [ebp - 0x81c], esi
push 0
call edi
add esp, 0xc
test eax, eax
jne 0x4049ee
jmp 0x404a3e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xcb
je 0x404a3e
lea eax, [ebp - 0x414]
push eax
push 0x48
push ebx
call fcn.004046d8
mov ecx, dword [ebp - 0x828]
mov eax, ecx
push 0x14
pop edi
cmp dword [ecx], 5
je 0x404a55
add eax, edi
cmp dword [eax], 5
jne 0x404a4e
sub eax, ecx
cdq
idiv edi
push eax
mov dword [ebp - 0x830], eax
call fcn.00403878
mov edi, eax
xor ecx, ecx
push 4
pop edx
mov eax, esi
mov dword [ebp - 0x834], edi
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00403878
mov dword [ebp - 0x83c], eax
pop ecx
pop ecx
test edi, edi
je 0x404a94
test eax, eax
jne 0x404aa5
push 0xbf
push 0x401118
push 2
call fcn.00406024
mov ecx, dword [ebp - 0x824]
xor eax, eax
and dword [ecx], 0
cmp dword [ebp - 0x830], eax
jbe 0x404ae8
mov ecx, dword [ebp - 0x828]
mov esi, dword [ebp - 0x830]
add ecx, 0x10
mov byte [eax + edi], 0
mov edx, dword [ecx]
test edx, edx
je 0x404ad4
mov byte [edx], 0
inc eax
add ecx, 0x14
cmp eax, esi
jb 0x404ac7
mov esi, dword [ebp - 0x81c]
mov ecx, dword [ebp - 0x824]
xor edi, edi
mov byte [ebp - 0x815], 1
inc edi
mov byte [ebp - 0x816], 0
cmp esi, edi
jle 0x404d16
mov dword [ebp - 0x840], 0x2d
mov dword [ebp - 0x844], 0x2f
mov edx, dword [ebp + edi*4 - 0x814]
mov dword [ebp - 0x838], edx
movzx eax, word [edx]
cmp ax, word [ebp - 0x840]
je 0x404b4f
cmp ax, word [ebp - 0x844]
je 0x404b4f
mov eax, dword [ecx]
mov ecx, dword [ebp - 0x83c]
mov dword [ecx + eax*4], edx
mov ecx, dword [ebp - 0x824]
inc dword [ecx]
jmp 0x404cfa
mov ecx, 0x4010c8
mov eax, edx
mov si, word [eax]
cmp si, word [ecx]
mov esi, dword [ebp - 0x81c]
jne 0x404b95
cmp word [eax], 0
je 0x404b91
mov si, word [eax + 2]
cmp si, word [ecx + 2]
mov word [ebp - 0x81e], si
mov esi, dword [ebp - 0x81c]
jne 0x404b95
add eax, 4
add ecx, 4
cmp word [ebp - 0x81e], 0
jne 0x404b56
xor eax, eax
jmp 0x404b9a
sbb eax, eax
or eax, 1
test eax, eax
je 0x404cf4
mov ecx, 0x4010d8
mov eax, edx
mov si, word [eax]
cmp si, word [ecx]
mov esi, dword [ebp - 0x81c]
jne 0x404be8
cmp word [eax], 0
je 0x404be4
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
mov word [ebp - 0x81e], dx
mov edx, dword [ebp - 0x838]
jne 0x404be8
add eax, 4
add ecx, 4
cmp word [ebp - 0x81e], 0
jne 0x404ba9
xor eax, eax
jmp 0x404bed
sbb eax, eax
or eax, 1
test eax, eax
je 0x404cf4
lea eax, [edx + 2]
push eax
push dword [ebp - 0x828]
call fcn.00404d98
mov esi, eax
inc edi
test esi, esi
jne 0x404c26
push dword [ebp - 0x838]
push 0x3f
push ebx
call fcn.004044e9
xor al, al
mov byte [ebp - 0x815], al
jmp 0x404ce6
mov eax, esi
sub eax, dword [ebp - 0x828]
push 0x14
pop ecx
cdq
idiv ecx
mov ecx, dword [ebp - 0x834]
mov dword [ebp - 0x838], eax
cmp byte [eax + ecx], 0
je 0x404c55
push dword [ebp + edi*4 - 0x818]
push 0x43
push ebx
call fcn.004046d8
mov eax, dword [esi + 0x10]
test eax, eax
je 0x404c5f
mov byte [eax], 1
cmp dword [esi], 0
je 0x404c89
cmp dword [esi], 1
jne 0x404c72
mov byte [ebp - 0x816], 1
jmp 0x404c89
mov eax, dword [0x407880]
test eax, eax
je 0x404c84
push eax
push esi
call fcn.00404816
jmp 0x404cbb
cmp dword [esi], 3
jne 0x404c91
mov eax, dword [esi + 0xc]
mov byte [eax], 1
jmp 0x404cbb
cmp edi, dword [ebp - 0x81c]
je 0x404cc3
mov ecx, dword [ebp + edi*4 - 0x814]
push 0x2d
pop edx
movzx eax, word [ecx]
cmp ax, dx
je 0x404cc3
push 0x2f
pop edx
cmp ax, dx
je 0x404cc3
push ecx
push esi
call fcn.00404816
inc edi
mov al, byte [ebp - 0x815]
jmp 0x404cd6
push dword [esi + 4]
push 0x3d
push ebx
call fcn.004044e9
xor al, al
mov byte [ebp - 0x815], al
mov ecx, dword [ebp - 0x838]
mov edx, dword [ebp - 0x834]
mov byte [ecx + edx], 1
mov esi, dword [ebp - 0x81c]
mov ecx, dword [ebp - 0x824]
jmp 0x404d01
mov ecx, dword [ebp - 0x824]
mov al, byte [ebp - 0x815]
inc edi
cmp edi, esi
jl 0x404b15
cmp byte [ebp - 0x816], 0
jne 0x404d67
test al, al
je 0x404d67
mov ecx, dword [ebp - 0x830]
xor edi, edi
test ecx, ecx
je 0x404d67
mov esi, dword [ebp - 0x828]
push 0x14
add esi, 4
pop eax
cmp dword [esi - 4], 0
je 0x404d60
cmp byte [esi + 4], 0
je 0x404d60
mov eax, dword [ebp - 0x834]
cmp byte [edi + eax], 0
jne 0x404d5d
push dword [esi]
push 0x3e
push ebx
call fcn.004044e9
mov ecx, dword [ebp - 0x830]
mov byte [ebp - 0x815], 0
push 0x14
pop eax
inc edi
add esi, eax
cmp edi, ecx
jb 0x404d2e
push dword [ebp - 0x834]
call fcn.00403873
mov eax, dword [ebp - 0x83c]
pop ecx
mov ecx, dword [ebp - 0x848]
pop edi
pop esi
pop ebx
mov dword [ecx], eax
mov ecx, dword [ebp - 4]
mov al, byte [ebp - 0x815]
xor ecx, ebp
call fcn.00403865
leave
ret 0x18