Function at 0x40aeb0
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 0x40af03
call esi
test eax, eax
mov dword [esp + 0x10], eax
je 0x40aee7
mov eax, 1
jmp 0x40aefa
call edi
test eax, eax
mov dword [esp + 0x10], eax
je 0x40b0a2
mov eax, 2
mov ebx, dword [esp + 0x10]
mov dword [0x41e73c], eax
cmp eax, 1
jne 0x40af8c
test ebx, ebx
jne 0x40af26
call esi
test eax, eax
mov dword [esp + 0x10], eax
jne 0x40af22
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 0x40af40
add eax, 2
cmp word [eax], 0
jne 0x40af2e
add eax, 2
cmp word [eax], 0
jne 0x40af2e
sub eax, ebx
add eax, 2
mov esi, eax
push esi
call fcn.00407800
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x40af67
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 0x40b086
test ebx, ebx
jne 0x40afaf
call edi
test eax, eax
mov dword [esp + 0x10], eax
jne 0x40afab
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 0x40aff7
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 0x40b0a2
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 0x40afb7
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
lea edx, [eax + eax]
push edx
call fcn.00407800
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x40b023
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 0x40b074
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 0x40b08e
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.004085b0
lea esi, [esi + eax*2 + 2]
mov al, byte [ebx]
add esp, 4
test al, al
jne 0x40b02e
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.004078b0
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