Function at 0x40aea0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [ebp + 8], 0
mov eax, dword [ebp + 0x14]
push ebx
mov ebx, dword [ebp + 0x10]
push esi
mov esi, ecx
push edi
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x18], edx
mov edi, 0x80
mov dword [ebp - 0x1c], 0
jle 0x40af7d
cmp dword [ebp + 0x18], 2
push esi
push 1
je 0x40af11
mov ecx, dword [ebp - 0x18]
push 4
push ecx
call dword [sym.imp.MSVCR100.dll_fread]
add dword [ebp - 0x18], 4
add esp, 0x10
test eax, eax
jne 0x40af0a
mov eax, 1
sub edi, 4
jmp 0x40af30
xor eax, eax
sub edi, 4
jmp 0x40af30
push 8
push ebx
call dword [sym.imp.MSVCR100.dll_fread]
add esp, 0x10
add ebx, 8
test eax, eax
jne 0x40af2b
mov eax, 1
jmp 0x40af2d
xor eax, eax
sub edi, 8
test edi, edi
jne 0x40af65
mov edx, dword [ebp + 8]
dec edx
cmp dword [ebp - 0x1c], edx
je 0x40af65
push esi
push 1
lea eax, [ebp - 0x14]
push 2
push eax
call dword [sym.imp.MSVCR100.dll_fread]
mov cx, word [ebp - 0x14]
add esp, 0x10
neg eax
sbb eax, eax
inc eax
movzx edi, ch
cmp ch, 0x80
jb 0x40af65
mov edi, 0x80
mov ecx, dword [ebp - 0x1c]
inc ecx
mov dword [ebp - 0x1c], ecx
cmp ecx, dword [ebp + 8]
jl 0x40aee0
mov edx, dword [ebp - 0x20]
mov ebx, dword [ebp - 0x28]
jmp 0x40af80
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x40af9a
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045d089
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0xc], 0
mov dword [ebp - 0x1c], 0
jle 0x40b05f
mov ebx, dword [ebp - 0x2c]
mov dword [ebp - 0x18], ebx
jmp 0x40afb6
mov esi, dword [ebp - 0x24]
push esi
push 1
cmp edi, 0xc
jge 0x40b021
mov ebx, dword [sym.imp.MSVCR100.dll_fread]
lea ecx, [ebp - 0x10]
push edi
push ecx
call ebx
push esi
push 1
lea edx, [ebp - 0x14]
push 2
push edx
call ebx
push esi
mov ebx, 0xc
push 1
sub ebx, edi
lea eax, [ebp + edi - 0x10]
push ebx
push eax
call dword [sym.imp.MSVCR100.dll_fread]
add esp, 0x30
mov esi, eax
mov ax, word [ebp - 0x14]
neg esi
sbb esi, esi
inc esi
movzx edi, ah
cmp ah, 0x80
jb 0x40b007
mov edi, 0x80
mov edx, dword [ebp - 0x18]
push 0xc
lea ecx, [ebp - 0x10]
push ecx
push edx
sub edi, ebx
call dword [sym.imp.MSVCR100.dll_strncpy]
mov ebx, dword [ebp - 0x18]
add esp, 0xc
jmp 0x40b037
push 0xc
push ebx
call dword [sym.imp.MSVCR100.dll_fread]
add esp, 0x10
mov esi, eax
neg esi
sbb esi, esi
inc esi
sub edi, 0xc
mov byte [ebx + 0xc], 0
test esi, esi
jne 0x40af84
mov eax, dword [ebp - 0x1c]
inc eax
add ebx, 0xd
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], ebx
cmp eax, dword [ebp + 0xc]
jl 0x40afb3
mov edx, dword [ebp - 0x20]
mov ebx, dword [ebp - 0x28]
cmp dword [ebp + 0x18], 1
jne 0x40b0a2
mov esi, dword [ebp + 8]
xor ecx, ecx
test esi, esi
jle 0x40b0a2
fld qword [0x4a5b10]
fld dword [0x4802b8]
jmp 0x40b07e
fxch st(1)
fxch st(1)
fcom qword [ebx + ecx*8]
fnstsw ax
test ah, 5
jp 0x40b092
fld qword [ebx + ecx*8]
fstp dword [edx + ecx*4]
jmp 0x40b099
fxch st(1)
fst dword [edx + ecx*4]
fxch st(1)
inc ecx
cmp ecx, esi
jl 0x40b07c
fstp st(0)
fstp st(0)
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.0045d089
mov esp, ebp
pop ebp
ret