Function at 0x5866d0
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5b257f
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 0x586906
push 0x40
push eax
call fcn.00529578
add esp, 8
test eax, eax
je 0x586906
sub eax, dword [ebx]
sar eax, 1
jne 0x586906
push 1
push 0
mov ecx, ebx
call fcn.00407960
push 0x2d
push dword [ebx]
call fcn.00529c14
mov esi, eax
add esp, 8
test esi, esi
jne 0x586745
or esi, 0xffffffff
jmp 0x586749
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.0052a76a
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 0x58678a
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x586914
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.0041505f
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x5867c4
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 0x5867f9
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.00528e72
add esp, 8
test eax, eax
js 0x5868fc
cmp eax, dword [esi - 8]
jg 0x5868fc
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 0x5868ac
mov eax, dword [ebx]
mov ecx, 1
sub ecx, dword [eax - 4]
mov eax, dword [eax - 8]
sub eax, 0x100
or eax, ecx
jge 0x586862
push pe_nt_image_headers32
mov ecx, ebx
call fcn.00402c20
push pe_nt_image_headers32
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 0x58687f
xor ecx, ecx
jmp 0x586891
push dword [eax - 8]
push eax
call fcn.00528e72
mov ecx, eax
add esp, 8
test ecx, ecx
js 0x5868fc
mov eax, dword [ebx]
cmp ecx, dword [eax - 8]
jg 0x5868fc
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 0x5868cc
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 0x586914
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