Function at 0x40416a
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40c16d
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x144
cmp dword [ebp + 8], 0
jne 0x40419d
push 6
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40445c
mov eax, dword [ebp + 8]
mov dword [ebp - 0x20], eax
cmp dword [ebp + 0xc], 0
je 0x4041bf
mov ecx, dword [ebp - 0x20]
push ecx
call fcn.00406010
add esp, 4
mov eax, 1
jmp 0x40445c
mov ecx, dword [ebp - 0x20]
add ecx, 0x44
call fcn.004068e0
push eax
mov ecx, dword [ebp - 0x20]
add ecx, 0x44
call fcn.00406830
push eax
call fcn.0040a7e0
add esp, 8
mov edx, dword [ebp - 0x20]
push edx
call fcn.004040b0
add esp, 4
lea eax, [ebp - 0x130]
push eax
lea ecx, [ebp - 0x118]
call fcn.00406780
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x118]
push ecx
mov edx, dword [ebp - 0x20]
add edx, 0x44
sub esp, 0x10
mov ecx, esp
mov dword [ebp - 0x134], esp
push edx
call fcn.00406550
mov dword [ebp - 0x14c], eax
call fcn.0040446a
add esp, 0x14
push 0
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax + 4]
add ecx, 0x14
push ecx
mov edx, dword [ebp - 0x20]
mov eax, dword [edx]
push eax
call sub.MSVCRT.dll_fseek
add esp, 0xc
mov ecx, dword [ebp - 0x20]
mov edx, dword [ecx]
push edx
push 1
push 0xe0
lea eax, [ebp - 0x108]
push eax
call sub.MSVCRT.dll_fread
add esp, 0x10
lea ecx, [ebp - 0x118]
push ecx
call fcn.00404904
add esp, 4
mov dword [ebp - 0x28], eax
mov edx, dword [ebp - 0x20]
push edx
call fcn.004049b9
add esp, 4
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x118]
push eax
call fcn.00404a10
add esp, 4
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x28]
add ecx, 3
and ecx, 0xfffffffc
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x18]
add edx, 3
and edx, 0xfffffffc
mov dword [ebp - 0x18], edx
mov eax, dword [ebp - 0x28]
add eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x10]
mov dword [ebp - 0x12c], eax
mov ecx, dword [ebp - 0xe4]
mov edx, dword [ebp - 0x12c]
lea eax, [edx + ecx - 1]
mov ecx, dword [ebp - 0xe4]
sub ecx, 1
not ecx
and eax, ecx
mov dword [ebp - 0x24], eax
mov edx, dword [ebp - 0xe8]
push edx
mov eax, dword [ebp - 0xe4]
push eax
mov ecx, dword [ebp - 0xd0]
push ecx
mov edx, dword [ebp - 0x12c]
push edx
mov eax, dword [ebp - 0x20]
push eax
call fcn.004060cf
add esp, 0x14
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x40434e
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov edx, dword [ebp - 0x20]
push edx
call fcn.00406010
add esp, 4
mov dword [ebp - 0x138], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x118]
call fcn.00406ad0
mov eax, dword [ebp - 0x138]
jmp 0x40445c
mov eax, dword [ebp - 0x24]
push eax
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [ebp - 0x13c], eax
mov ecx, dword [ebp - 0x13c]
mov dword [ebp - 0x1c], ecx
mov edx, dword [ebp - 0x24]
push edx
push 0
mov eax, dword [ebp - 0x1c]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
mov ecx, dword [ebp - 0x1c]
add ecx, dword [ebp - 0x28]
push ecx
mov edx, dword [ebp - 0x20]
push edx
lea eax, [ebp - 0x128]
push eax
call fcn.00404ae9
add esp, 0xc
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x28]
add ecx, dword [ebp - 0x18]
push ecx
mov edx, dword [ebp - 0x28]
push edx
sub esp, 0x10
mov ecx, esp
mov dword [ebp - 0x140], esp
lea eax, [ebp - 0x128]
push eax
call fcn.00406460
mov dword [ebp - 0x150], eax
mov ecx, dword [ebp - 0x1c]
push ecx
lea edx, [ebp - 0x118]
push edx
mov eax, dword [ebp - 0x20]
push eax
call fcn.00404c28
add esp, 0x24
push 0
mov ecx, dword [ebp - 0x20]
mov edx, dword [ecx + 0x1c]
push edx
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax]
push ecx
call sub.MSVCRT.dll_fseek
add esp, 0xc
mov edx, dword [ebp - 0x20]
mov eax, dword [edx]
push eax
mov ecx, dword [ebp - 0x24]
push ecx
push 1
mov edx, dword [ebp - 0x1c]
push edx
call sub.MSVCRT.dll_fwrite
add esp, 0x10
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x144], eax
mov ecx, dword [ebp - 0x144]
push ecx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov edx, dword [ebp - 0x20]
push edx
call fcn.00406010
add esp, 4
mov dword [ebp - 0x148], 1
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x128]
call fcn.00406440
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x118]
call fcn.00406ad0
mov eax, dword [ebp - 0x148]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret