Function at 0x584a40
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5afecc
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x614040]
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 0x584c76
push 0x40
push eax
call fcn.00529548
add esp, 8
test eax, eax
je 0x584c76
sub eax, dword [ebx]
sar eax, 1
jne 0x584c76
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 0x584ab5
or esi, 0xffffffff
jmp 0x584ab9
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 0x584afa
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x584c84
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.00414eab
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x584b34
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 0x584b69
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 0x584c6c
cmp eax, dword [esi - 8]
jg 0x584c6c
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 0x584c1c
mov eax, dword [ebx]
mov ecx, 1
sub ecx, dword [eax - 4]
mov eax, dword [eax - 8]
sub eax, 0x100
or eax, ecx
jge 0x584bd2
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 0x584bef
xor ecx, ecx
jmp 0x584c01
push dword [eax - 8]
push eax
call fcn.00528e42
mov ecx, eax
add esp, 8
test ecx, ecx
js 0x584c6c
mov eax, dword [ebx]
cmp ecx, dword [eax - 8]
jg 0x584c6c
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 0x584c3c
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 0x584c84
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