Function at 0x40457f
Capabilities:
Query environment variable

Disassembly:
push ebp
lea ebp, [esp - 0x3028]
mov eax, 0x3028
call fcn.00409f60
push 0xffffffffffffffff
push 0x41ee8b
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 0x404608
cmp byte [ebp + 0x3038], bl
je 0x4045fa
push ebx
push 1
push ecx
lea ecx, [ebp + 0x2024]
push ecx
push eax
call fcn.00404e8a
jmp 0x404608
push ecx
push eax
lea eax, [ebp + 0x2024]
push eax
call fcn.00406e4c
lea ecx, [ebp]
call fcn.004036c3
mov dword [ebp - 4], ebx
cmp word [ebp + 0x2024], 0
je 0x40465f
cmp byte [ebp + 0x303c], 0
lea eax, [ebp + 0x2024]
lea ecx, [ebp]
je 0x404637
push eax
call fcn.00403e76
jmp 0x40463e
push ebx
push eax
call fcn.00403af7
test al, al
jne 0x404666
cmp byte [ebp + 0x303c], al
je 0x4049b4
push 6
mov ecx, 0x42d070
call fcn.0040352c
jmp 0x4049b4
mov dword [ebp + 0xc], 1
mov esi, 0x1000
lea ecx, [ebp - 0x3c]
push esi
mov edi, ebx
call fcn.004036a1
mov byte [ebp - 4], 1
push esi
push dword [ebp - 0x3c]
jmp 0x40468f
push eax
add edi, eax
call fcn.004037be
mov eax, dword [ebp - 0x3c]
add eax, edi
push esi
push eax
lea ecx, [ebp]
call fcn.00403cf5
lea ecx, [ebp - 0x3c]
test eax, eax
jne 0x404680
push edi
call fcn.004044b5
mov esi, dword [ebp - 0x3c]
cmp edi, 2
jb 0x4046be
cmp byte [esi], 0xff
jne 0x4046be
cmp byte [esi + 1], 0xfe
mov dword [ebp - 0x20], 1
je 0x4046c1
mov dword [ebp - 0x20], ebx
cmp edi, 2
jb 0x4046d8
cmp byte [esi], 0xfe
jne 0x4046d8
cmp byte [esi + 1], 0xff
mov dword [ebp - 0x18], 1
je 0x4046db
mov dword [ebp - 0x18], ebx
cmp edi, 3
jb 0x4046f5
cmp byte [esi], 0xef
jne 0x4046f5
cmp byte [esi + 1], 0xbb
jne 0x4046f5
cmp byte [esi + 2], 0xbf
mov byte [ebp - 0xd], 1
je 0x4046f8
mov byte [ebp - 0xd], bl
mov eax, dword [ebp + 0x3040]
test eax, eax
jne 0x40470f
push edi
push esi
call fcn.004044e9
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 0x404735
cmp eax, 2
je 0x404735
cmp eax, 1
jne 0x404773
push 1
lea ecx, [ebp - 0x3c]
call fcn.004037be
cmp dword [ebp + 0x3040], 2
mov edi, dword [ebp - 0x38]
mov esi, dword [ebp - 0x3c]
mov byte [edi + esi - 1], bl
jne 0x40475a
push esi
push esi
call dword [sym.imp.USER32.dll_OemToCharA]
push edi
lea ecx, [ebp - 0x54]
call fcn.004044cf
push dword [ebp - 0x50]
mov edi, dword [ebp - 0x54]
push edi
push esi
mov dword [ebp - 0x14], edi
call fcn.004070c9
cmp dword [ebp + 0x3040], 3
mov eax, dword [ebp - 0x38]
jne 0x404814
push 2
pop ecx
mov dword [ebp - 0x1c], ecx
mov ecx, dword [ebp - 0x20]
test ecx, ecx
jne 0x40479c
cmp dword [ebp - 0x18], ecx
jne 0x40479c
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.004044cf
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 0x40480a
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 0x4047db
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 0x404857
push 1
lea ecx, [ebp - 0x3c]
call fcn.004037be
mov eax, dword [ebp - 0x38]
lea ecx, [ebp - 0x54]
mov esi, dword [ebp - 0x3c]
push eax
mov byte [eax + esi - 1], bl
call fcn.004044cf
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.004071a5
cmp word [edi], bx
je 0x40499b
push 0xd
pop eax
push 0x22
mov dword [ebp - 0x28], 0xa
pop edx
mov esi, edi
mov ecx, ebx
cmp word [edi], ax
je 0x4048b6
mov dl, byte [ebp + 0x3048]
push 0xd
pop ebx
push 0x2f
pop edi
movzx eax, word [esi]
cmp ax, word [ebp - 0x28]
je 0x4048ae
test ax, ax
je 0x4048ae
test dl, dl
je 0x4048a6
cmp ax, di
jne 0x4048a6
cmp word [esi + 2], di
jne 0x4048a6
xor eax, eax
mov ecx, esi
mov word [esi], ax
add esi, 2
cmp word [esi], bx
jne 0x404882
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 0x4048c7
mov ecx, esi
lea eax, [ecx - 2]
jmp 0x4048e1
movzx ecx, word [eax]
cmp ecx, 0x20
je 0x4048d9
cmp ecx, 9
jne 0x4048e5
xor ecx, ecx
mov word [eax], cx
sub eax, 2
cmp eax, edi
jae 0x4048cc
cmp byte [ebp + 0x3044], 0
je 0x40490e
cmp word [edi], dx
jne 0x40490e
push edi
call fcn.0040d948
pop ecx
push 0x22
pop ecx
cmp word [edi + eax*2 - 2], cx
jne 0x40490e
xor ecx, ecx
mov word [edi + eax*2 - 2], cx
add edi, 2
cmp byte [ebp + 0x304c], 0
je 0x404957
cmp word [edi], 0x25
jne 0x404957
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 0x404957
cmp eax, 0x800
jae 0x404957
cmp word [ebp + 0x1024], 0
je 0x404965
lea eax, [ebp + 0x1024]
push eax
jmp 0x40495d
cmp word [edi], bx
je 0x404965
push edi
mov ecx, dword [ebp - 0x40]
call fcn.00406eb6
cmp word [ebp - 0x1c], 0
je 0x40499b
push 0xd
pop ecx
push 0xa
lea edi, [esi + 2]
pop ebx
movzx eax, word [edi]
cmp ax, cx
je 0x404982
cmp ax, bx
jne 0x404987
add edi, 2
jmp 0x404975
push 0xd
pop eax
xor ebx, ebx
mov dword [ebp - 0x14], edi
push 0x22
pop edx
cmp word [edi], bx
jne 0x40486d
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x54]
call fcn.004043a0
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x3c]
call fcn.004036f5
mov bl, 1
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp]
call fcn.00403747
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.00409f4a
lea esp, [ebp + 0x3028]
pop ebp
ret 0x20