Function at 0x409b10
Capabilities:
Read file on windows

Disassembly:
push ecx
mov ecx, dword [esp + 0xc]
push ebx
push ebp
mov ebp, dword [esp + 0x10]
push esi
push edi
test ebp, ebp
mov edi, ecx
je 0x409d61
cmp byte [ebp + 0x5c], 0x72
jne 0x409d61
mov eax, dword [ebp + 0x38]
cmp eax, 0xfffffffd
je 0x409d58
cmp eax, 0xffffffff
je 0x409d58
cmp eax, 1
jne 0x409b53
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret
mov esi, dword [esp + 0x20]
mov dword [esp + 0x10], ecx
test esi, esi
mov dword [ebp + 0xc], ecx
mov dword [ebp + 0x10], esi
je 0x409d35
mov ebx, dword [esp + 0x24]
mov eax, dword [ebp + 0x58]
test eax, eax
mov eax, dword [ebp + 4]
jne 0x409c8a
test eax, eax
jne 0x409bd9
mov eax, dword [ebp + 0x3c]
test eax, eax
jne 0x409bd9
call dword [sym.imp.MSVCRT.dll__errno]
mov dword [eax], 0
mov eax, dword [ebp + 0x40]
mov ecx, dword [ebp + 0x44]
push eax
push 0x4000
push 1
push ecx
call dword [sym.imp.MSVCRT.dll_fread]
mov edx, dword [ebp + 0x44]
push ebx
push eax
push edx
mov dword [ebp + 4], eax
call fcn.00409ad0
mov eax, dword [ebp + 4]
add esp, 0x1c
test eax, eax
jne 0x409bd3
mov eax, dword [ebp + 0x40]
mov dword [ebp + 0x3c], 1
test byte [eax + 0xc], 0x20
jne 0x409d2e
mov ecx, dword [ebp + 0x44]
mov dword [ebp], ecx
push 0
push ebp
call fcn.0040a2e0
add esp, 8
cmp eax, 1
mov dword [ebp + 0x38], eax
jne 0x409c21
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x4c]
sub edx, edi
push edx
push edi
push eax
call fcn.0040ba20
mov ecx, dword [ebp + 0xc]
push ebp
mov dword [ebp + 0x4c], eax
mov dword [esp + 0x28], ecx
call fcn.00409f30
mov ecx, dword [ebp + 0x4c]
add esp, 0x10
cmp eax, ecx
je 0x409c47
mov dword [ebp + 0x38], 0xfffffffd
mov edi, dword [esp + 0x18]
mov eax, dword [ebp + 0x38]
test eax, eax
jne 0x409d35
mov eax, dword [ebp + 0x3c]
test eax, eax
jne 0x409d35
mov eax, dword [ebp + 0x10]
test eax, eax
jne 0x409b6d
jmp 0x409d35
push ebp
call fcn.00409f30
push ebp
call fcn.00409800
mov eax, dword [ebp + 0x38]
add esp, 8
test eax, eax
jne 0x409c1d
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0x14]
push ebp
call fcn.0040a130
push 0
push 0
push 0
mov dword [ebp + 8], esi
mov dword [ebp + 0x14], edi
call fcn.0040ba20
mov edi, dword [esp + 0x28]
mov esi, dword [esp + 0x30]
add esp, 0x10
mov dword [ebp + 0x4c], eax
jmp 0x409c21
mov ecx, dword [ebp + 0x10]
cmp eax, ecx
jbe 0x409c93
mov eax, ecx
test eax, eax
jbe 0x409cd6
mov esi, dword [ebp]
mov edi, dword [ebp + 0xc]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x1c]
mov esi, dword [ebp]
mov edx, dword [ebp + 0x10]
add ecx, eax
mov dword [esp + 0x10], ecx
mov dword [ebp + 0xc], ecx
mov ecx, dword [ebp + 4]
add esi, eax
sub edx, eax
sub ecx, eax
mov dword [ebp], esi
mov esi, dword [esp + 0x20]
mov dword [ebp + 0x10], edx
mov dword [ebp + 4], ecx
mov eax, dword [ebp + 0x10]
test eax, eax
jbe 0x409d06
mov edx, dword [ebp + 0x40]
push edx
push eax
mov eax, dword [esp + 0x18]
push 1
push eax
call dword [sym.imp.MSVCRT.dll_fread]
mov edx, dword [ebp + 0x10]
mov ecx, dword [esp + 0x20]
push ebx
sub edx, eax
push eax
push ecx
mov dword [ebp + 0x10], edx
call fcn.00409ad0
add esp, 0x1c
mov edi, dword [ebp + 0x10]
mov edx, dword [ebp + 8]
mov ecx, dword [ebp + 0x14]
sub esi, edi
add edx, esi
add ecx, esi
test esi, esi
mov dword [ebp + 8], edx
mov dword [ebp + 0x14], ecx
jne 0x409d26
mov dword [ebp + 0x3c], 1
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
mov dword [ebp + 0x38], 0xffffffff
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x4c]
sub edx, edi
push edx
push edi
push eax
call fcn.0040ba20
mov ecx, dword [ebp + 0x10]
add esp, 0xc
mov dword [ebp + 0x4c], eax
mov eax, esi
pop edi
pop esi
pop ebp
sub eax, ecx
pop ebx
pop ecx
ret
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
pop ecx
ret
pop edi
pop esi
pop ebp
mov eax, 0xfffffffe
pop ebx
pop ecx
ret