Function at 0x405ea4
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x201c
call fcn.00417820
push edi
push esi
push ebx
add esp, 0xfffffff4
push 0x405d45
call fcn.0040874c
add esp, 0xfffffff4
push 0x30
call fcn.00417610
mov dword [ebp - 0x2004], eax
xor esi, esi
add esp, 0x20
cmp dword [0x42285c], 0
je 0x405f12
add esp, 0xfffffff4
push 0x2000
call fcn.00417610
mov edx, dword [ebp - 0x2004]
mov dword [edx], eax
push dword [0x42285c]
push 0x405d57
push 0x405d6b
push eax
call sub.msvcrt.dll_sprintf
mov esi, 1
add esp, 0x20
cmp byte [0x422028], 0
je 0x405f48
add esp, 0xfffffff4
push 0x2000
call fcn.00417610
mov edx, dword [ebp - 0x2004]
mov dword [edx + esi*4], eax
add esp, 0xfffffffc
push 0x405d73
push 0x405d83
push eax
call sub.msvcrt.dll_sprintf
inc esi
add esp, 0x20
cmp byte [0x42287c], 0
je 0x405f7e
add esp, 0xfffffff4
push 0x2000
call fcn.00417610
mov edx, dword [ebp - 0x2004]
mov dword [edx + esi*4], eax
add esp, 0xfffffffc
push 0x405d8d
push 0x405d83
push eax
call sub.msvcrt.dll_sprintf
inc esi
add esp, 0x20
cmp byte [0x4301a0], 0x69
jne 0x405fb4
add esp, 0xfffffff4
push 0x2000
call fcn.00417610
mov edx, dword [ebp - 0x2004]
mov dword [edx + esi*4], eax
add esp, 0xfffffffc
push 0x405d97
push 0x405d83
push eax
call sub.msvcrt.dll_sprintf
inc esi
add esp, 0x20
add esp, 0xfffffff4
push 0x2000
call fcn.00417610
mov edx, dword [ebp - 0x2004]
mov dword [edx + esi*4], eax
call fcn.00404660
push eax
push 0x405da9
push 0x405d6b
mov eax, dword [ebp - 0x2004]
push dword [eax + esi*4]
call sub.msvcrt.dll_sprintf
inc esi
add esp, 0x20
add esp, 0xfffffff4
push 0x2000
call fcn.00417610
mov edx, dword [ebp - 0x2004]
mov dword [edx + esi*4], eax
call fcn.00404660
push eax
push 0x405dba
push 0x405d6b
mov eax, dword [ebp - 0x2004]
push dword [eax + esi*4]
call sub.msvcrt.dll_sprintf
inc esi
add esp, 0x20
add esp, 0xfffffff4
push 0x2715
call fcn.004019cc
add esp, 0x10
test eax, eax
je 0x40607b
add esp, 0xfffffff8
call sub.KERNEL32.dll_GetCurrentProcessId
push eax
lea ebx, [ebp - 0x2000]
push ebx
call fcn.00404ec4
add esp, 0xfffffff4
push 0x2000
call fcn.00417610
mov edx, dword [ebp - 0x2004]
mov dword [edx + esi*4], eax
add esp, 0x20
push ebx
push 0x405dcb
push 0x405d6b
push eax
call sub.msvcrt.dll_sprintf
inc esi
add esp, 0x10
add esp, 0xfffffff4
push 0x2000
call fcn.00417610
mov edx, dword [ebp - 0x2004]
mov dword [edx + esi*4], eax
push 0x42e198
push 0x405de1
push 0x405d6b
push eax
call sub.msvcrt.dll_sprintf
inc esi
add esp, 0x20
add esp, 0xfffffff4
push 0x2000
call fcn.00417610
mov edx, dword [ebp - 0x2004]
mov dword [edx + esi*4], eax
add esp, 0x10
cmp byte [0x42287d], 0
je 0x4060d4
mov eax, 0xffffffff
jmp 0x4060d9
call fcn.00401924
push eax
push 0x405def
push 0x405e09
mov eax, dword [ebp - 0x2004]
push dword [eax + esi*4]
call sub.msvcrt.dll_sprintf
inc esi
add esp, 0xfffffff4
push 0x2000
call fcn.00417610
mov edx, dword [ebp - 0x2004]
mov dword [edx + esi*4], eax
add esp, 0x20
add esp, 0xfffffff8
push 0x405e11
push eax
call sub.msvcrt.dll_sprintf
add esp, 0xfffffffc
mov eax, dword [ebp - 0x2004]
mov ebx, dword [eax + esi*4]
mov edi, ebx
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
lea eax, [ecx - 1]
mov edx, 0x2000
sub edx, eax
push edx
mov edi, ebx
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
lea eax, [ebx + ecx - 1]
push eax
push 0x405e26
call sub.KERNEL32.dll_GetEnvironmentVariableA
inc esi
add esp, 0xfffffff8
push 0x405e2b
call sub.msvcrt.dll_getenv
add esp, 0x20
test eax, eax
jne 0x4061a9
add esp, 0xfffffff4
push 0x2000
call fcn.00417610
mov edx, dword [ebp - 0x2004]
mov dword [edx + esi*4], eax
call sub.KERNEL32.dll_GetConsoleOutputCP
push eax
push 0x405e33
push 0x405e49
mov eax, dword [ebp - 0x2004]
push dword [eax + esi*4]
call sub.msvcrt.dll_sprintf
inc esi
add esp, 0x20
mov edx, dword [ebp - 0x2004]
mov dword [edx + esi*4], 0
add esp, 0xfffffff8
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.00405a9c
add esp, 0x10
test al, al
jne 0x4061d4
add esp, 0xfffffff4
push 0x405e53
jmp 0x406206
add esp, 0xfffffff4
push 0x405e6c
call fcn.0040874c
add esp, 0x10
mov byte [0x422029], 1
add esp, 0xfffffff4
mov edx, dword [ebp + 8]
push edx
call fcn.00406598
add esp, 0x10
test al, al
jne 0x406210
add esp, 0xfffffff4
push 0x405e78
call fcn.004086e0
mov al, 0
jmp 0x406249
cmp byte [ebp + 0xc], 0
je 0x40623a
add esp, 0xfffffff4
push 0x405e8c
call fcn.0040874c
mov edx, dword [0x428084]
add esp, 0x10
add esp, 0xfffffff4
mov eax, dword [edx]
push edx
mov eax, dword [eax + 0xc]
call eax
add esp, 0xc
add esp, 0xfffffff4
push 0x405e95
call fcn.0040874c
mov al, 1
lea esp, [ebp - 0x2028]
pop ebx
pop esi
pop edi
leave
ret