Function at 0x579c90
Capabilities:
Check if file exists
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5f5ab8
mov eax, dword fs:[0]
push eax
sub esp, 0x638
mov eax, dword [0x6670f4]
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 ebx, dword [ebp + 8]
xor edi, edi
mov dword [ebp - 0x644], ebx
mov eax, dword [ebx]
cmp dword [eax - 0xc], edi
je 0x57a2ca
call fcn.004b4040
mov ecx, eax
test ecx, ecx
je 0x57a2e8
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x638], eax
mov dword [ebp - 4], edi
call fcn.004b4040
mov ecx, eax
test ecx, ecx
je 0x57a2f2
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x63c], esi
mov byte [ebp - 4], 1
cmp dword [esi - 0xc], edi
jne 0x579d6a
mov eax, dword [ebx]
cmp dword [eax - 0xc], edi
jl 0x579d6a
push 0x604a70
push eax
call fcn.0058d0d6
add esp, 8
test eax, eax
je 0x579d6a
sub eax, dword [ebx]
sar eax, 1
cmp eax, 1
jne 0x579d6a
push ebx
lea ecx, [ebp - 0x63c]
call fcn.004bfcd0
mov esi, dword [ebp - 0x63c]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x579d6a
lea ecx, [ebp - 0x63c]
call fcn.004bd3a0
mov esi, dword [ebp - 0x63c]
or ebx, 0xffffffff
cmp dword [esi - 0xc], 0
jne 0x579f53
cmp dword [ebp + 0xc], 0
jne 0x579f4f
push 0x20c
lea eax, [ebp - 0x21c]
push 0
push eax
call fcn.0058c8f0
add esp, 0xc
lea eax, [ebp - 0x21c]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [ebp - 0x21c]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x579db4
sub ecx, edx
lea eax, [ebp - 0x21c]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x638]
call fcn.004c0470
mov edi, dword [ebp - 0x638]
push 0x5c
push edi
call fcn.0058cb87
add esp, 8
test eax, eax
je 0x579ec8
sub eax, edi
sar eax, 1
cmp eax, 0xffffffff
je 0x579ec8
xor ebx, ebx
add eax, 1
cmovns ebx, eax
cmp ebx, dword [edi - 0xc]
jl 0x579e20
add edi, 0xfffffff0
push edi
call fcn.004bfdc0
add esp, 4
lea edi, [eax + 0x10]
mov dword [ebp - 0x640], edi
jmp 0x579e94
mov eax, dword [ebp - 0x638]
mov ecx, dword [eax - 0x10]
test ecx, ecx
je 0x579e38
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, eax
test ecx, ecx
jne 0x579e4e
call fcn.004b4040
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
mov ecx, eax
test ecx, ecx
je 0x57a2fc
mov eax, dword [ecx]
push 2
push ebx
call dword [eax]
test eax, eax
je 0x57a306
lea edi, [eax + 0x10]
mov dword [ebp - 0x640], edi
test ebx, ebx
js 0x57a315
cmp ebx, dword [edi - 8]
jg 0x57a315
lea eax, [ebx + ebx]
mov dword [edi - 0xc], ebx
push eax
push dword [ebp - 0x638]
xor ecx, ecx
push eax
push edi
mov word [eax + edi], cx
call fcn.0057a740
add esp, 0x10
lea eax, [ebp - 0x640]
mov byte [ebp - 4], 2
push eax
lea ecx, [ebp - 0x638]
call fcn.004bfcd0
or ebx, 0xffffffff
mov byte [ebp - 4], 1
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x579ec8
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x638]
cmp dword [eax - 0xc], 0
je 0x579f4f
lea eax, [ebp - 0x638]
push eax
call fcn.00578cf0
push dword [ebp - 0x644]
lea eax, [ebp - 0x638]
push eax
lea eax, [ebp - 0x640]
push eax
call fcn.004bc8d0
add esp, 0x10
push eax
lea ecx, [ebp - 0x63c]
mov byte [ebp - 4], 3
call fcn.004bfcd0
mov edx, dword [ebp - 0x640]
mov eax, ebx
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x579f2d
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x63c]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x579f4f
lea ecx, [ebp - 0x63c]
call fcn.004bd3a0
mov esi, dword [ebp - 0x63c]
cmp dword [esi - 0xc], 0
mov edi, dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
jne 0x57a0d9
lea ecx, [ebp - 0x638]
call fcn.004bd3a0
mov eax, dword [0x66c20c]
test al, 1
jne 0x579fa4
or eax, 1
mov dword [0x66c20c], eax
call fcn.004b4040
mov ecx, eax
test ecx, ecx
je 0x57a30b
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
push 0x5fdab0
mov dword [0x66c208], eax
call fcn.0050f1be
add esp, 4
mov eax, dword [0x66c208]
cmp dword [eax - 0xc], 0
jne 0x57a006
push 0x20c
lea eax, [ebp - 0x428]
push 0
push eax
call fcn.0058c8f0
add esp, 0xc
lea eax, [ebp - 0x428]
push 1
push 0x25
push eax
push 0
call edi
lea ecx, [ebp - 0x428]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x579fe0
sub ecx, edx
lea eax, [ebp - 0x428]
sar ecx, 1
push ecx
push eax
mov ecx, 0x66c208
call fcn.004c0470
mov eax, dword [0x66c208]
add eax, 0xfffffff0
push eax
call fcn.004bfdc0
add esp, 4
lea edi, [eax + 0x10]
mov dword [ebp - 0x640], edi
lea eax, [ebp - 0x640]
mov byte [ebp - 4], 4
push eax
lea ecx, [ebp - 0x638]
call fcn.004bfcd0
mov byte [ebp - 4], 1
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x57a04c
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x638]
cmp dword [eax - 0xc], 0
je 0x57a0d3
lea eax, [ebp - 0x638]
push eax
call fcn.00578cf0
push dword [ebp - 0x644]
lea eax, [ebp - 0x638]
push eax
lea eax, [ebp - 0x640]
push eax
call fcn.004bc8d0
add esp, 0x10
push eax
lea ecx, [ebp - 0x63c]
mov byte [ebp - 4], 5
call fcn.004bfcd0
mov edx, dword [ebp - 0x640]
mov eax, ebx
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x57a0b1
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x63c]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x57a0d3
lea ecx, [ebp - 0x63c]
call fcn.004bd3a0
mov esi, dword [ebp - 0x63c]
mov edi, dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
cmp dword [esi - 0xc], 0
jne 0x57a25c
lea ecx, [ebp - 0x638]
call fcn.004bd3a0
mov eax, dword [0x66c214]
test al, 1
jne 0x57a128
or eax, 1
mov dword [0x66c214], eax
call fcn.004b4040
mov ecx, eax
test ecx, ecx
je 0x57a31f
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
push 0x5fdad0
mov dword [0x66c210], eax
call fcn.0050f1be
add esp, 4
mov eax, dword [0x66c210]
cmp dword [eax - 0xc], 0
jne 0x57a187
push 0x20c
lea eax, [ebp - 0x634]
push 0
push eax
call fcn.0058c8f0
add esp, 0xc
lea eax, [ebp - 0x634]
push 1
push 0x25
push eax
push 0
call edi
lea ecx, [ebp - 0x634]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x57a161
sub ecx, edx
lea eax, [ebp - 0x634]
sar ecx, 1
push ecx
push eax
mov ecx, 0x66c210
call fcn.004c0470
mov eax, dword [0x66c210]
add eax, 0xfffffff0
push eax
call fcn.004bfdc0
add esp, 4
lea edi, [eax + 0x10]
mov dword [ebp - 0x640], edi
lea eax, [ebp - 0x640]
mov byte [ebp - 4], 6
push eax
lea ecx, [ebp - 0x638]
call fcn.004bfcd0
mov byte [ebp - 4], 1
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x57a1cd
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x638]
cmp dword [eax - 0xc], 0
je 0x57a25c
lea eax, [ebp - 0x638]
push eax
call fcn.00578cf0
push dword [ebp - 0x644]
lea eax, [ebp - 0x638]
push eax
lea eax, [ebp - 0x640]
push eax
call fcn.004bc8d0
add esp, 0x10
push eax
lea ecx, [ebp - 0x63c]
mov byte [ebp - 4], 7
call fcn.004bfcd0
mov edx, dword [ebp - 0x640]
mov eax, ebx
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x57a236
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x63c]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
push esi
call edi
test eax, eax
jne 0x57a262
lea ecx, [ebp - 0x63c]
call fcn.004bd3a0
mov esi, dword [ebp - 0x63c]
jmp 0x57a262
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmp dword [esi - 0xc], 0
mov ebx, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
je 0x57a27e
push esi
call edi
test eax, eax
je 0x57a27e
push esi
call ebx
mov edi, eax
test edi, edi
jne 0x57a28a
mov eax, dword [ebp - 0x644]
push dword [eax]
call ebx
mov edi, eax
or ebx, 0xffffffff
mov byte [ebp - 4], 0
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x57a2a8
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x638]
mov dword [ebp - 4], 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x57a2ca
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, edi
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.0050ed5c
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.004b3510
push 0x80004005
call fcn.004b3510
push 0x80004005
call fcn.004b3510
call fcn.004b5400
push 0x80004005
call fcn.004b3510
push 0x80070057
call fcn.004b3510
push 0x80004005
call fcn.004b3510
int3