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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5b0526
mov eax, dword fs:[0]
push eax
sub esp, 0x384
mov eax, dword [0x614040]
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.00414eab
mov ecx, eax
xor eax, eax
test ecx, ecx
setne al
test eax, eax
jne 0x58a517
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 0x58a830
push 0x5e7af0
lea ecx, [ebp - 0x36c]
call fcn.00402f60
push 0x5e7af0
lea ecx, [ebp - 0x378]
mov byte [ebp - 4], 1
call fcn.00402f60
or esi, 0xffffffff
mov byte [ebp - 4], 2
test ebx, ebx
jle 0x58a64e
mov edx, dword [ebp - 0x374]
lea ecx, [ebp - 0x384]
push ebx
call fcn.0058d5b0
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 0x58a5b1
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
cmp ebx, 0xa0009
je 0x58a602
cmp ebx, 0x6020000
jne 0x58a64e
push ebx
push dword [ebp - 0x374]
call fcn.00566c40
mov edx, dword [ebp - 0x374]
lea ecx, [ebp - 0x384]
push eax
call fcn.0058d5b0
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 0x58a635
mov edx, dword [ebp - 0x374]
lea ecx, [ebp - 0x388]
push 0x23c2
call fcn.0058d5b0
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 0x58a64e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x38c]
test eax, eax
je 0x58a664
push eax
lea ecx, [ebp - 0x36c]
call fcn.004032d0
mov ecx, dword [ebp - 0x37c]
test ecx, ecx
je 0x58a671
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.00584ff0
add esp, 8
test eax, eax
jne 0x58a715
mov ebx, dword [ebp - 0x380]
mov ecx, ebx
push 0x5e7af0
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 0x58a6cb
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 0x58a6ee
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 0x58aa9a
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
jmp 0x58aa9a
mov eax, dword [ebp - 0x36c]
cmp dword [eax - 4], 1
jle 0x58a735
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.00528e42
mov edx, eax
add esp, 8
test edx, edx
js 0x58a826
mov ecx, dword [ebp - 0x36c]
cmp edx, dword [ecx - 8]
jg 0x58a826
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 0x58a7dc
cmp dword [ebx + 0xc], ecx
lea edi, [ebx + 0xc]
jl 0x58a7c7
mov ecx, dword [edx]
cmp ecx, dword [ebx]
jne 0x58a7c7
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 0x58a7bc
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 0x58a7dc
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 0x58a7ff
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 0x58aa68
mov ecx, dword [edx]
push edx
jmp 0x58aa63
push 0x80070057
call fcn.00402740
push 0x239f
xor edx, edx
lea ecx, [ebp - 0x37c]
call fcn.0058d5b0
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.0041e828
mov byte [ebp - 4], 7
call fcn.00414eab
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x58a88b
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 0x58a8c9
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.00528e42
add esp, 8
test eax, eax
js 0x58a826
cmp eax, dword [esi - 8]
jg 0x58a826
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
lea ecx, [ebp - 0x368]
call fcn.0041f335
lea ecx, [ebp - 0x368]
mov dword [eax + 0x2c], esi
call fcn.0041f1bb
cmp eax, 1
je 0x58a9a3
mov ecx, dword [ebp - 0x380]
push 0x5e7af0
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 0x58a94e
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.0041eaf6
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 0x58a97a
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 0x58a998
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x380]
jmp 0x58aa9c
lea eax, [ebp - 0x388]
push eax
lea ecx, [ebp - 0x368]
call fcn.0041f33c
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 0x58a9e9
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea ecx, [ebp - 0x370]
call fcn.00589f40
mov edi, dword [ebp - 0x370]
push edi
call dword [sym.imp.SHELL32.dll_PathIsExe]
test eax, eax
jne 0x58aa1c
push eax
push 0x5e7af0
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 0x58aa3c
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.0041eaf6
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 0x58aa68
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 0x58aa9a
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.00527e2c
mov esp, ebp
pop ebp
ret