Function at 0x403ec0
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x468
mov dword [ebp - 0x1c], esp
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x14], 0x40d5f0
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
lea ecx, [ebp - 0x18]
lea edi, [ebp - 0x474]
mov esi, dword fs:[0]
mov dword [ebp - 0x18], esi
mov dword fs:[0], ecx
mov ecx, edi
mov dword [ebp - 0x68], edx
mov dword [ebp - 0x64], eax
push eax
call fcn.0040c170
add esp, 4
mov ecx, dword [ebp - 0x470]
mov esi, dword [ebp - 0x46c]
cmp dword [ebp - 0x474], 1
je 0x4041ea
mov eax, dword [ebp - 0x468]
mov dword [ebp - 0x40], ecx
mov dword [ebp - 0x74], ecx
mov dword [ebp - 0x70], esi
mov dword [ebp - 0x54], esi
mov dword [ebp - 0x6c], eax
push 0x400
push 0
push edi
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov esi, 0x200
mov dword [ebp - 0x38], 2
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 2
mov dword [ebp - 0x2c], 2
mov dword [ebp - 0x20], 0
cmp esi, 0x201
jae 0x403fa6
jmp 0x404050
cmp ebx, esi
mov esi, ebx
jb 0x4040a3
cmp esi, 0x201
jb 0x404050
mov edi, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x20]
mov edx, esi
mov eax, edi
sub edx, ecx
sub eax, ecx
cmp eax, edx
jae 0x404000
mov ebx, dword [ebp - 0x2c]
add edx, ecx
jb 0x4041a5
lea ecx, [edi + edi]
mov eax, 4
cmp ecx, edx
cmova edx, ecx
cmp edx, 4
cmovbe edx, eax
xor eax, eax
add edx, edx
setae al
add eax, eax
test edi, edi
je 0x404005
mov dword [ebp - 0x50], ebx
mov dword [ebp - 0x4c], ecx
mov dword [ebp - 0x48], 2
jmp 0x40400c
mov ecx, dword [ebp - 0x2c]
jmp 0x404034
mov dword [ebp - 0x50], 0
lea ecx, [ebp - 0x60]
lea ebx, [ebp - 0x50]
push ebx
push eax
call fcn.00402d40
add esp, 8
mov ecx, dword [ebp - 0x5c]
mov eax, dword [ebp - 0x58]
cmp dword [ebp - 0x60], 1
je 0x4041bd
shr eax, 1
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x28], eax
mov edi, ecx
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x2c], ecx
jmp 0x40405d
mov dword [ebp - 0x3c], 0x200
lea edi, [ebp - 0x474]
push 0
call sub.kernel32.dll_SetLastError
push esi
push edi
push dword [ebp - 0x40]
call sub.kernel32.dll_GetEnvironmentVariableW
mov ebx, eax
test eax, eax
jne 0x40407d
call sub.kernel32.dll_GetLastError
test eax, eax
jne 0x4040ef
cmp ebx, esi
jne 0x403f90
call sub.kernel32.dll_GetLastError
cmp eax, 0x7a
jne 0x403f90
add esi, esi
cmp esi, 0x201
jae 0x403fa6
jmp 0x404050
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x3c]
cmp eax, ebx
jb 0x404265
push ebx
push edi
lea eax, [ebp - 0x50]
push eax
call fcn.0040b620
add esp, 0xc
mov eax, dword [ebp - 0x4c]
mov ecx, dword [ebp - 0x48]
mov esi, dword [ebp - 0x50]
mov edi, dword [ebp - 0x28]
xor ebx, ebx
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x3c], ecx
test edi, edi
jne 0x404111
jmp 0x404129
mov eax, dword [ebp - 0x24]
mov edi, dword [ebp - 0x28]
xor esi, esi
mov bl, 1
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x34], edi
call sub.kernel32.dll_GetLastError
mov dword [ebp - 0x20], eax
test edi, edi
je 0x404129
cmp dword [ebp - 0x2c], 0
je 0x404129
add edi, edi
je 0x404129
push 2
push edi
push dword [ebp - 0x2c]
call fcn.00459be0
add esp, 0xc
xor edi, edi
test bl, bl
je 0x40415b
mov ebx, esi
mov esi, dword [ebp - 0x20]
test bl, bl
sete al
cmp esi, 0xcb
sete cl
xor edx, edx
and cl, al
mov eax, dword [ebp - 0x40]
cmovne ebx, edx
xor cl, 1
movzx edi, cl
mov ecx, dword [ebp - 0x54]
test ecx, ecx
jne 0x40416a
jmp 0x40417e
mov ebx, esi
mov eax, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x54]
mov esi, dword [ebp - 0x20]
test ecx, ecx
je 0x40417e
test eax, eax
je 0x40417e
add ecx, ecx
je 0x40417e
push 2
push ecx
push eax
call fcn.00459be0
add esp, 0xc
test edi, edi
jne 0x4041ef
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x3c]
mov edx, dword [ebp - 0x18]
mov dword [eax], ebx
mov dword [eax + 4], esi
mov dword [eax + 8], ecx
mov dword fs:[0], edx
add esp, 0x468
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x20]
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x34], edi
jmp 0x4041d0
mov edx, dword [ebp - 0x24]
mov esi, dword [ebp - 0x20]
test eax, eax
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x30], esi
mov dword [ebp - 0x34], edi
jne 0x4041de
mov dword [ebp - 0x10], 0
call fcn.00416da0
ud2
push eax
push ecx
call fcn.00416b80
add esp, 8
ud2
mov dword [ebp - 0x20], esi
jmp 0x4041f1
mov ecx, ebx
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x60], ecx
mov dword [ebp - 0x474], 0x461678
mov dword [ebp - 0x470], 2
mov dword [ebp - 0x46c], 0
mov dword [ebp - 0x10], 1
mov dword [ebp - 0x5c], eax
lea eax, [ebp - 0x68]
mov dword [ebp - 0x50], eax
lea eax, [ebp - 0x60]
mov dword [ebp - 0x4c], 0x4075e0
mov dword [ebp - 0x48], eax
lea eax, [ebp - 0x50]
mov dword [ebp - 0x44], 0x4047d0
mov dword [ebp - 0x464], eax
mov dword [ebp - 0x460], 2
lea eax, [ebp - 0x474]
push 0x461688
push eax
call fcn.00409e80
add esp, 8
jmp 0x4041dc
push 0x4625ec
push eax
push ebx
call fcn.00413b50
add esp, 0xc
jmp 0x4041dc