Function at 0x40f581
Capabilities:
Check if file exists
Copy file
Create directory
Get common file path

Disassembly:
push ebp
lea ebp, [esp - 0xa0c]
sub esp, 0xa8c
mov eax, dword [0x42ea70]
xor eax, ebp
mov dword [ebp + 0xa08], eax
mov eax, dword [ebp + 0xa14]
push ebx
mov ebx, dword [ebp + 0xa1c]
push esi
mov esi, dword [ebp + 0xa20]
push edi
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp + 0xa18]
push eax
mov dword [ebp - 0x28], eax
call edi
test eax, eax
jne 0x40f5d1
xor eax, eax
jmp 0x40f7c3
push 0x424538
push esi
call dword [sym.imp.SHLWAPI.dll_StrCmpW]
test eax, eax
jne 0x40f5ed
push dword [ebp - 0x28]
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
push eax
jmp 0x40f5ee
push esi
mov esi, dword [sym.imp.SHLWAPI.dll_StrCpyW]
lea eax, [ebp + 0x3f0]
push eax
call esi
push 0x424538
push ebx
call dword [sym.imp.SHLWAPI.dll_StrCmpW]
test eax, eax
jne 0x40f6a9
push 0x58
pop esi
push esi
xor edi, edi
lea eax, [ebp - 0x80]
push edi
push eax
call fcn.004140e0
lea eax, [ebp + 0x3f0]
mov dword [ebp - 0x64], eax
mov eax, dword [ebp - 0x24]
add esp, 0xc
mov dword [ebp - 0x7c], eax
lea eax, [ebp + 0x5f8]
push eax
push edi
push edi
push 0x10
push edi
mov dword [ebp - 0x80], esi
mov dword [ebp - 0x60], 0x208
mov dword [ebp - 0x74], 0x4247ec
mov dword [ebp - 0x68], 1
mov dword [ebp - 0x5c], edi
mov dword [ebp - 0x58], edi
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
jl 0x40f670
lea eax, [ebp + 0x5f8]
mov dword [ebp - 0x54], eax
lea eax, [ebp - 0x80]
push eax
mov dword [ebp - 0x4c], 0x1802
call dword [sym.imp.COMDLG32.dll_GetSaveFileNameW]
test eax, eax
je 0x40f5ca
lea eax, [ebp + 0x3f0]
push eax
lea eax, [ebp + 0x1e8]
push eax
lea eax, [ebp + 0x800]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
jmp 0x40f7ab
push ebx
lea eax, [ebp + 0x1e8]
push eax
call esi
push ebx
call edi
test eax, eax
jne 0x40f6e3
push eax
push ebx
push eax
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
test eax, eax
je 0x40f6e3
lea eax, [ebp + 0x1e8]
push eax
xor eax, eax
push eax
push eax
push 0x10
push eax
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
jl 0x40f5ca
lea eax, [ebp + 0x3f0]
push eax
lea eax, [ebp + 0x1e8]
push eax
lea eax, [ebp + 0x800]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
lea eax, [ebp + 0x800]
push eax
call edi
test eax, eax
je 0x40f7ab
lea eax, [ebp + 0x800]
push eax
lea eax, [ebp + 0x5f8]
push eax
mov dword [ebp - 0x24], 1
call esi
lea eax, [ebp + 0x5f8]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindExtensionW]
mov ebx, eax
lea eax, [ebp - 0x20]
test ebx, ebx
je 0x40f747
push ebx
push eax
call esi
xor eax, eax
mov word [ebx], ax
jmp 0x40f74f
push 0x424538
push eax
call esi
cmp dword [ebp + 0xa24], 0
je 0x40f779
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp + 0x5f8]
push eax
lea eax, [ebp + 0x800]
push str._s_s
push eax
call fcn.0040b236
add esp, 0x10
jmp 0x40f7ab
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x24]
lea eax, [ebp + 0x5f8]
push eax
lea eax, [ebp + 0x800]
push 0x4247cc
push eax
call fcn.0040b236
add esp, 0x14
inc dword [ebp - 0x24]
lea eax, [ebp + 0x800]
push eax
call edi
test eax, eax
jne 0x40f779
push 0
lea eax, [ebp + 0x800]
push eax
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CopyFileW]
neg eax
sbb eax, eax
neg eax
mov ecx, dword [ebp + 0xa08]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004144c5
add ebp, 0xa0c
leave
ret 0x14