Function at 0x40a8f5
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x64
mov eax, dword [ebp + 0xc]
and eax, 0x1000
mov dword [ebp - 0x64], eax
sub esp, 8
push 0x34
push 1
call sub.msvcrt.dll_calloc
add esp, 0x10
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
test eax, eax
jne 0x40a935
sub esp, 0xc
push 0x403d21
call sub.msvcrt.dll_perror
add esp, 0x10
call sub.msvcrt.dll_abort
mov ebx, dword [ebp - 0xc]
sub esp, 0xc
push dword [ebp + 8]
call fcn.00403d30
add esp, 0x10
mov dword [ebx], eax
mov eax, dword [ebp - 0xc]
mov dword [eax + 8], 0
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x24], 0
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x30], 0
mov eax, dword [ebp + 0xc]
and eax, 1
test eax, eax
je 0x40a979
mov dword [ebp - 0x10], 0
jmp 0x40a980
mov dword [ebp - 0x10], 2
mov ebx, dword [ebp - 0xc]
sub esp, 8
mov eax, dword [ebp - 0x10]
or eax, 0x8000
push eax
mov eax, dword [ebp - 0xc]
push dword [eax]
call sub.msvcrt.dll__open
add esp, 0x10
mov dword [ebx + 4], eax
mov eax, dword [ebp - 0xc]
cmp dword [eax + 4], 0
jns 0x40aa63
sub esp, 0xc
sub esp, 4
call sub.msvcrt.dll__errno
add esp, 4
push dword [eax]
call sub.msvcrt.dll_strerror
add esp, 0x10
push eax
mov eax, dword [ebp - 0xc]
push dword [eax]
push 0x40a5f0
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
call sub.msvcrt.dll_fprintf
add esp, 0x10
mov dword [ebp - 0x10], 0
lea eax, [ebp + 0xc]
or dword [eax], 1
mov ebx, dword [ebp - 0xc]
sub esp, 8
mov eax, dword [ebp - 0x10]
or eax, 0x8000
push eax
mov eax, dword [ebp - 0xc]
push dword [eax]
call sub.msvcrt.dll__open
add esp, 0x10
mov dword [ebx + 4], eax
mov eax, dword [ebp - 0xc]
cmp dword [eax + 4], 0
jns 0x40aa63
sub esp, 0xc
sub esp, 4
call sub.msvcrt.dll__errno
add esp, 4
push dword [eax]
call sub.msvcrt.dll_strerror
add esp, 0x10
push eax
mov eax, dword [ebp - 0xc]
push dword [eax]
push 0x40a630
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
call sub.msvcrt.dll_fprintf
add esp, 0x10
sub esp, 0xc
push dword [ebp - 0xc]
call fcn.0040a38a
add esp, 0x10
mov dword [ebp - 0x68], 0
jmp 0x40ae69
sub esp, 8
lea eax, [ebp - 0x48]
push eax
mov eax, dword [ebp - 0xc]
push dword [eax + 4]
call sub.msvcrt.dll__fstat
add esp, 0x10
test eax, eax
je 0x40aa96
sub esp, 0xc
push 0x40a65d
call sub.msvcrt.dll_perror
add esp, 0x10
sub esp, 0xc
push 1
call sub.msvcrt.dll_exit
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x34]
mov dword [edx + 0x24], eax
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp + 0xc]
or eax, 2
mov dword [edx + 8], eax
mov ebx, dword [ebp - 0xc]
sub esp, 8
push 1
mov eax, dword [ebp - 0xc]
push dword [eax + 0x24]
call sub.msvcrt.dll_calloc
add esp, 0x10
mov dword [ebx + 0x30], eax
mov eax, dword [ebx + 0x30]
test eax, eax
jne 0x40aae0
sub esp, 0xc
push 0x403d21
call sub.msvcrt.dll_perror
add esp, 0x10
call sub.msvcrt.dll_abort
sub esp, 4
mov eax, dword [ebp - 0xc]
push dword [eax + 0x24]
mov eax, dword [ebp - 0xc]
push dword [eax + 0x30]
mov eax, dword [ebp - 0xc]
push dword [eax + 4]
call sub.msvcrt.dll__read
add esp, 0x10
mov dword [ebp - 0x14], eax
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x14]
cmp eax, dword [edx + 0x24]
jge 0x40ab44
mov eax, dword [ebp - 0xc]
push dword [eax + 0x24]
push dword [ebp - 0x14]
push 0x40a670
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
call sub.msvcrt.dll_fprintf
add esp, 0x10
sub esp, 0xc
push dword [ebp - 0xc]
call fcn.0040a38a
add esp, 0x10
mov dword [ebp - 0x68], 0
jmp 0x40ae69
mov dword [ebp - 0x4c], 0x1000
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x30]
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x58]
cmp dword [eax], 0x66676572
je 0x40ab7d
sub esp, 8
push dword [ebp + 8]
push 0x40a6b0
call fcn.0040bb20
add esp, 0x10
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x68], eax
jmp 0x40ae69
sub esp, 8
push dword [ebp + 8]
push 0x40a6f0
call fcn.0040bb20
add esp, 0x10
mov eax, dword [ebp - 0x58]
add eax, 0x30
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x50]
cmp byte [eax], 0
je 0x40abcd
mov eax, dword [ebp - 0x58]
add eax, 0x70
cmp dword [ebp - 0x50], eax
jb 0x40abae
jmp 0x40abcd
sub esp, 8
mov eax, dword [ebp - 0x50]
movsx eax, byte [eax]
push eax
push 0x403e6f
call fcn.0040bb20
add esp, 0x10
lea eax, [ebp - 0x50]
add dword [eax], 2
jmp 0x40ab99
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x58]
mov eax, dword [eax + 0x24]
add eax, 0x1000
mov dword [edx + 0x28], eax
sub esp, 8
mov eax, dword [ebp - 0xc]
push dword [eax + 0x28]
push 0x40a710
call fcn.0040bb20
add esp, 0x10
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x28]
add eax, dword [edx + 0x30]
add eax, 4
mov dword [ebp - 0x5c], eax
mov eax, dword [ebp - 0x5c]
cmp word [eax], 0x6b6e
jne 0x40acc8
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x5c]
mov eax, dword [eax + 0x1c]
add eax, dword [edx + 0x30]
add eax, 0x1004
mov dword [ebp - 0x60], eax
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x60]
mov ax, word [eax]
mov word [edx + 0x2c], ax
mov eax, dword [ebp - 0xc]
cmp word [eax + 0x2c], 0x6972
jne 0x40ac71
sub esp, 0xc
push 0x40a730
call fcn.0040bb20
add esp, 0x10
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x60]
mov eax, dword [eax + 4]
add eax, dword [edx + 0x30]
add eax, 0x1004
mov dword [ebp - 0x60], eax
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x60]
mov ax, word [eax]
mov word [edx + 0x2c], ax
mov eax, dword [ebp - 0xc]
cmp word [eax + 0x2c], 0x666c
je 0x40ac9b
mov eax, dword [ebp - 0xc]
cmp word [eax + 0x2c], 0x686c
je 0x40ac9b
mov eax, dword [ebp - 0xc]
cmp word [eax + 0x2c], 0x696c
je 0x40ac9b
mov eax, dword [ebp - 0xc]
mov word [eax + 0x2c], 0x666c
mov eax, dword [ebp - 0xc]
mov ax, word [eax + 0x2c]
sar ax, 8
cwde
push eax
mov eax, dword [ebp - 0xc]
movzx eax, byte [eax + 0x2c]
cwde
push eax
mov eax, dword [ebp - 0xc]
movsx eax, word [eax + 0x2c]
push eax
push 0x40a750
call fcn.0040bb20
add esp, 0x10
jmp 0x40acd8
sub esp, 0xc
push 0x40a790
call fcn.0040bb20
add esp, 0x10
nop
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x4c]
cmp eax, dword [edx + 0x24]
jb 0x40ace9
jmp 0x40ad84
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x4c]
add eax, dword [edx + 0x30]
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x54]
cmp dword [eax], 0x6e696268
je 0x40ad15
sub esp, 8
push dword [ebp - 0x4c]
push 0x40a7f0
call fcn.0040bb20
add esp, 0x10
jmp 0x40ad84
mov eax, dword [ebp - 0xc]
inc dword [eax + 0x10]
mov eax, dword [ebp - 0x54]
cmp dword [eax + 8], 0
jne 0x40ad2f
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x68], eax
jmp 0x40ae69
mov eax, dword [ebp - 0x4c]
add eax, 0x20
mov dword [ebp - 0x18], eax
mov edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x18]
sub eax, edx
mov edx, eax
mov eax, dword [ebp - 0x54]
cmp edx, dword [eax + 8]
jae 0x40ad74
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
cmp eax, dword [edx + 0x24]
jl 0x40ad57
jmp 0x40ad74
sub esp, 4
push dword [ebp - 0x64]
push dword [ebp - 0x18]
push dword [ebp - 0xc]
call fcn.00405a52
add esp, 0x10
mov edx, eax
lea eax, [ebp - 0x18]
add dword [eax], edx
jmp 0x40ad38
mov eax, dword [ebp - 0x54]
mov edx, dword [eax + 8]
lea eax, [ebp - 0x4c]
add dword [eax], edx
jmp 0x40acd9
mov eax, dword [ebp - 0xc]
push dword [eax + 0x10]
mov eax, dword [ebp - 0xc]
push dword [eax + 0x24]
mov eax, dword [ebp - 0xc]
push dword [eax + 0x24]
push 0x40a850
call fcn.0040bb20
add esp, 0x10
sub esp, 0xc
mov eax, dword [ebp - 0xc]
push dword [eax + 0x20]
mov eax, dword [ebp - 0xc]
push dword [eax + 0x18]
mov eax, dword [ebp - 0xc]
push dword [eax + 0x1c]
mov eax, dword [ebp - 0xc]
push dword [eax + 0x14]
push 0x40a890
call fcn.0040bb20
add esp, 0x20
mov eax, dword [ebp - 0xc]
mov dword [eax + 0xc], 0
push 0
push 0x40a8d1
push 0
push dword [ebp - 0xc]
call fcn.0040701d
add esp, 0x10
test eax, eax
je 0x40adf9
mov eax, dword [ebp - 0xc]
mov dword [eax + 0xc], 1
jmp 0x40ae63
push 0
push 0x40a8d6
push 0
push dword [ebp - 0xc]
call fcn.0040701d
add esp, 0x10
test eax, eax
je 0x40ae1d
mov eax, dword [ebp - 0xc]
mov dword [eax + 0xc], 2
jmp 0x40ae63
push 0
push 0x40a8e2
push 0
push dword [ebp - 0xc]
call fcn.0040701d
add esp, 0x10
test eax, eax
je 0x40ae41
mov eax, dword [ebp - 0xc]
mov dword [eax + 0xc], 3
jmp 0x40ae63
push 0
push 0x40a8ea
push 0
push dword [ebp - 0xc]
call fcn.0040701d
add esp, 0x10
test eax, eax
je 0x40ae63
mov eax, dword [ebp - 0xc]
mov dword [eax + 0xc], 4
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x68], eax
mov eax, dword [ebp - 0x68]
mov ebx, dword [ebp - 4]
leave
ret