Function at 0x410820
Capabilities:
Check if file exists
Create directory
Get common file path
Read file on windows

Disassembly:
sub esp, 0x96c
push ebx
push ebp
mov ebx, ecx
push esi
push edi
xor edi, edi
cmp dword [ebx + 0x1a50], edi
jne 0x410848
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x96c
ret 4
cmp dword [ebx + 0x1a4c], edi
jne 0x410862
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x96c
ret 4
cmp dword [ebx + 0x1a48], edi
jne 0x41087c
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x96c
ret 4
cmp dword [ebx + 0x1a54], edi
jne 0x410896
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x96c
ret 4
mov eax, dword [ebx + 0x1a90]
mov ecx, dword [ebx + 0x1a94]
or eax, ecx
mov dword [esp + 0x10], edi
mov esi, 1
jne 0x410929
cmp dword [0x4256f0], esi
jne 0x4108df
lea ecx, [esp + 0x1c]
lea edx, [ebx + 0x1018]
push ecx
push edx
call sub.MSVCRT.dll__stati64
add esp, 8
test eax, eax
je 0x410904
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x96c
ret 4
lea eax, [esp + 0x1c]
lea ecx, [ebx + 0x18]
push eax
push ecx
call sub.MSVCRT.dll__wstati64
add esp, 8
test eax, eax
je 0x410904
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x96c
ret 4
mov eax, dword [esp + 0x40]
cdq
mov dword [ebx + 0x1a90], eax
mov eax, dword [esp + 0x38]
mov dword [ebx + 0x1a94], edx
mov edx, dword [esp + 0x34]
mov dword [ebx + 0x1a88], edx
mov dword [ebx + 0x1a8c], eax
cmp dword [ebx + 0x14], edi
jg 0x410947
jl 0x410935
cmp dword [ebx + 0x10], edi
jae 0x410947
mov ecx, dword [ebx + 0x1a88]
mov edx, dword [ebx + 0x1a8c]
mov dword [ebx + 0x10], ecx
mov dword [ebx + 0x14], edx
mov eax, dword [esp + 0x980]
cmp eax, edi
mov eax, dword [0x4256f0]
je 0x41099d
push edi
push 0x80
push 3
push edi
cmp eax, esi
push esi
push SysReAllocString
jne 0x410979
lea eax, [ebx + 0x1018]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
jmp 0x410983
lea ecx, [ebx + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x410a0e
or eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x96c
ret 4
push edi
push 0x80
push 3
push edi
cmp eax, esi
push esi
push 0xc0000000
jne 0x4109bf
lea edx, [ebx + 0x1018]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
jmp 0x4109c9
lea eax, [ebx + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x410a0e
mov eax, dword [0x4256f0]
push edi
push 0x80
push 3
push edi
cmp eax, esi
push esi
mov dword [esp + 0x24], esi
mov dword [esp + 0x994], esi
push SysReAllocString
jne 0x410a02
lea ecx, [ebx + 0x1018]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
jmp 0x410a0c
lea edx, [ebx + 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp dword [ebx + 0x181c], edi
jne 0x410a2e
push edi
push edi
push edi
push ebp
call fcn.00407150
push ebp
call fcn.00406bb0
add esp, 0x14
mov dword [ebx + 0x181c], eax
mov eax, dword [ebx + 0x181c]
xor esi, esi
cmp eax, 1
je 0x410a4e
cmp eax, 3
je 0x410a4e
cmp eax, 4
je 0x410a4e
cmp eax, 2
jne 0x410d46
cmp dword [esp + 0x980], edi
je 0x410dee
push edi
push edi
push 0xc64
push ebp
call fcn.00407150
add esp, 0x10
lea eax, [esp + 0x14]
lea ecx, [esp + 0x18]
mov dword [esp + 0x14], edi
push edi
push eax
push 4
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edx, dword [ebx + 0x1a88]
mov ecx, dword [ebx + 0x1a90]
mov eax, dword [ebx + 0x1a8c]
mov dword [esp + 0x75c], edx
mov edx, dword [ebx + 0x1a94]
mov dword [esp + 0x764], ecx
mov dword [esp + 0x768], edx
lea ecx, [ebx + 0x18]
mov dword [esp + 0x760], eax
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x554]
push ecx
push edx
mov dword [esp + 0x97c], eax
call sub.MSVCRT.dll_wcscpy
mov eax, dword [0x4256f0]
add esp, 8
cmp eax, 1
push 1
push 0x1a
jne 0x410bf3
lea eax, [esp + 0x54]
push eax
push edi
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
mov edi, 0x423d7c
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x4c]
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 + 0x4c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x410b3d
lea ecx, [esp + 0x4c]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov edi, 0x423d74
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x4c]
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 + 0x4c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x410b86
lea ecx, [esp + 0x4c]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
lea edx, [esp + 0x454]
lea eax, [esp + 0x4c]
push edx
push 0
push 0x423d70
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
lea ecx, [esp + 0x76c]
push 0x104
push ecx
lea edi, [esp + 0x45c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
lea edx, [esp + 0x45c]
push ecx
push edx
push eax
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push 0
push 0x80
push 2
push 0
push 1
lea eax, [esp + 0x468]
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
jmp 0x410cba
lea ecx, [esp + 0x254]
push ecx
push edi
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea edx, [esp + 0x24c]
push 0x423d58
push edx
call sub.MSVCRT.dll_wcscat
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
add esp, 8
lea eax, [esp + 0x24c]
push eax
call esi
mov edi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x410c3d
lea ecx, [esp + 0x24c]
push 0
push ecx
call edi
lea edx, [esp + 0x24c]
push 0x423d48
push edx
call sub.MSVCRT.dll_wcscat
add esp, 8
lea eax, [esp + 0x24c]
push eax
call esi
test eax, eax
jne 0x410c6b
lea ecx, [esp + 0x24c]
push eax
push ecx
call edi
lea edx, [esp + 0x4c]
lea eax, [esp + 0x24c]
push edx
push 0
push 0x423d40
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea ecx, [esp + 0x4c]
lea edx, [esp + 0x76c]
push ecx
push edx
call sub.MSVCRT.dll_wcscpy
add esp, 8
lea eax, [esp + 0x76c]
push 0
push 0x80
push 2
push 0
push 1
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x410cd7
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x96c
ret 4
push esi
mov ecx, ebx
call fcn.0040d8e0
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, eax
call esi
test edi, edi
jne 0x410d01
push ebp
call esi
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x96c
ret 4
sub esp, 0x428
mov ecx, 0x10a
lea esi, [esp + 0x97c]
mov edi, esp
rep movsd dword es:[edi], dword [esi]
push 0x423cf0
mov ecx, ebx
call fcn.0040f230
mov esi, eax
mov eax, dword [ebx + 0x1a78]
test eax, eax
je 0x410d44
mov ecx, dword [ebx + 0x1a7c]
push esi
push ecx
push 0x423ed8
call fcn.0040b080
add esp, 0xc
xor edi, edi
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp esi, edi
je 0x4108cf
mov esi, dword [ebx + 0x1a50]
cmp esi, edi
je 0x410d6f
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], edi
cmp esi, edi
je 0x410d8f
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], edi
cmp esi, edi
je 0x410daf
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], edi
cmp esi, edi
je 0x410dcf
mov ecx, esi
call fcn.004071e0
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov edx, dword [esp + 0x10]
xor eax, eax
mov dword [ebx + 0x1a54], edi
cmp edx, edi
pop edi
pop esi
setne al
pop ebp
inc eax
pop ebx
add esp, 0x96c
ret 4
mov edx, dword [ebx + 0x1a8c]
mov eax, dword [ebx + 0x1a88]
mov ecx, dword [ebx + 0x1a94]
push edx
mov edx, dword [ebx + 0x1a90]
push eax
mov eax, dword [ebx + 0x14]
push ecx
mov ecx, dword [ebx + 0x10]
push edx
push eax
push ecx
push ebp
mov ecx, ebx
call fcn.0040ea50
mov esi, eax
mov eax, dword [ebx + 0x1a78]
cmp eax, edi
je 0x410d46
mov edx, dword [ebx + 0x1a7c]
push esi
push edx
push 0x423ebc
call fcn.0040b080
add esp, 0xc
jmp 0x410d46