Function at 0x40f060
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, dword [ebp + 0x10]
sub esp, 0xc
push ebx
mov ebx, ecx
mov ecx, dword [ebp + 0xc]
push esi
push edi
test eax, eax
jg 0x40f08b
jl 0x40f07e
test ecx, ecx
jne 0x40f08b
xor eax, eax
xor edx, edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp dword [ebx + 0x38], 0
mov edi, ecx
je 0x40f16e
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x10], eax
mov ecx, ebx
call fcn.00407120
mov ecx, edx
mov esi, eax
mov dword [esp + 0x14], ecx
test ecx, ecx
jl 0x40f0fb
jg 0x40f0bb
test esi, esi
je 0x40f0fb
mov eax, dword [esp + 0xc]
cmp eax, ecx
jg 0x40f0cf
jl 0x40f0c9
cmp edi, esi
jae 0x40f0cf
mov esi, edi
mov dword [esp + 0x14], eax
mov eax, dword [ebx + 0x1c]
push esi
push dword [eax]
push dword [esp + 0x18]
call fcn.00473580
mov eax, dword [ebx + 0x2c]
add esp, 0xc
mov ecx, dword [esp + 0xc]
sub edi, esi
sbb ecx, dword [esp + 0x14]
sub dword [eax], esi
mov eax, dword [ebx + 0x1c]
add dword [eax], esi
mov eax, dword [esp + 0x10]
jmp 0x40f128
mov eax, dword [ebx]
mov esi, dword [eax + 0x1c]
mov ecx, esi
call dword [0x4a02ac]
mov ecx, ebx
call esi
mov ecx, eax
cmp ecx, 0xffffffff
je 0x40f157
mov eax, dword [esp + 0x10]
add edi, 0xffffffff
mov esi, 1
mov byte [eax], cl
mov ecx, dword [esp + 0xc]
adc ecx, 0xffffffff
add eax, esi
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], eax
test ecx, ecx
jg 0x40f0a2
jl 0x40f15b
test edi, edi
jne 0x40f0a2
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
sub eax, edi
sbb edx, ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [esp + 0xc]
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
sub eax, edi
sbb edx, ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebx + 0x1c]
mov edx, dword [eax]
test edx, edx
je 0x40f1b0
mov eax, dword [ebx + 0x2c]
mov eax, dword [eax]
test eax, eax
je 0x40f1b0
mov edi, dword [ebp + 8]
cmp eax, ecx
mov esi, ecx
cmovb esi, eax
push esi
push edx
push edi
call fcn.00473580
mov eax, dword [ebx + 0x2c]
add edi, esi
mov dword [esp + 0x20], edi
add esp, 0xc
mov edi, dword [ebp + 0xc]
sub edi, esi
sub dword [eax], esi
mov eax, dword [ebx + 0x1c]
add dword [eax], esi
mov esi, dword [esp + 0x14]
jmp 0x40f1b3
mov esi, dword [ebp + 8]
cmp dword [ebx + 0x4c], 0
mov ecx, edi
je 0x40f221
mov ecx, dword [ebx + 0xc]
lea eax, [ebx + 0x3c]
cmp dword [ecx], eax
jne 0x40f1dc
mov eax, dword [ebx + 0xc]
mov edx, dword [ebx + 0x54]
mov ecx, dword [ebx + 0x50]
sub edx, ecx
mov dword [eax], ecx
mov eax, dword [ebx + 0x1c]
mov dword [eax], ecx
mov eax, dword [ebx + 0x2c]
mov dword [eax], edx
mov ecx, edi
cmp edi, 0xfff
jbe 0x40f20a
push dword [ebx + 0x4c]
push 0xfff
push 1
push esi
call fcn.0047ac42
sub edi, eax
add esp, 0x10
add esi, eax
mov ecx, edi
cmp eax, 0xfff
jne 0x40f235
cmp edi, eax
ja 0x40f1e6
test ecx, ecx
je 0x40f221
push dword [ebx + 0x4c]
push edi
push 1
push esi
call fcn.0047ac42
mov ecx, edi
add esp, 0x10
sub ecx, eax
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
sub eax, ecx
sbb edx, 0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
sub eax, edi
pop edi
pop esi
sbb edx, 0
pop ebx
mov esp, ebp
pop ebp
ret 0xc