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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc0
push ebx
push esi
push edi
mov ebx, eax
mov byte [ebp - 1], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov eax, 0x8000
call fcn.00403ca4
mov edi, eax
mov eax, dword [ebx + 0x30]
mov edx, dword [ebx + 0x34]
cmp edx, dword [ebp + 0x14]
jne 0x40f60f
cmp eax, dword [ebp + 0x10]
jb 0x40f824
mov eax, dword [ebx + 0x30]
mov edx, dword [ebx + 0x34]
cmp edx, dword [ebp + 0xc]
jne 0x40f623
cmp eax, dword [ebp + 8]
jae 0x40f7e3
mov eax, dword [ebx + 0x30]
mov dword [ebp + 8], eax
mov eax, dword [ebx + 0x34]
mov dword [ebp + 0xc], eax
jmp 0x40f7e3
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
sub eax, dword [ebp + 0x10]
sbb edx, dword [ebp + 0x14]
cmp edx, 0
jne 0x40f654
cmp eax, 0x8000
jbe 0x40f666
jmp 0x40f656
jle 0x40f666
mov dword [ebp - 0x30], 0x8000
mov dword [ebp - 0x2c], 0
jmp 0x40f678
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
sub eax, dword [ebp + 0x10]
sbb edx, dword [ebp + 0x14]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], edx
mov eax, dword [ebp - 0x30]
mov esi, eax
xor eax, eax
mov dword [ebp - 0x20], eax
xor eax, eax
mov dword [ebp - 0x24], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0xc], eax
push 0
push 0
push dword [ebp - 0xc]
push dword [ebp - 0x10]
mov eax, dword [ebx + 0x18]
push eax
call sub.kernel32.dll_SetFilePointerEx
test eax, eax
jne 0x40f6ca
mov edx, 0x40f840
mov eax, ebx
call fcn.0040efc0
test edi, edi
je 0x40f824
mov eax, edi
call fcn.00403cc0
jmp 0x40f824
push 0
lea eax, [ebp - 0x20]
push eax
push esi
push edi
mov eax, dword [ebx + 0x18]
push eax
call sub.kernel32.dll_ReadFile
test eax, eax
je 0x40f6e4
cmp esi, dword [ebp - 0x20]
je 0x40f702
push dword [ebp + 0x14]
push dword [ebp + 0x10]
mov eax, esi
xor edx, edx
add eax, dword [ebp + 0x10]
adc edx, dword [ebp + 0x14]
push edx
push eax
mov eax, ebx
call fcn.0040f28c
mov byte [ebp - 0x19], al
jmp 0x40f738
push 0
lea eax, [ebp - 0x24]
push eax
mov eax, dword [ebp - 0x20]
push eax
push edi
mov eax, dword [ebx + 0x1c]
push eax
call sub.kernel32.dll_WriteFile
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 0x19], al
cmp byte [ebx + 4], 0
je 0x40f738
cmp dword [ebp - 0x24], 0
jbe 0x40f738
mov edx, edi
lea eax, [ebx + 0x50]
mov ecx, dword [ebp - 0x24]
call fcn.0040de70
cmp byte [ebp - 0x19], 0
jne 0x40f75e
mov edx, 0x40f8a0
mov eax, ebx
call fcn.0040efc0
test edi, edi
je 0x40f824
mov eax, edi
call fcn.00403cc0
jmp 0x40f824
mov eax, dword [ebp - 0x24]
xor edx, edx
add dword [ebx + 0x38], eax
adc dword [ebx + 0x3c], edx
push 0
push 2
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x14]
call fcn.00407650
cmp edx, 0
jne 0x40f7d1
cmp eax, 0
jne 0x40f7d1
push 0
push 0x64
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
call fcn.004075e0
mov dword [ebp - 0x38], eax
sub edx, 0x80000000
mov dword [ebp - 0x34], edx
fild qword [ebp - 0x38]
fadd qword [0x40f8e0]
mov eax, dword [ebx + 0x30]
mov edx, dword [ebx + 0x34]
mov dword [ebp - 0x40], eax
sub edx, 0x80000000
mov dword [ebp - 0x3c], edx
fild qword [ebp - 0x40]
fadd qword [0x40f8e0]
fdivp st(1)
call fcn.00404368
mov edx, eax
mov eax, ebx
call fcn.0040f014
mov eax, esi
xor edx, edx
add dword [ebp + 0x10], eax
adc dword [ebp + 0x14], edx
add dword [ebp - 0x18], 1
adc dword [ebp - 0x14], 0
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
cmp edx, dword [ebp + 0xc]
jne 0x40f7f1
cmp eax, dword [ebp + 8]
jae 0x40f7fd
cmp byte [ebx + 5], 1
je 0x40f63a
test edi, edi
je 0x40f808
mov eax, edi
call fcn.00403cc0
cmp byte [ebx + 5], 2
jne 0x40f820
mov edx, 0x40f8f4
mov eax, ebx
call fcn.0040efc0
mov byte [ebx + 5], 0
jmp 0x40f824
mov byte [ebp - 1], 1
movzx eax, byte [ebp - 1]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10