Function at 0x401714
Capabilities:
Check if file exists
Get common file path
Get file size
Read file on windows
Write file on windows

Disassembly:
push 0x28
mov eax, 0x40f5f3
call fcn.00403081
xor ebx, ebx
push 0x41408c
lea ecx, [ebp - 0x20]
mov dword [ebp - 0x34], ebx
call fcn.004012f5
mov esi, 0x104
push esi
lea ecx, [ebp - 0x20]
mov dword [ebp - 4], ebx
call fcn.00401415
push esi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0xffffffffffffffff
lea ecx, [ebp - 0x20]
mov edi, eax
call fcn.004012cb
cmp edi, ebx
jbe 0x401963
push ebx
push 0x80
push 3
push ebx
push 3
push 0x81
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x10], eax
cmp eax, 0xffffffff
je 0x401963
push 0xc
pop edi
push ebx
push eax
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x1c], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, edi
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x30], eax
jbe 0x4017ff
mov dword [ebp - 0x24], 0xfffffff4
push 2
push ebx
push dword [ebp - 0x24]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x1c]
push eax
push 4
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x10]
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x28], ebx
call edi
push ebx
lea eax, [ebp - 0x1c]
push eax
push 4
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x10]
call edi
cmp dword [ebp - 0x2c], 0x4f4a4f4d
jne 0x4017f1
cmp dword [ebp - 0x28], 0x4f4a4f4a
je 0x4017ff
inc dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
dec dword [ebp - 0x24]
cmp eax, dword [ebp - 0x30]
jb 0x4017aa
push ebx
lea eax, [ebp - 0x1c]
push eax
push 4
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x10]
mov dword [ebp - 0x14], ebx
call edi
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x18]
add ecx, eax
cmp ecx, dword [ebp - 0x30]
ja 0x40195a
push eax
call fcn.004027d0
pop ecx
mov dword [ebp - 0x28], eax
cmp eax, ebx
je 0x40195a
mov eax, dword [ebp - 0x14]
add eax, dword [ebp - 0x18]
push 2
push ebx
neg eax
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x14]
push dword [ebp - 0x28]
push dword [ebp - 0x10]
call edi
mov edi, 0x41408c
push edi
lea ecx, [ebp - 0x18]
call fcn.004012f5
push esi
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 1
call fcn.00401415
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push 0xffffffffffffffff
lea ecx, [ebp - 0x18]
call fcn.004012cb
push dword [ebp - 0x18]
lea ecx, [ebp - 0x2c]
call fcn.00401692
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 2
call fcn.00401449
push edi
lea ecx, [ebp - 0x24]
xor esi, esi
call fcn.004012f5
mov byte [ebp - 4], 3
push esi
push dword [ebp - 0x2c]
lea eax, [ebp - 0x24]
push 0x410260
push eax
call fcn.0040165f
mov edi, dword [ebp - 0x24]
add esp, 0x10
push edi
inc esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4018db
cmp esi, 0xc8
jl 0x4018ad
jmp 0x401930
push ebx
push 0x80
push 1
push ebx
push 3
push 0x1f01ff
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x401930
push ebx
lea eax, [ebp - 0x30]
push eax
push dword [ebp - 0x14]
mov dword [ebp - 0x30], ebx
push dword [ebp - 0x28]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x14]
jne 0x401930
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x24]
push eax
mov dword [ebp - 0x34], 1
call fcn.004015ee
push dword [ebp - 0x28]
call fcn.004030fe
pop ecx
lea ecx, [edi - 0x10]
call fcn.0040116b
mov ecx, dword [ebp - 0x2c]
add ecx, 0xfffffff0
call fcn.0040116b
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffff0
mov byte [ebp - 4], bl
call fcn.0040116b
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x20]
add ecx, 0xfffffff0
call fcn.0040116b
mov eax, dword [ebp - 0x34]
call fcn.004030ea
ret