Function at 0x4047c5
Capabilities:
Query environment variable

Disassembly:
push ebp
lea ebp, [esp - 0x3028]
mov eax, 0x3028
call fcn.0040a2d0
push 0xffffffffffffffff
push 0x41f360
mov eax, dword fs:[0]
push eax
sub esp, 0x48
mov eax, dword [0x42a664]
xor eax, ebp
mov dword [ebp + 0x3024], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ecx, dword [ebp + 0x3034]
xor ebx, ebx
mov eax, dword [ebp + 0x3030]
mov dword [ebp - 0x40], ecx
xor ecx, ecx
mov word [ebp + 0x2024], cx
mov ecx, 0x800
test eax, eax
je 0x40484e
cmp byte [ebp + 0x3038], bl
je 0x404840
push ebx
push 1
push ecx
lea ecx, [ebp + 0x2024]
push ecx
push eax
call fcn.004050ef
jmp 0x40484e
push ecx
push eax
lea eax, [ebp + 0x2024]
push eax
call fcn.00407081
lea ecx, [ebp]
call fcn.004037bc
mov dword [ebp - 4], ebx
cmp word [ebp + 0x2024], 0
je 0x4048a5
cmp byte [ebp + 0x303c], 0
lea eax, [ebp + 0x2024]
lea ecx, [ebp]
je 0x40487d
push eax
call fcn.0040405f
jmp 0x404884
push ebx
push eax
call fcn.00403c80
test al, al
jne 0x4048ac
cmp byte [ebp + 0x303c], al
je 0x404bfa
push 6
mov ecx, 0x42d070
call fcn.00403622
jmp 0x404bfa
mov dword [ebp + 0xc], 1
mov esi, 0x1000
lea ecx, [ebp - 0x3c]
push esi
mov edi, ebx
call fcn.0040379a
mov byte [ebp - 4], 1
push esi
push dword [ebp - 0x3c]
jmp 0x4048d5
push eax
add edi, eax
call fcn.004038c2
mov eax, dword [ebp - 0x3c]
add eax, edi
push esi
push eax
lea ecx, [ebp]
call fcn.00403eb0
lea ecx, [ebp - 0x3c]
test eax, eax
jne 0x4048c6
push edi
call fcn.004046fb
mov esi, dword [ebp - 0x3c]
cmp edi, 2
jb 0x404904
cmp byte [esi], 0xff
jne 0x404904
cmp byte [esi + 1], 0xfe
mov dword [ebp - 0x20], 1
je 0x404907
mov dword [ebp - 0x20], ebx
cmp edi, 2
jb 0x40491e
cmp byte [esi], 0xfe
jne 0x40491e
cmp byte [esi + 1], 0xff
mov dword [ebp - 0x18], 1
je 0x404921
mov dword [ebp - 0x18], ebx
cmp edi, 3
jb 0x40493b
cmp byte [esi], 0xef
jne 0x40493b
cmp byte [esi + 1], 0xbb
jne 0x40493b
cmp byte [esi + 2], 0xbf
mov byte [ebp - 0xd], 1
je 0x40493e
mov byte [ebp - 0xd], bl
mov eax, dword [ebp + 0x3040]
test eax, eax
jne 0x404955
push edi
push esi
call fcn.0040472f
mov dword [ebp + 0x3040], eax
mov edi, ebx
mov dword [ebp - 0x54], edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x50], ebx
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x48], ebx
mov byte [ebp - 0x44], bl
mov byte [ebp - 4], 2
test eax, eax
je 0x40497b
cmp eax, 2
je 0x40497b
cmp eax, 1
jne 0x4049b9
push 1
lea ecx, [ebp - 0x3c]
call fcn.004038c2
cmp dword [ebp + 0x3040], 2
mov edi, dword [ebp - 0x38]
mov esi, dword [ebp - 0x3c]
mov byte [edi + esi - 1], bl
jne 0x4049a0
push esi
push esi
call dword [sym.imp.USER32.dll_OemToCharA]
push edi
lea ecx, [ebp - 0x54]
call fcn.00404715
push dword [ebp - 0x50]
mov edi, dword [ebp - 0x54]
push edi
push esi
mov dword [ebp - 0x14], edi
call fcn.00407321
cmp dword [ebp + 0x3040], 3
mov eax, dword [ebp - 0x38]
jne 0x404a5a
push 2
pop ecx
mov dword [ebp - 0x1c], ecx
mov ecx, dword [ebp - 0x20]
test ecx, ecx
jne 0x4049e2
cmp dword [ebp - 0x18], ecx
jne 0x4049e2
inc ecx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x20], ecx
shr eax, 1
lea ecx, [ebp - 0x54]
inc eax
push eax
call fcn.00404715
mov edx, dword [ebp - 0x38]
mov eax, dword [ebp - 0x1c]
and edx, 0xfffffffe
mov edi, dword [ebp - 0x54]
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x14], edi
cmp eax, edx
jae 0x404a50
lea ecx, [esi + eax]
mov dword [ebp - 0x24], ebx
mov esi, dword [ebp - 0x18]
add ecx, esi
mov ebx, dword [ebp - 0x20]
sub ebx, esi
mov dword [ebp - 0x18], ecx
mov esi, edx
mov edx, ecx
sub esi, eax
dec esi
shr esi, 1
inc esi
movzx ecx, byte [ebx + edx]
mov eax, 0x100
imul ecx, eax
movzx eax, byte [edx]
lea edx, [edx + 2]
add cx, ax
mov eax, dword [ebp - 0x24]
add dword [ebp - 0x24], 2
shr eax, 1
mov word [edi + eax*2], cx
sub esi, 1
jne 0x404a21
mov edx, dword [ebp - 0x28]
xor ebx, ebx
mov eax, dword [ebp - 0x1c]
sub edx, eax
shr edx, 1
xor eax, eax
mov word [edi + edx*2], ax
cmp dword [ebp + 0x3040], 4
jne 0x404a9d
push 1
lea ecx, [ebp - 0x3c]
call fcn.004038c2
mov eax, dword [ebp - 0x38]
lea ecx, [ebp - 0x54]
mov esi, dword [ebp - 0x3c]
push eax
mov byte [eax + esi - 1], bl
call fcn.00404715
movzx eax, byte [ebp - 0xd]
push dword [ebp - 0x50]
mov edi, dword [ebp - 0x54]
neg eax
push edi
sbb eax, eax
mov dword [ebp - 0x14], edi
and eax, 3
add eax, esi
push eax
call fcn.004073fd
cmp word [edi], bx
je 0x404be1
push 0xd
pop eax
push 0x22
mov dword [ebp - 0x28], 0xa
pop edx
mov esi, edi
mov ecx, ebx
cmp word [edi], ax
je 0x404afc
mov dl, byte [ebp + 0x3048]
push 0xd
pop ebx
push 0x2f
pop edi
movzx eax, word [esi]
cmp ax, word [ebp - 0x28]
je 0x404af4
test ax, ax
je 0x404af4
test dl, dl
je 0x404aec
cmp ax, di
jne 0x404aec
cmp word [esi + 2], di
jne 0x404aec
xor eax, eax
mov ecx, esi
mov word [esi], ax
add esi, 2
cmp word [esi], bx
jne 0x404ac8
mov edi, dword [ebp - 0x14]
xor ebx, ebx
push 0x22
pop edx
movzx eax, word [esi]
mov dword [ebp - 0x1c], eax
xor eax, eax
mov word [esi], ax
test ecx, ecx
jne 0x404b0d
mov ecx, esi
lea eax, [ecx - 2]
jmp 0x404b27
movzx ecx, word [eax]
cmp ecx, 0x20
je 0x404b1f
cmp ecx, 9
jne 0x404b2b
xor ecx, ecx
mov word [eax], cx
sub eax, 2
cmp eax, edi
jae 0x404b12
cmp byte [ebp + 0x3044], 0
je 0x404b54
cmp word [edi], dx
jne 0x404b54
push edi
call fcn.0040dd48
pop ecx
push 0x22
pop ecx
cmp word [edi + eax*2 - 2], cx
jne 0x404b54
xor ecx, ecx
mov word [edi + eax*2 - 2], cx
add edi, 2
cmp byte [ebp + 0x304c], 0
je 0x404b9d
cmp word [edi], 0x25
jne 0x404b9d
xor eax, eax
mov word [ebp + 0x1024], ax
lea eax, [ebp + 0x1024]
push 0x800
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x404b9d
cmp eax, 0x800
jae 0x404b9d
cmp word [ebp + 0x1024], 0
je 0x404bab
lea eax, [ebp + 0x1024]
push eax
jmp 0x404ba3
cmp word [edi], bx
je 0x404bab
push edi
mov ecx, dword [ebp - 0x40]
call fcn.004070eb
cmp word [ebp - 0x1c], 0
je 0x404be1
push 0xd
pop ecx
push 0xa
lea edi, [esi + 2]
pop ebx
movzx eax, word [edi]
cmp ax, cx
je 0x404bc8
cmp ax, bx
jne 0x404bcd
add edi, 2
jmp 0x404bbb
push 0xd
pop eax
xor ebx, ebx
mov dword [ebp - 0x14], edi
push 0x22
pop edx
cmp word [edi], bx
jne 0x404ab3
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x54]
call fcn.004045e6
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x3c]
call fcn.004037ee
mov bl, 1
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp]
call fcn.00403840
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x3024]
xor ecx, ebp
call fcn.0040a2bd
lea esp, [ebp + 0x3028]
pop ebp
ret 0x20