Function at 0x40e870
Capabilities:
Query environment variable

Disassembly:
push ebp
lea ebp, [esp - 0x414]
sub esp, 0x414
push 0xfffffffffffffffe
push 0x4e2fc0
push 0x497f80
mov eax, dword fs:[0]
push eax
sub esp, 0x2c
mov eax, dword [0x4f2008]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp + 0x410], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x18], esp
mov edi, edx
mov esi, ecx
mov dword [ebp - 0x30], esi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 4], 0
mov ecx, edi
call fcn.00402634
mov ecx, esi
call fcn.0040eb40
mov bl, al
mov byte [ebp - 0x1d], bl
mov dword [ebp - 4], 0xfffffffe
jmp 0x40e8fc
test bl, bl
jne 0x40eb04
cmp esi, 0x1a
jne 0x40eb04
mov ecx, edi
call fcn.00402634
push 0x410
push 0
lea eax, [ebp]
push eax
call fcn.00497aa0
add esp, 0xc
push 0x207
lea eax, [ebp]
push eax
push str.APPDATA
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp]
push eax
call fcn.00401a44
add esp, 4
mov dword [ebp - 0x28], eax
mov ecx, edi
call fcn.00401970
mov esi, eax
mov dword [ebp - 0x2c], esi
mov edx, dword [esi + 0x14]
mov dword [ebp - 0x3c], edx
mov eax, dword [ebp - 0x28]
cmp eax, edx
ja 0x40e9a2
mov ecx, esi
mov dword [ebp - 0x1c], esi
cmp edx, 8
jb 0x40e972
mov ecx, dword [esi]
mov dword [ebp - 0x1c], ecx
mov dword [esi + 0x10], eax
push eax
lea eax, [ebp]
push eax
push ecx
call fcn.00401a12
mov dword [ebp - 0x2c], 0
lea eax, [ebp - 0x2c]
push eax
mov ecx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x1c]
lea eax, [eax + ecx*2]
push eax
call fcn.00401a01
add esp, 0x14
jmp 0x40eaf0
mov ecx, edi
call fcn.00401b82
cmp dword [ebp - 0x28], eax
ja 0x40eb29
mov ecx, edi
call fcn.00401b82
mov dword [ebp - 0x24], eax
mov ecx, dword [ebp - 0x28]
or ecx, 7
mov dword [ebp - 0x38], ecx
cmp ecx, eax
ja 0x40ea06
mov ecx, edi
call fcn.00401970
mov eax, dword [eax + 0x14]
mov dword [ebp - 0x1c], eax
mov edx, eax
shr edx, 1
mov eax, dword [ebp - 0x24]
sub eax, edx
mov ecx, dword [ebp - 0x1c]
cmp ecx, eax
jbe 0x40e9eb
mov eax, dword [ebp - 0x24]
jmp 0x40ea03
lea eax, [edx + ecx]
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x38]
push eax
call fcn.004019ef
add esp, 8
mov eax, dword [eax]
mov dword [ebp - 0x24], eax
inc eax
lea ecx, [eax + eax]
cmp eax, 0x7fffffff
jbe 0x40ea16
or ecx, 0xffffffff
jmp 0x40ea1e
cmp ecx, 0x1000
jb 0x40ea47
lea eax, [ecx + 0x23]
or edx, 0xffffffff
cmp eax, ecx
cmovbe eax, edx
push eax
call fcn.00495cb6
add esp, 4
mov ecx, eax
test ecx, ecx
je 0x40eb2e
lea eax, [ecx + 0x23]
and eax, 0xffffffe0
mov dword [eax - 4], ecx
jmp 0x40ea58
test ecx, ecx
je 0x40ea56
push ecx
call fcn.00495cb6
add esp, 4
jmp 0x40ea58
xor eax, eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x28]
mov dword [esi + 0x10], eax
mov ecx, dword [ebp - 0x24]
mov dword [esi + 0x14], ecx
mov esi, dword [ebp - 0x1c]
push eax
lea eax, [ebp]
push eax
push esi
call fcn.00401a2b
mov dword [ebp - 0x24], 0
lea eax, [ebp - 0x24]
push eax
mov eax, dword [ebp - 0x28]
lea eax, [esi + eax*2]
push eax
call fcn.00401a01
add esp, 0x14
mov ecx, dword [ebp - 0x3c]
cmp ecx, 8
jb 0x40eace
lea ecx, [ecx*2 + 2]
mov esi, dword [ebp - 0x2c]
mov eax, dword [esi]
cmp ecx, 0x1000
jb 0x40eabd
add ecx, 0x23
mov edx, dword [eax - 4]
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40eb2e
mov eax, edx
push ecx
push eax
call fcn.00495ce6
add esp, 8
mov eax, dword [ebp - 0x1c]
mov dword [esi], eax
jmp 0x40eaf0
lea eax, [ebp - 0x1c]
push eax
call fcn.00401a5f
mov esi, eax
push dword [ebp - 0x2c]
call fcn.00401a5f
push eax
push 4
call fcn.00401880
add esp, 0x10
mov edx, dword [esi]
mov dword [eax], edx
mov ecx, edi
call fcn.00402620
movzx ebx, bl
mov ecx, 1
test al, al
cmove ebx, ecx
mov al, bl
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x410]
xor ecx, ebp
call fcn.00495ca5
lea esp, [ebp + 0x414]
pop ebp
ret
call fcn.00401b40
call fcn.00499d54
int3