Function at 0x40f880
Capabilities:
Check if file exists
Create directory
Delete file
Get common file path

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x41e716
push eax
mov eax, 0x60a8
mov dword fs:[0], esp
call fcn.0041ae80
push ebx
push ebp
mov ebx, ecx
push esi
push edi
xor edi, edi
cmp dword [ebx + 0x1a50], edi
je 0x4103b1
cmp dword [ebx + 0x1a4c], edi
je 0x4103b1
cmp dword [ebx + 0x1a48], edi
je 0x4103b1
cmp dword [ebx + 0x1a54], edi
je 0x4103b1
cmp dword [esp + 0x60c8], edi
jne 0x41004a
mov eax, dword [0x4256f0]
mov ebp, 1
cmp eax, ebp
jne 0x40f912
lea eax, [esp + 0x58]
lea ecx, [ebx + 0x1018]
push eax
push ecx
call sub.MSVCRT.dll__stati64
add esp, 8
test eax, eax
je 0x40f92f
or eax, 0xffffffff
jmp 0x4103b6
lea edx, [esp + 0x58]
lea eax, [ebx + 0x18]
push edx
push eax
call sub.MSVCRT.dll__wstati64
add esp, 8
test eax, eax
je 0x40f92f
or eax, 0xffffffff
jmp 0x4103b6
mov edx, dword [esp + 0x74]
mov eax, dword [esp + 0x7c]
mov ecx, dword [esp + 0x70]
mov dword [esp + 0xa9c], edx
cdq
mov dword [esp + 0xaa0], eax
lea esi, [ebx + 0x18]
lea eax, [esp + 0x890]
push esi
push eax
mov dword [esp + 0xaa0], ecx
mov dword [esp + 0xaac], edx
mov word [esp + 0xab0], di
call sub.MSVCRT.dll_wcscpy
lea ecx, [esp + 0x20c0]
push 0x423e20
push ecx
call sub.MSVCRT.dll_wcscpy
lea edx, [esp + 0x20c8]
lea eax, [esp + 0x10c8]
push edx
push eax
call sub.MSVCRT.dll_wcscpy
lea ecx, [esp + 0x40d0]
push esi
push ecx
call sub.MSVCRT.dll_wcscpy
add esp, 0x20
lea edx, [esp + 0x40b8]
mov ecx, ebx
push edx
call fcn.0040f6e0
lea eax, [esp + 0x40b8]
lea ecx, [esp + 0x20b8]
push eax
push ecx
call sub.MSVCRT.dll_wcscat
mov ecx, dword [0x4256f0]
add esp, 8
xor edx, edx
cmp ecx, ebp
sete dl
push edx
lea ecx, [esp + 0x20]
mov dword [esp + 0x40], ebp
mov dword [esp + 0x14], edi
call fcn.00401f60
lea eax, [esp + 0x10b8]
lea ecx, [esp + 0x1c]
push eax
push SysReAllocString
mov dword [esp + 0x60c8], edi
call fcn.00401fb0
test eax, eax
jne 0x40fa34
lea ecx, [esp + 0x10b8]
push edi
push ecx
push SysReAllocString
lea ecx, [esp + 0x28]
call fcn.004023f0
cmp eax, ebp
jne 0x40fc18
jmp 0x40fc0f
lea edx, [esp + 0x38]
push edi
push edx
push 0x423db8
lea ecx, [esp + 0x28]
mov dword [esp + 0x44], edi
call fcn.00402170
test eax, eax
je 0x40fa61
mov eax, dword [esp + 0x38]
cmp eax, 0x3e8
sbb ecx, ecx
and ecx, eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x30], edi
mov edx, dword [esp + 0x30]
lea eax, [esp + 0x40]
lea ecx, [esp + 0x50b8]
push eax
push ecx
push edx
lea ecx, [esp + 0x28]
mov dword [esp + 0x4c], 0x800
call fcn.004020b0
test eax, eax
je 0x40fc0f
lea eax, [esp + 0x10b8]
lea ecx, [esp + 0x30b8]
push eax
push ecx
call sub.MSVCRT.dll_wcscpy
lea edx, [esp + 0x50c0]
lea eax, [esp + 0x30c0]
push edx
push eax
call sub.MSVCRT.dll_wcscat
mov edx, dword [0x4256f0]
add esp, 0x10
xor ecx, ecx
cmp edx, ebp
sete cl
push ecx
lea ecx, [esp + 0x48]
call fcn.00401f60
lea edx, [esp + 0x30b8]
lea ecx, [esp + 0x44]
push edx
push SysReAllocString
mov byte [esp + 0x60c8], 1
call fcn.00401fb0
test eax, eax
je 0x40fbfe
lea eax, [esp + 0x34]
push edi
push eax
push 0x423db0
lea ecx, [esp + 0x50]
xor esi, esi
mov dword [esp + 0x40], edi
call fcn.00402170
cmp eax, ebp
jne 0x40fbbc
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x34]
cmp eax, ecx
jne 0x40fbbc
lea edx, [esp + 0x14]
lea ecx, [esp + 0x44]
push edx
push 0x423e10
mov dword [esp + 0x1c], 0x420
call fcn.00402230
mov esi, eax
cmp esi, edi
je 0x40fbba
cmp dword [0x4256f0], ebp
jne 0x40fb97
push edi
push edi
lea eax, [esp + 0x90]
push 0x104
push eax
lea ecx, [esi + 0x218]
push 0xffffffffffffffff
push ecx
push edi
push edi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
lea edx, [esp + 0x88]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x40fbb1
lea eax, [esp + 0x88]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x40fbb1
lea edi, [esi + 0x218]
push edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40fbaf
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
xor edi, edi
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov esi, ebp
lea ecx, [esp + 0x44]
call fcn.00402080
cmp esi, edi
jne 0x40fbe8
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x44]
inc eax
mov byte [esp + 0x60c0], 0
mov dword [esp + 0x30], eax
call fcn.00401fa0
jmp 0x40fa65
lea ecx, [esp + 0x30b8]
push ecx
push SysReAllocString
lea ecx, [esp + 0x4c]
call fcn.004024e0
lea ecx, [esp + 0x44]
mov byte [esp + 0x60c0], 0
call fcn.00401fa0
lea ecx, [esp + 0x1c]
call fcn.00402080
lea edx, [esp + 0x20b8]
lea ecx, [esp + 0x1c]
push edx
push SysReAllocString
call fcn.00401fb0
cmp eax, ebp
jne 0x40fce3
lea eax, [esp + 0x14]
lea ecx, [esp + 0x1c]
push eax
push 0x423e10
call fcn.00402230
mov esi, eax
cmp esi, edi
je 0x40fcda
cmp dword [esp + 0x14], 0x420
jne 0x40fcd1
lea ecx, [esp + 0x890]
push esi
push ecx
call sub.MSVCRT.dll__wcsicmp
add esp, 8
test eax, eax
jne 0x40fcd1
mov edx, dword [esi + 0x208]
mov eax, dword [esp + 0xa98]
cmp edx, eax
jne 0x40fcd1
mov eax, dword [esi + 0x20c]
mov ecx, dword [esp + 0xa9c]
cmp eax, ecx
jne 0x40fcd1
mov ecx, dword [esi + 0x210]
mov eax, dword [esp + 0xaa0]
cmp ecx, eax
jne 0x40fcd1
mov edx, dword [esi + 0x214]
mov eax, dword [esp + 0xaa4]
cmp edx, eax
jne 0x40fcd1
lea eax, [esi + 0x218]
lea ecx, [esp + 0xaa8]
push eax
push ecx
call sub.MSVCRT.dll_wcscpy
add esp, 8
mov dword [esp + 0x3c], edi
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
lea ecx, [esp + 0x1c]
call fcn.00402080
lea edx, [esp + 0xaa8]
push edx
call sub.MSVCRT.dll_wcslen
add esp, 4
test eax, eax
ja 0x40febe
mov eax, dword [0x4256f0]
push 1
cmp eax, 1
push 0x1a
jne 0x40fe10
lea eax, [esp + 0x598]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
mov edi, 0x423d7c
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x590]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea eax, [esp + 0x590]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
mov ebp, dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x40fd72
lea ecx, [esp + 0x590]
push 0
push ecx
call ebp
mov edi, 0x423d74
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x590]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x590]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x40fdc0
lea ecx, [esp + 0x590]
push eax
push ecx
call ebp
lea edx, [esp + 0x290]
lea eax, [esp + 0x590]
push edx
push 0
push 0x423e0c
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
lea ecx, [esp + 0xaa8]
push 0x104
push ecx
lea edi, [esp + 0x298]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
lea edx, [esp + 0x298]
push ecx
push edx
push eax
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
jmp 0x40febe
lea eax, [esp + 0x90]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea ecx, [esp + 0x88]
push 0x423d58
push ecx
call sub.MSVCRT.dll_wcscat
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
add esp, 8
lea edx, [esp + 0x88]
push edx
call edi
mov esi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x40fe5b
lea eax, [esp + 0x88]
push 0
push eax
call esi
lea ecx, [esp + 0x88]
push 0x423d48
push ecx
call sub.MSVCRT.dll_wcscat
add esp, 8
lea edx, [esp + 0x88]
push edx
call edi
test eax, eax
jne 0x40fe89
push eax
lea eax, [esp + 0x8c]
push eax
call esi
lea ecx, [esp + 0x390]
lea edx, [esp + 0x88]
push ecx
push 0
push 0x423e04
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea eax, [esp + 0x390]
lea ecx, [esp + 0xaa8]
push eax
push ecx
call sub.MSVCRT.dll_wcscpy
add esp, 8
cmp dword [0x4256f0], 1
jne 0x40ff0c
xor ebp, ebp
lea edx, [esp + 0x390]
push ebp
push ebp
push 0x104
push edx
lea eax, [esp + 0xab8]
push 0xffffffffffffffff
push eax
push ebp
push ebp
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push ebp
push 0x80
push 2
push ebp
push 1
lea ecx, [esp + 0x3a4]
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
jmp 0x40ff30
push 0
push 0x80
push 2
push 0
push 1
lea edx, [esp + 0xabc]
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
xor ebp, ebp
cmp esi, 0xffffffff
jne 0x40ff4c
lea ecx, [esp + 0x1c]
mov dword [esp + 0x60c0], esi
call fcn.00401fa0
or eax, esi
jmp 0x4103b6
push esi
mov ecx, ebx
call fcn.0040d8e0
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp edi, ebp
je 0x40fff3
lea eax, [esp + 0x20b8]
lea ecx, [esp + 0x1c]
push eax
push SysReAllocString
call fcn.00401fb0
test eax, eax
jne 0x40ffa3
lea ecx, [esp + 0x20b8]
push ebp
push ecx
push SysReAllocString
lea ecx, [esp + 0x28]
call fcn.004023f0
test eax, eax
je 0x40ffa3
lea ecx, [esp + 0x1c]
call fcn.00402080
lea edx, [esp + 0x20b8]
lea ecx, [esp + 0x1c]
push edx
push SysReAllocString
call fcn.00401fb0
push 0x420
lea eax, [esp + 0x894]
push 3
push eax
push 0x423e10
lea ecx, [esp + 0x2c]
call fcn.00402330
mov ecx, dword [esp + 0x10]
push ebp
push ecx
push 0x423db0
lea ecx, [esp + 0x28]
call fcn.004022f0
lea ecx, [esp + 0x1c]
call fcn.00402080
cmp dword [esp + 0x3c], ebp
je 0x410031
lea edx, [esp + 0x10b8]
lea ecx, [esp + 0x1c]
push edx
push SysReAllocString
call fcn.00401fb0
test eax, eax
je 0x410031
mov eax, dword [esp + 0x10]
push ebp
inc eax
lea ecx, [esp + 0x20]
push eax
push 0x423db8
call fcn.004022f0
lea ecx, [esp + 0x1c]
call fcn.00402080
lea ecx, [esp + 0x1c]
mov dword [esp + 0x60c0], 0xffffffff
call fcn.00401fa0
jmp 0x410329
cmp dword [0x4256f0], 1
jne 0x4101e9
lea ecx, [esp + 0x590]
lea edx, [esp + 0xeb8]
push ecx
lea eax, [esp + 0x294]
push edx
lea ecx, [esp + 0x18]
push eax
lea edx, [ebx + 0x1018]
push ecx
push edx
call sub.MSVCRT.dll__splitpath
lea edi, [esp + 0x2a4]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x14
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edx, ecx
sub edx, 2
js 0x4100b4
cmp byte [esp + edx + 0x290], 0x5c
je 0x4100af
dec edx
jns 0x41009b
xor eax, eax
jmp 0x4103b6
cmp edx, 0xffffffff
jne 0x4100bb
xor eax, eax
jmp 0x4103b6
lea edi, [esp + 0x290]
or ecx, 0xffffffff
xor eax, eax
lea ebp, [esp + 0x790]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov edi, 0x423dfc
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
mov byte [esp + edx + 0x795], 0
sub edi, ecx
lea edx, [esp + 0x794]
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
push eax
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea eax, [esp + 0x798]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x39c]
push ecx
push edx
call sub.MSVCRT.dll__makepath
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
add esp, 0x14
lea eax, [esp + 0x390]
push eax
call esi
test eax, eax
jne 0x410161
lea ecx, [esp + 0x390]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
lea edi, [esp + 0x88]
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebx + 0x1824]
repne scasb al, byte es:[edi]
push 0x104
push edx
not ecx
lea eax, [esp + 0x90]
push ecx
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea ecx, [esp + 0xeb8]
push 0x423df8
lea edx, [esp + 0x794]
push ecx
lea eax, [esp + 0x18]
push edx
lea ecx, [esp + 0x94]
push eax
push ecx
call sub.MSVCRT.dll__makepath
add esp, 0x14
lea edx, [esp + 0x88]
push edx
call esi
push 0
push 0x80
push 2
push 0
push 1
lea eax, [esp + 0x9c]
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
jmp 0x410308
lea ecx, [esp + 0xeb8]
lea edx, [esp + 0x590]
push ecx
lea eax, [esp + 0x8c]
push edx
lea ecx, [esp + 0x1c]
push eax
lea edx, [ebx + 0x18]
push ecx
push edx
call sub.MSVCRT.dll__wsplitpath
lea eax, [esp + 0x9c]
push eax
call sub.MSVCRT.dll_wcslen
mov esi, eax
add esp, 0x18
sub esi, 2
js 0x410247
lea eax, [esp + esi*2 + 0x88]
cmp word [eax], 0x5c
je 0x410242
dec esi
sub eax, 2
cmp esi, edi
jge 0x41022d
xor eax, eax
jmp 0x4103b6
cmp esi, 0xffffffff
jne 0x41024e
xor eax, eax
jmp 0x4103b6
lea ecx, [esp + 0x88]
lea edx, [esp + 0x390]
push ecx
push edx
call sub.MSVCRT.dll_wcscpy
lea eax, [esp + 0x398]
push 0x423de8
push eax
mov word [esp + esi*2 + 0x3a2], 0
call sub.MSVCRT.dll_wcscat
push 0
lea ecx, [esp + 0x3a4]
push 0
lea edx, [esp + 0x2c]
push ecx
lea eax, [esp + 0xccc]
push edx
push eax
call sub.MSVCRT.dll__wmakepath
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
add esp, 0x24
lea ecx, [esp + 0xcb0]
push ecx
call edi
test eax, eax
jne 0x4102c3
lea edx, [esp + 0xcb0]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea eax, [esp + 0x590]
push 0x423de0
lea ecx, [esp + 0x394]
push eax
lea edx, [esp + 0x1c]
lea esi, [ebx + 0x1824]
push ecx
push edx
push esi
call sub.MSVCRT.dll__wmakepath
add esp, 0x14
push esi
call edi
push 0
push 0x80
push 2
push 0
push 1
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x410316
or eax, eax
jmp 0x4103b6
push esi
mov ecx, ebx
call fcn.0040d8e0
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ebp, ebp
cmp edi, ebp
je 0x4103b1
mov esi, dword [ebx + 0x1a50]
cmp esi, ebp
je 0x41034b
mov ecx, esi
call fcn.004071e0
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov esi, dword [ebx + 0x1a4c]
mov dword [ebx + 0x1a50], ebp
cmp esi, ebp
je 0x41036b
mov ecx, esi
call fcn.004071e0
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov esi, dword [ebx + 0x1a48]
mov dword [ebx + 0x1a4c], ebp
cmp esi, ebp
je 0x41038b
mov ecx, esi
call fcn.004071e0
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov esi, dword [ebx + 0x1a54]
mov dword [ebx + 0x1a48], ebp
cmp esi, ebp
je 0x4103ab
mov ecx, esi
call fcn.004071e0
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov dword [ebx + 0x1a54], ebp
mov eax, 1
mov ecx, dword [esp + 0x60b8]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x60b4
ret 4