Function at 0x40aed0
Capabilities:
Query environment variable

Disassembly:
sub esp, 8
mov eax, dword [0x41e73c]
push ebx
push ebp
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
xor ebx, ebx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
test eax, eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], ebx
jne 0x40af23
call esi
test eax, eax
mov dword [esp + 0x10], eax
je 0x40af07
mov eax, 1
jmp 0x40af1a
call edi
test eax, eax
mov dword [esp + 0x10], eax
je 0x40b0c2
mov eax, 2
mov ebx, dword [esp + 0x10]
mov dword [0x41e73c], eax
cmp eax, 1
jne 0x40afac
test ebx, ebx
jne 0x40af46
call esi
test eax, eax
mov dword [esp + 0x10], eax
jne 0x40af42
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
mov ebx, dword [esp + 0x10]
cmp word [ebx], 0
mov eax, ebx
je 0x40af60
add eax, 2
cmp word [eax], 0
jne 0x40af4e
add eax, 2
cmp word [eax], 0
jne 0x40af4e
sub eax, ebx
add eax, 2
mov esi, eax
push esi
call fcn.00407820
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x40af87
push ebx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
mov ecx, esi
mov esi, ebx
mov eax, ecx
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
cmp eax, 2
jne 0x40b0a6
test ebx, ebx
jne 0x40afcf
call edi
test eax, eax
mov dword [esp + 0x10], eax
jne 0x40afcb
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
mov ebx, dword [esp + 0x10]
mov al, byte [ebx]
mov esi, ebx
test al, al
je 0x40b017
mov ecx, dword [0x41e760]
push 0
push 0
push 0xffffffffffffffff
push esi
push 1
push ecx
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
je 0x40b0c2
mov ebp, dword [esp + 0x14]
mov edi, esi
add ebp, eax
or ecx, 0xffffffff
xor eax, eax
mov dword [esp + 0x14], ebp
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov al, byte [esi + ecx + 1]
lea esi, [esi + ecx + 1]
test al, al
jne 0x40afd7
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
lea edx, [eax + eax]
push edx
call fcn.00407820
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x40b043
push ebx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
mov eax, dword [esp + 0x10]
mov esi, ebp
cmp byte [eax], 0
je 0x40b094
mov edx, dword [esp + 0x14]
mov ecx, esi
sub ecx, ebp
mov eax, dword [0x41e760]
sar ecx, 1
sub edx, ecx
push edx
push esi
push 0xffffffffffffffff
push ebx
push 1
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
je 0x40b0ae
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
push esi
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea ebx, [ebx + ecx + 1]
call fcn.004085d0
lea esi, [esi + eax*2 + 2]
mov al, byte [ebx]
add esp, 4
test al, al
jne 0x40b04e
mov edx, dword [esp + 0x10]
mov word [esi], 0
push edx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
push ebp
call fcn.004078d0
mov ecx, dword [esp + 0x14]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret