Function at 0x5aaa90
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5d535d
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push esi
push edi
mov eax, dword [0x638fe4]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov eax, dword [edi]
cmp dword [eax - 0xc], 0
jle 0x5aacbb
push 0x40
push eax
call fcn.0054713d
add esp, 8
test eax, eax
je 0x5aacbb
sub eax, dword [edi]
sar eax, 1
jne 0x5aacbb
push 1
push 0
mov ecx, edi
call fcn.00408b40
push 0x2d
push dword [edi]
call fcn.005471eb
mov esi, eax
add esp, 8
test esi, esi
jne 0x5aab05
or esi, 0xffffffff
jmp 0x5aab09
sub esi, dword [edi]
sar esi, 1
mov eax, dword [edi]
mov ecx, edi
mov eax, dword [eax - 0xc]
sub eax, esi
dec eax
push eax
lea eax, [ebp - 0x10]
push eax
call fcn.00408960
push dword [eax]
call fcn.0054ea10
mov edx, dword [ebp - 0x10]
add esp, 4
mov dword [ebp - 0x14], eax
add edx, 0xfffffff0
or ecx, 0xffffffff
lock xadd dword [edx + 0xc], ecx
dec ecx
test ecx, ecx
jg 0x5aab6a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
mov ebx, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x5aab68
mov ecx, dword [ecx + 4]
mov eax, dword [ecx]
mov ebx, dword [eax + 4]
cmp eax, vtable.ATL::CWin32Heap.0
jne 0x5aab68
push 0
push dword [ecx + 4]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x5aab6a
call ebx
cmp dword [ebp - 0x14], 0
je 0x5aacc9
lea eax, [esi - 1]
mov ecx, edi
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.004088d0
mov dword [ebp - 4], 0
call fcn.00418413
mov ecx, eax
test ecx, ecx
jne 0x5aab9f
push 0x80004005
call fcn.00402650
mov eax, dword [ecx]
mov edx, dword [eax + 0xc]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x5aabb4
lock inc dword [ecx + 0x14]
lea eax, [ecx + 8]
jmp 0x5aabb6
call edx
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
mov byte [ebp - 4], 1
mov ebx, 1
mov eax, dword [esi - 8]
mov ecx, ebx
sub ecx, dword [esi - 4]
sub eax, 0x104
or ecx, eax
jge 0x5aabe6
push 0x104
lea ecx, [ebp - 0x10]
call fcn.00402cf0
mov esi, dword [ebp - 0x10]
push 0x104
push esi
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push dword [esi - 8]
push esi
call fcn.0054c667
add esp, 8
test eax, eax
js 0x5aacb1
cmp eax, dword [esi - 8]
jg 0x5aacb1
xor ecx, ecx
mov dword [esi - 0xc], eax
push 3
push ecx
push esi
mov word [esi + eax*2], cx
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov esi, eax
test esi, esi
je 0x5aac8f
mov ecx, dword [edi]
sub ebx, dword [ecx - 4]
mov ecx, dword [ecx - 8]
sub ecx, 0x100
or ebx, ecx
jge 0x5aac49
push 0x100
mov ecx, edi
call fcn.00402cf0
push 0x100
push dword [edi]
push dword [ebp - 0x14]
push esi
call dword [sym.imp.USER32.dll_LoadStringW]
mov eax, dword [edi]
test eax, eax
jne 0x5aac64
xor ecx, ecx
jmp 0x5aac76
push dword [eax - 8]
push eax
call fcn.0054c667
mov ecx, eax
add esp, 8
test ecx, ecx
js 0x5aacb1
mov eax, dword [edi]
cmp ecx, dword [eax - 8]
jg 0x5aacb1
mov dword [eax - 0xc], ecx
xor edx, edx
mov eax, dword [edi]
push esi
mov word [eax + ecx*2], dx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
lea ecx, [ebp - 0x10]
call fcn.00402b90
lea ecx, [ebp - 0x18]
call fcn.00402b90
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.00402650
push 5
push str.Error
mov ecx, edi
call fcn.00403620
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret