Function at 0x58c7e0
Capabilities:
Get common file path
Get program files directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5b2ca8
mov eax, dword fs:[0]
push eax
sub esp, 0x384
mov eax, dword [0x616040]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, edx
mov dword [ebp - 0x37c], esi
mov dword [ebp - 0x380], ecx
mov eax, dword [ebp + 8]
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x374], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x38c], eax
mov dword [ebp - 0x390], 0
call fcn.0041505f
mov ecx, eax
xor eax, eax
test ecx, ecx
setne al
test eax, eax
jne 0x58c857
push 0x80004005
call fcn.00402740
mov eax, dword [ecx]
call dword [eax + 0xc]
lea edi, [eax + 0x10]
mov dword [ebp - 0x370], edi
cmp dword [ebp + 0xc], 0
mov dword [ebp - 4], 0
je 0x58cb70
push 0x5e9af0
lea ecx, [ebp - 0x36c]
call fcn.00402f60
push 0x5e9af0
lea ecx, [ebp - 0x378]
mov byte [ebp - 4], 1
call fcn.00402f60
or esi, 0xffffffff
mov byte [ebp - 4], 2
test ebx, ebx
jle 0x58c98e
mov edx, dword [ebp - 0x374]
lea ecx, [ebp - 0x384]
push ebx
call fcn.0058f8e0
add esp, 4
push eax
lea ecx, [ebp - 0x36c]
mov byte [ebp - 4], 3
call fcn.004032d0
mov byte [ebp - 4], 2
mov ecx, esi
mov edx, dword [ebp - 0x384]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58c8f1
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
cmp ebx, 0xa0009
je 0x58c942
cmp ebx, 0x6020000
jne 0x58c98e
push ebx
push dword [ebp - 0x374]
call fcn.00567330
mov edx, dword [ebp - 0x374]
lea ecx, [ebp - 0x384]
push eax
call fcn.0058f8e0
add esp, 4
push eax
lea ecx, [ebp - 0x378]
mov byte [ebp - 4], 4
call fcn.004032d0
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x384]
jmp 0x58c975
mov edx, dword [ebp - 0x374]
lea ecx, [ebp - 0x388]
push 0x23c2
call fcn.0058f8e0
add esp, 4
push eax
lea ecx, [ebp - 0x378]
mov byte [ebp - 4], 5
call fcn.004032d0
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x388]
add edx, 0xfffffff0
mov ecx, esi
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58c98e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x38c]
test eax, eax
je 0x58c9a4
push eax
lea ecx, [ebp - 0x36c]
call fcn.004032d0
mov ecx, dword [ebp - 0x37c]
test ecx, ecx
je 0x58c9b1
mov ecx, dword [ecx + 0x20]
xor eax, eax
lea edx, [ebp - 0x36c]
cmp ebx, 0xa0009
sete al
push eax
lea eax, [ebp - 0x378]
push eax
call fcn.00586c80
add esp, 8
test eax, eax
jne 0x58ca55
mov ebx, dword [ebp - 0x380]
mov ecx, ebx
push 0x5e9af0
call fcn.00402f60
mov byte [ebp - 4], 1
mov ecx, esi
mov edx, dword [ebp - 0x378]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58ca0b
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov ecx, esi
mov edx, dword [ebp - 0x36c]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58ca2e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add edi, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea eax, [edi + 0xc]
lock xadd dword [eax], esi
dec esi
test esi, esi
jg 0x58cdda
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
jmp 0x58cdda
mov eax, dword [ebp - 0x36c]
cmp dword [eax - 4], 1
jle 0x58ca75
push dword [eax - 0xc]
lea ecx, [ebp - 0x36c]
call fcn.00402c90
mov eax, dword [ebp - 0x36c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveBackslashW]
mov eax, dword [ebp - 0x36c]
push dword [eax - 8]
push eax
call fcn.00528e72
mov edx, eax
add esp, 8
test edx, edx
js 0x58cb66
mov ecx, dword [ebp - 0x36c]
cmp edx, dword [ecx - 8]
jg 0x58cb66
mov dword [ecx - 0xc], edx
lea ebx, [edi - 0x10]
mov eax, dword [ebp - 0x36c]
xor ecx, ecx
mov word [eax + edx*2], cx
mov eax, dword [ebp - 0x36c]
lea edx, [eax - 0x10]
cmp edx, ebx
je 0x58cb1c
cmp dword [ebx + 0xc], ecx
lea edi, [ebx + 0xc]
jl 0x58cb07
mov ecx, dword [edx]
cmp ecx, dword [ebx]
jne 0x58cb07
push edx
call fcn.00403660
add esp, 4
mov dword [ebp - 0x37c], eax
mov ecx, esi
lock xadd dword [edi], ecx
dec ecx
test ecx, ecx
jg 0x58cafc
mov ecx, dword [ebx]
push ebx
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x37c]
lea edi, [eax + 0x10]
mov dword [ebp - 0x370], edi
jmp 0x58cb1c
push dword [eax - 0xc]
lea ecx, [ebp - 0x370]
push eax
call fcn.004035a0
mov edi, dword [ebp - 0x370]
mov byte [ebp - 4], 1
mov ecx, esi
mov edx, dword [ebp - 0x378]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58cb3f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov ecx, esi
mov edx, dword [ebp - 0x36c]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58cda8
mov ecx, dword [edx]
push edx
jmp 0x58cda3
push 0x80070057
call fcn.00402740
push 0x239f
xor edx, edx
lea ecx, [ebp - 0x37c]
call fcn.0058f8e0
add esp, 4
push 1
push 0
push esi
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x368]
mov ebx, dword [ebp - 0x37c]
push ebx
push 0x101000
push 0
push 0
push 1
call fcn.0041ea4a
mov byte [ebp - 4], 7
call fcn.0041505f
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x58cbcb
push 0x80004005
call fcn.00402740
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x374], esi
mov byte [ebp - 4], 8
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x58cc09
push 0x104
lea ecx, [ebp - 0x374]
call fcn.00402c20
mov esi, dword [ebp - 0x374]
push 0
push 0x26
push esi
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
push dword [esi - 8]
push esi
call fcn.00528e72
add esp, 8
test eax, eax
js 0x58cb66
cmp eax, dword [esi - 8]
jg 0x58cb66
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
lea ecx, [ebp - 0x368]
call fcn.0041f557
lea ecx, [ebp - 0x368]
mov dword [eax + 0x2c], esi
call fcn.0041f3dd
cmp eax, 1
je 0x58cce3
mov ecx, dword [ebp - 0x380]
push 0x5e9af0
call fcn.00402f60
lea edx, [esi - 0x10]
mov byte [ebp - 4], 7
or esi, 0xffffffff
lea ecx, [edx + 0xc]
mov eax, esi
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x58cc8e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea ecx, [ebp - 0x368]
mov byte [ebp - 4], 6
call fcn.0041ed18
add ebx, 0xfffffff0
mov byte [ebp - 4], 0
mov ecx, esi
lea eax, [ebx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58ccba
mov ecx, dword [ebx]
push ebx
mov eax, dword [ecx]
call dword [eax + 4]
add edi, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea eax, [edi + 0xc]
lock xadd dword [eax], esi
dec esi
test esi, esi
jg 0x58ccd8
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x380]
jmp 0x58cddc
lea eax, [ebp - 0x388]
push eax
lea ecx, [ebp - 0x368]
call fcn.0041f55e
push eax
lea ecx, [ebp - 0x370]
mov byte [ebp - 4], 9
call fcn.004032d0
mov byte [ebp - 4], 8
or eax, 0xffffffff
mov edx, dword [ebp - 0x388]
add edx, 0xfffffff0
lea ecx, [edx + 0xc]
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x58cd29
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea ecx, [ebp - 0x370]
call fcn.0058c290
mov edi, dword [ebp - 0x370]
push edi
call dword [sym.imp.SHELL32.dll_PathIsExe]
test eax, eax
jne 0x58cd5c
push eax
push 0x5e9af0
lea ecx, [ebp - 0x370]
call fcn.004035a0
mov edi, dword [ebp - 0x370]
lea edx, [esi - 0x10]
mov byte [ebp - 4], 7
or esi, 0xffffffff
lea eax, [edx + 0xc]
mov ecx, esi
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58cd7c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea ecx, [ebp - 0x368]
mov byte [ebp - 4], 6
call fcn.0041ed18
add ebx, 0xfffffff0
mov byte [ebp - 4], 0
mov ecx, esi
lea eax, [ebx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x58cda8
mov ecx, dword [ebx]
push ebx
mov eax, dword [ecx]
call dword [eax + 4]
add edi, 0xfffffff0
push edi
call fcn.00403660
mov ebx, dword [ebp - 0x380]
add eax, 0x10
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov dword [ebx], eax
lea eax, [edi + 0xc]
lock xadd dword [eax], esi
dec esi
test esi, esi
jg 0x58cdda
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00527e5c
mov esp, ebp
pop ebp
ret