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

Disassembly:
sub esp, 0x968
push ebx
mov ebx, ecx
push ebp
xor ebp, ebp
mov eax, dword [ebx + 0x1a50]
push esi
cmp eax, ebp
push edi
je 0x410802
cmp dword [ebx + 0x1a4c], ebp
je 0x410802
cmp dword [ebx + 0x1a48], ebp
je 0x410802
cmp dword [ebx + 0x1a54], ebp
je 0x410802
mov eax, dword [0x4256f0]
mov edi, 1
cmp eax, edi
jne 0x410454
lea eax, [esp + 0x18]
lea ecx, [ebx + 0x1018]
push eax
push ecx
call sub.MSVCRT.dll__stati64
add esp, 8
test eax, eax
je 0x410477
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x968
ret
lea edx, [esp + 0x18]
lea eax, [ebx + 0x18]
push edx
push eax
call sub.MSVCRT.dll__wstati64
add esp, 8
test eax, eax
je 0x410477
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x968
ret
mov eax, dword [0x4256f0]
push ebp
push 0x80
push 3
push ebp
cmp eax, edi
push edi
push SysReAllocString
jne 0x41049e
lea ecx, [ebx + 0x1018]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
jmp 0x4104a8
lea edx, [ebx + 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4104bc
or eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x968
ret
push ebp
push ebp
push 0xc64
push esi
call fcn.00407150
add esp, 0x10
lea eax, [esp + 0x10]
lea ecx, [esp + 0x14]
mov dword [esp + 0x10], ebp
push ebp
push eax
push 4
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x34]
mov edx, dword [esp + 0x30]
mov dword [esp + 0x75c], eax
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x758], edx
cdq
mov dword [esp + 0x764], edx
mov dword [esp + 0x760], eax
lea edx, [ebx + 0x18]
lea eax, [esp + 0x550]
push edx
push eax
mov dword [esp + 0x978], ecx
call sub.MSVCRT.dll_wcscpy
mov eax, dword [0x4256f0]
add esp, 8
cmp eax, edi
push edi
push 0x1a
jne 0x41062e
lea ecx, [esp + 0x50]
push ecx
push ebp
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
mov edi, 0x423d7c
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x48]
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
mov ebp, dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
and ecx, 3
lea eax, [esp + 0x48]
rep movsb byte es:[edi], byte [esi]
push eax
call ebp
test eax, eax
jne 0x41059a
lea ecx, [esp + 0x48]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov edi, 0x423d74
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x48]
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 + 0x48]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call ebp
test eax, eax
jne 0x4105df
lea ecx, [esp + 0x48]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
lea edx, [esp + 0x450]
lea eax, [esp + 0x48]
push edx
push 0
push 0x423d70
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
lea ecx, [esp + 0x768]
push 0x104
push ecx
lea edi, [esp + 0x458]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
lea edx, [esp + 0x458]
push ecx
push edx
push eax
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
xor ebp, ebp
jmp 0x4106d3
lea eax, [esp + 0x250]
push eax
push ebp
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea ecx, [esp + 0x248]
push 0x423d58
push ecx
call sub.MSVCRT.dll_wcscat
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
add esp, 8
lea edx, [esp + 0x248]
push edx
call esi
mov edi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x410677
lea eax, [esp + 0x248]
push ebp
push eax
call edi
lea ecx, [esp + 0x248]
push 0x423d48
push ecx
call sub.MSVCRT.dll_wcscat
add esp, 8
lea edx, [esp + 0x248]
push edx
call esi
test eax, eax
jne 0x4106a5
lea eax, [esp + 0x248]
push ebp
push eax
call edi
lea ecx, [esp + 0x48]
lea edx, [esp + 0x248]
push ecx
push ebp
push 0x423d40
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea eax, [esp + 0x48]
lea ecx, [esp + 0x768]
push eax
push ecx
call sub.MSVCRT.dll_wcscpy
add esp, 8
mov eax, dword [0x4256f0]
push ebp
cmp eax, 1
jne 0x410718
push ebp
lea edx, [esp + 0x50]
push 0x104
push edx
lea eax, [esp + 0x778]
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 + 0x5c]
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
jmp 0x410735
push 0x80
push 2
push ebp
push 1
lea edx, [esp + 0x77c]
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x410749
or eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x968
ret
push esi
mov ecx, ebx
call fcn.0040d8e0
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 0x428
mov ecx, 0x10a
lea esi, [esp + 0x978]
mov edi, esp
rep movsd dword es:[edi], dword [esi]
push 0x423e6c
mov ecx, ebx
call fcn.0040f230
test eax, eax
je 0x410802
mov esi, dword [ebx + 0x1a50]
cmp esi, ebp
je 0x41079c
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 0x4107bc
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 0x4107dc
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 0x4107fc
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
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x968
ret