Function at 0x40a140
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42f7a8
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
mov eax, dword [0x443004]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, edx
mov dword [ebp - 0x38], esi
mov ebx, ecx
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
mov dword [ebp - 0x54], eax
test eax, eax
je 0x40a410
xorps xmm0, xmm0
mov dword [ebp - 0x14], 0
movq qword [ebp - 0x1c], xmm0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 4], 0
mov edi, eax
cmp word [eax], 0
je 0x40a33e
mov esi, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ecx, edi
mov dword [ebp - 0x40], 0
xor eax, eax
mov dword [ebp - 0x3c], 7
mov word [ebp - 0x50], ax
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40a1e0
sub ecx, edx
sar ecx, 1
push ecx
push edi
lea ecx, [ebp - 0x50]
call fcn.00403bc0
push 0
push 0
push 0
mov byte [ebp - 4], 1
lea eax, [ebp - 0x50]
cmp dword [ebp - 0x3c], 8
push 0
cmovae eax, dword [ebp - 0x50]
push 0xffffffffffffffff
push eax
push 0
push 0xfde9
call esi
mov esi, eax
mov dword [ebp - 0x24], 0
push 0
push esi
lea ecx, [ebp - 0x34]
mov dword [ebp - 0x20], 0xf
mov byte [ebp - 0x34], 0
call fcn.00403d10
cmp dword [ebp - 0x20], 0x10
lea ecx, [ebp - 0x34]
push 0
cmovae ecx, dword [ebp - 0x34]
lea eax, [ebp - 0x50]
cmp dword [ebp - 0x3c], 8
push 0
cmovae eax, dword [ebp - 0x50]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push ecx
push 0xffffffffffffffff
push eax
push 0
push 0xfde9
call esi
mov byte [ebp - 4], 3
mov edx, dword [ebp - 0x3c]
cmp edx, 8
jb 0x40a2a7
mov ecx, dword [ebp - 0x50]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40a29d
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40a438
push edx
push ecx
call fcn.0040ebf3
add esp, 8
xor eax, eax
mov dword [ebp - 0x40], 0
mov word [ebp - 0x50], ax
lea ecx, [ebp - 0x34]
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x3c], 7
push ecx
cmp eax, dword [ebp - 0x14]
je 0x40a2d4
mov ecx, eax
call fcn.00402df0
add dword [ebp - 0x18], 0x18
jmp 0x40a2dd
push eax
lea ecx, [ebp - 0x1c]
call fcn.0040c5a0
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40a2e2
sub eax, edx
mov byte [ebp - 4], cl
mov edx, dword [ebp - 0x20]
sar eax, 1
lea edi, [edi + eax*2]
add edi, 2
cmp edx, 0x10
jb 0x40a32e
mov ecx, dword [ebp - 0x34]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40a324
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40a438
push edx
push ecx
call fcn.0040ebf3
add esp, 8
cmp word [edi], 0
jne 0x40a1c0
mov esi, dword [ebp - 0x38]
mov eax, dword [ebp - 0x54]
push eax
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov ecx, dword [ebp - 0x18]
mov eax, 0x2aaaaaab
sub ecx, dword [ebp - 0x1c]
imul ecx
xor ecx, ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, 4
mov dword [esi], eax
inc eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0040ec24
mov ecx, dword [ebp - 0x38]
add esp, 4
mov dword [ebx], eax
xor esi, esi
mov ecx, dword [ecx]
test ecx, ecx
jle 0x40a3af
xor edi, edi
mov eax, dword [ebp - 0x1c]
add eax, edi
cmp dword [eax + 0x14], 0x10
jb 0x40a394
mov eax, dword [eax]
push eax
call fcn.004184e5
mov ecx, dword [ebx]
add esp, 4
add edi, 0x18
mov dword [ecx + esi*4], eax
inc esi
mov eax, dword [ebp - 0x38]
mov ecx, dword [eax]
cmp esi, ecx
jl 0x40a387
mov eax, dword [ebx]
mov dword [eax + ecx*4], 0
mov ecx, dword [ebp - 0x1c]
test ecx, ecx
je 0x40a41c
mov edx, dword [ebp - 0x18]
push ecx
call fcn.0040ca40
mov ecx, dword [ebp - 0x14]
mov eax, 0x2aaaaaab
mov esi, dword [ebp - 0x1c]
add esp, 4
sub ecx, esi
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
lea ecx, [eax + eax*2]
mov eax, esi
shl ecx, 3
cmp ecx, 0x1000
jb 0x40a404
mov esi, dword [esi - 4]
add ecx, 0x23
sub eax, esi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40a438
push ecx
push esi
call fcn.0040ebf3
add esp, 8
jmp 0x40a41c
mov dword [esi], 0
mov dword [ebx], 0
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040ebad
mov esp, ebp
pop ebp
ret
call fcn.00417be8
int3