Function at 0x40ace0
Capabilities:
Get file size
Read file on windows

Disassembly:
sub esp, 0xc
push ebx
mov ebx, ecx
mov eax, dword [ebx + 4]
push ebp
xor ebp, ebp
cmp eax, ebp
je 0x40acf5
cmp eax, 0xffffffff
jne 0x40acff
pop ebp
xor al, al
pop ebx
add esp, 0xc
ret 8
push esi
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
push 1
push ebp
push ebp
push eax
call esi
xor ecx, ecx
cmp eax, 0xffffffff
sete cl
mov dword [esp + 0x18], ebp
dec ecx
and ecx, eax
mov dword [esp + 0x14], ecx
jmp 0x40ad30
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea esp, [esp]
mov edi, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
mov ecx, dword [ebx + 4]
push ebp
lea edx, [esp + 0x14]
push edx
push edi
push eax
push ecx
mov dword [esp + 0x24], ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40ad75
mov eax, dword [ebx + 4]
cmp eax, ebp
je 0x40aea3
cmp eax, 0xffffffff
je 0x40aea3
mov edx, dword [esp + 0x14]
push ebp
push ebp
push edx
push eax
call esi
jmp 0x40aea3
cmp dword [esp + 0x10], edi
je 0x40aedb
mov eax, dword [ebx + 4]
cmp eax, ebp
je 0x40ad8b
cmp eax, 0xffffffff
jne 0x40ad8f
xor esi, esi
jmp 0x40ada3
push 1
push ebp
push ebp
push eax
call esi
xor ecx, ecx
cmp eax, 0xffffffff
sete cl
dec ecx
and ecx, eax
mov esi, ecx
mov eax, dword [ebx + 4]
cmp eax, ebp
je 0x40adbc
cmp eax, 0xffffffff
je 0x40adbc
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
jne 0x40adbf
or eax, 0xffffffff
cmp esi, eax
je 0x40aeb5
mov esi, dword [esp + 0x10]
cmp esi, ebp
je 0x40aecf
mov ecx, dword [esp + 0x20]
push ebp
lea edx, [esp + 0x14]
push edx
mov eax, edi
sub eax, esi
push eax
mov eax, dword [ebx + 4]
lea edx, [esi + ecx]
push edx
push eax
mov dword [esp + 0x24], ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40ae8e
jmp 0x40ae02
mov edi, dword [esp + 0x24]
mov ecx, dword [esp + 0x10]
lea edx, [esi + ecx]
cmp edx, edi
je 0x40aedb
mov eax, dword [ebx + 4]
cmp eax, ebp
je 0x40ae1d
cmp eax, 0xffffffff
jne 0x40ae21
xor edi, edi
jmp 0x40ae39
push 1
push ebp
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
xor ecx, ecx
cmp eax, 0xffffffff
sete cl
dec ecx
and ecx, eax
mov edi, ecx
mov eax, dword [ebx + 4]
cmp eax, ebp
je 0x40ae52
cmp eax, 0xffffffff
je 0x40ae52
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
jne 0x40ae55
or eax, 0xffffffff
cmp edi, eax
je 0x40ae96
mov eax, dword [esp + 0x10]
cmp eax, ebp
je 0x40aecf
mov ecx, dword [esp + 0x20]
add esi, eax
mov eax, dword [esp + 0x24]
push ebp
lea edx, [esp + 0x14]
push edx
sub eax, esi
push eax
mov eax, dword [ebx + 4]
lea edx, [esi + ecx]
push edx
push eax
mov dword [esp + 0x24], ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40adfe
mov ecx, dword [esp + 0x14]
push ebp
push ecx
jmp 0x40ae9c
mov edx, dword [esp + 0x14]
push ebp
push edx
mov ecx, ebx
call fcn.0040aaa0
mov eax, dword [esp + 0x18]
inc eax
cmp eax, 0xa
mov dword [esp + 0x18], eax
jl 0x40ad23
mov eax, dword [ebx + 4]
cmp eax, ebp
je 0x40aecf
cmp eax, 0xffffffff
je 0x40aecf
mov ecx, dword [esp + 0x14]
push ebp
push ebp
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0xc
ret 8
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0xc
ret 8