Function at 0x40a190
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5092cc
mov eax, dword fs:[0]
push eax
sub esp, 0x9c
mov eax, dword [0x5645bc]
xor eax, ebp
mov dword [ebp - 0x14], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0xa8], ecx
cmp dword [ebp + 8], 0
jne 0x40a1ce
xor al, al
jmp 0x40a3a7
cmp dword [ebp + 0xc], 0
jne 0x40a1db
xor al, al
jmp 0x40a3a7
cmp dword [ebp + 8], 0
jne 0x40a1e8
xor al, al
jmp 0x40a3a7
cmp dword [ebp + 0xc], 0
jne 0x40a1f5
xor al, al
jmp 0x40a3a7
mov eax, dword [ebp + 8]
push eax
lea ecx, [ebp - 0x80]
call fcn.00401c10
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x80]
push ecx
lea edx, [ebp - 0x30]
push edx
call fcn.0043bb10
add esp, 8
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x80]
call fcn.00401c50
mov eax, dword [ebp + 0xc]
push eax
lea ecx, [ebp - 0x9c]
call fcn.00401c10
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x9c]
push ecx
lea edx, [ebp - 0x64]
push edx
call fcn.0043bb10
add esp, 8
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x9c]
call fcn.00401c50
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x3c], 0
push 0
push 0x80
push 4
push 0
push 1
push SysReAllocString
lea ecx, [ebp - 0x64]
call fcn.00401e80
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0xffffffff
je 0x40a2a0
push 0
mov eax, dword [ebp - 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x10]
mov eax, dword [ecx]
sub eax, dword [edx]
push eax
call fcn.0045acac
add esp, 4
mov dword [ebp - 0xa0], eax
mov ecx, dword [ebp - 0xa0]
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x38], 0
push 0
push 0
mov edx, dword [ebp + 0x10]
mov eax, dword [edx]
push eax
mov ecx, dword [ebp - 0x40]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea edx, [ebp - 0x38]
push edx
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x10]
mov edx, dword [eax]
sub edx, dword [ecx]
push edx
mov eax, dword [ebp - 0x34]
push eax
mov ecx, dword [ebp - 0x40]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
push 0x80
push 4
push 0
push 1
push 0xc0000000
lea ecx, [ebp - 0x30]
call fcn.00401e80
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0xffffffff
je 0x40a335
push 0
mov edx, dword [ebp - 0x44]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x3c], eax
push 2
push 0
push 0
mov eax, dword [ebp - 0x44]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x48], 0
push 0
lea ecx, [ebp - 0x48]
push ecx
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp + 0x10]
mov ecx, dword [edx]
sub ecx, dword [eax]
push ecx
mov edx, dword [ebp - 0x34]
push edx
mov eax, dword [ebp - 0x44]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x40]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x44]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 0xa1], 1
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x64]
call fcn.00401cd0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x30]
call fcn.00401cd0
mov al, byte [ebp - 0xa1]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00463ee8
mov esp, ebp
pop ebp
ret 0x10