Function at 0x401118
Capabilities:
Get common file path
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xad0
and dword [ebp - 0x108], 0
and dword [ebp - 0xab4], 0
push 0x94
push 0
lea eax, [ebp - 0x2a4]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
mov dword [ebp - 0x2a4], 0x94
lea eax, [ebp - 0x2a4]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
push 0x103
lea eax, [ebp - 0x104]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x103
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x402028
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push 0x402024
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push 0x402020
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push 0
push 0x80
push 4
push 0
push 1
push 0x80000000
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0xab8], eax
cmp dword [ebp - 0xab8], 0xffffffff
je 0x401208
push 0
push dword [ebp - 0xab8]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x108], eax
push dword [ebp - 0xab8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40120d
jmp 0x40148c
push 0x40201c
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
pop ecx
mov dword [ebp - 0xac0], eax
cmp dword [ebp - 0xac0], 0
je 0x4012a5
push 1
pop eax
test eax, eax
je 0x4012a3
push 1
push 0
lea eax, [ebp - 0x2a8]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0
mov eax, dword [ebp - 0x108]
mov dword [ebp - 0xac8], eax
push dword [ebp - 0xac8]
push dword [ebp - 0xac0]
mov eax, dword [ebp - 0x108]
dec eax
mov dword [ebp - 0x108], eax
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
push dword [ebp - 0xac0]
push 1
push 1
lea eax, [ebp - 0x2a8]
push eax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
movzx eax, byte [ebp - 0x2a8]
test eax, eax
je 0x4012a1
jmp 0x4012a3
jmp 0x401230
jmp 0x4012aa
jmp 0x40148c
mov eax, dword [ebp - 0x108]
inc eax
inc eax
mov dword [ebp - 0x108], eax
fld qword [0x4010c0]
push ecx
push ecx
fstp qword [esp]
mov eax, dword [ebp - 0x108]
mov dword [ebp - 0xad0], eax
and dword [ebp - 0xacc], 0
fild qword [ebp - 0xad0]
push ecx
push ecx
fstp qword [esp]
call sub.MSVCRT.dll_fmod
add esp, 0x10
fsubr qword [0x4010c0]
call sub.MSVCRT.dll__ftol
mov dword [ebp - 0xabc], eax
mov eax, dword [ebp - 0x108]
add eax, dword [ebp - 0xabc]
mov dword [ebp - 0x108], eax
push dword [ebp - 0xac0]
call dword [sym.imp.MSVCRT.dll_rewind]
pop ecx
push 0x402018
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
pop ecx
mov dword [ebp - 0x210], eax
cmp dword [ebp - 0x210], 0
je 0x40148c
mov eax, dword [ebp - 0xab4]
add eax, 0x808
cmp eax, dword [ebp - 0x108]
ja 0x4013ed
mov eax, dword [ebp - 0xab4]
cmp eax, dword [ebp - 0x108]
je 0x4013ed
mov eax, dword [ebp - 0xab4]
add eax, 0x808
cmp eax, dword [ebp - 0x108]
ja 0x40138f
mov eax, dword [ebp - 0xab4]
add eax, 0x808
mov dword [ebp - 0xab4], eax
jmp 0x401391
jmp 0x4013ed
push 0x808
push 0
lea eax, [ebp - 0xab0]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push dword [ebp - 0xac0]
push 0x808
push 1
lea eax, [ebp - 0xab0]
push eax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
mov dword [ebp - 0xac4], eax
push dword [ebp - 0x210]
push dword [ebp - 0xac4]
push 1
lea eax, [ebp - 0xab0]
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
jmp 0x401357
mov eax, dword [ebp - 0xab4]
cmp eax, dword [ebp - 0x108]
jae 0x401472
mov eax, dword [ebp - 0xab4]
cmp eax, dword [ebp - 0x108]
je 0x401472
mov eax, dword [ebp - 0xab4]
inc eax
cmp eax, dword [ebp - 0x108]
ja 0x401427
mov eax, dword [ebp - 0xab4]
inc eax
mov dword [ebp - 0xab4], eax
jmp 0x401429
jmp 0x401472
push 1
push 0
lea eax, [ebp - 0x2a8]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push dword [ebp - 0xac0]
push 1
push 1
lea eax, [ebp - 0x2a8]
push eax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
push dword [ebp - 0x210]
push 1
push 1
lea eax, [ebp - 0x2a8]
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
jmp 0x4013fb
push dword [ebp - 0x210]
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
push dword [ebp - 0xac0]
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
leave
ret