Function at 0x586400
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5b219f
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x616040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov eax, dword [ebx]
cmp dword [eax - 0xc], 0
jle 0x586636
push 0x40
push eax
call fcn.00529548
add esp, 8
test eax, eax
je 0x586636
sub eax, dword [ebx]
sar eax, 1
jne 0x586636
push 1
push 0
mov ecx, ebx
call fcn.00407960
push 0x2d
push dword [ebx]
call fcn.00529be4
mov esi, eax
add esp, 8
test esi, esi
jne 0x586475
or esi, 0xffffffff
jmp 0x586479
sub esi, dword [ebx]
sar esi, 1
mov eax, dword [ebx]
mov ecx, ebx
mov eax, dword [eax - 0xc]
sub eax, esi
dec eax
push eax
lea eax, [ebp - 0x1c]
push eax
call fcn.00407b60
push dword [eax]
call fcn.0052a73a
mov edi, dword [ebp - 0x1c]
add esp, 4
add edi, 0xfffffff0
mov dword [ebp - 0x14], eax
or ecx, 0xffffffff
lea edx, [edi + 0xc]
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x5864ba
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x586644
lea eax, [esi - 1]
mov ecx, ebx
push eax
lea eax, [ebp - 0x20]
push eax
call fcn.00407be0
mov dword [ebp - 4], 0
call fcn.00414e1f
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x5864f4
push 0x80004005
call fcn.00402740
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
mov byte [ebp - 4], 1
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x586529
push 0x104
lea ecx, [ebp - 0x10]
call fcn.00402c20
mov esi, dword [ebp - 0x10]
mov edi, dword [ebp - 0x20]
push 0x104
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push dword [esi - 8]
push esi
call fcn.00528e42
add esp, 8
test eax, eax
js 0x58662c
cmp eax, dword [esi - 8]
jg 0x58662c
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 dword [ebp - 0x18], eax
test eax, eax
je 0x5865dc
mov eax, dword [ebx]
mov ecx, 1
sub ecx, dword [eax - 4]
mov eax, dword [eax - 8]
sub eax, 0x100
or eax, ecx
jge 0x586592
push 0x100
mov ecx, ebx
call fcn.00402c20
push 0x100
push dword [ebx]
push dword [ebp - 0x14]
push dword [ebp - 0x18]
call dword [sym.imp.USER32.dll_LoadStringW]
mov eax, dword [ebx]
test eax, eax
jne 0x5865af
xor ecx, ecx
jmp 0x5865c1
push dword [eax - 8]
push eax
call fcn.00528e42
mov ecx, eax
add esp, 8
test ecx, ecx
js 0x58662c
mov eax, dword [ebx]
cmp ecx, dword [eax - 8]
jg 0x58662c
push dword [ebp - 0x18]
mov dword [eax - 0xc], ecx
xor edx, edx
mov eax, dword [ebx]
mov word [eax + ecx*2], dx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
add esi, 0xfffffff0
mov byte [ebp - 4], 0
or ebx, 0xffffffff
mov ecx, ebx
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x5865fc
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
add edi, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea eax, [edi + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x586644
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
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.00402740
push 5
push str.Error
mov ecx, ebx
call fcn.004035a0
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret