Function at 0x40aa60
Capabilities:
Read file on windows

Disassembly:
push edi
mov edi, esp
sub esp, 0x14
push ebp
push esi
push ebx
mov ebp, dword [edi + 8]
mov eax, dword [0x4170bc]
cmp ebp, eax
jae 0x40aa8d
mov eax, ebp
and eax, 0x1f
mov edx, ebp
sar edx, 5
mov edx, dword [edx*4 + 0x4170c0]
test byte [edx + eax*8 + 4], 1
jne 0x40aa9f
mov dword [0x415c84], 9
or eax, 0xffffffff
jmp 0x40ad98
xor ebx, ebx
mov eax, dword [edi + 0xc]
mov dword [edi - 0xc], eax
cmp dword [edi + 0x10], 0
je 0x40aac5
mov eax, ebp
and eax, 0x1f
mov edx, ebp
sar edx, 5
mov edx, dword [edx*4 + 0x4170c0]
test byte [edx + eax*8 + 4], 2
je 0x40aacc
xor eax, eax
jmp 0x40ad98
mov eax, ebp
and eax, 0x1f
mov edx, ebp
sar edx, 5
mov edx, dword [edx*4 + 0x4170c0]
lea eax, [edx + eax*8]
test byte [eax + 4], 0x48
je 0x40ab26
cmp byte [eax + 5], 0xa
je 0x40ab26
mov eax, dword [edi - 0xc]
lea edx, [eax + 1]
mov dword [edi - 0xc], edx
mov edx, ebp
and edx, 0x1f
mov ecx, ebp
sar ecx, 5
mov ecx, dword [ecx*4 + 0x4170c0]
mov dl, byte [ecx + edx*8 + 5]
mov byte [eax], dl
inc ebx
dec dword [edi + 0x10]
mov eax, ebp
and eax, 0x1f
mov edx, ebp
sar edx, 5
mov edx, dword [edx*4 + 0x4170c0]
mov byte [edx + eax*8 + 5], 0xa
push 0
lea eax, [edi - 4]
push eax
mov eax, dword [edi + 0x10]
push eax
mov eax, dword [edi - 0xc]
push eax
mov eax, ebp
and eax, 0x1f
mov edx, ebp
sar edx, 5
mov edx, dword [edx*4 + 0x4170c0]
mov eax, dword [edx + eax*8]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40ab92
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi - 0x10], eax
cmp eax, 5
jne 0x40ab73
mov dword [0x415c84], 9
or eax, 0xffffffff
jmp 0x40ad98
cmp dword [edi - 0x10], 0x6d
jne 0x40ab80
xor eax, eax
jmp 0x40ad98
mov eax, dword [edi - 0x10]
push eax
call fcn.00408c30
pop ecx
or eax, 0xffffffff
jmp 0x40ad98
mov eax, dword [edi - 4]
add ebx, eax
mov eax, ebp
and eax, 0x1f
mov edx, ebp
sar edx, 5
mov edx, dword [edx*4 + 0x4170c0]
test byte [edx + eax*8 + 4], 0x80
je 0x40ad96
cmp dword [edi - 4], 0
je 0x40abdb
mov eax, dword [edi + 0xc]
cmp byte [eax], 0xa
jne 0x40abdb
mov eax, ebp
and eax, 0x1f
mov edx, ebp
sar edx, 5
mov edx, dword [edx*4 + 0x4170c0]
lea eax, [edx + eax*8 + 4]
or byte [eax], 4
jmp 0x40abf8
mov eax, ebp
and eax, 0x1f
mov edx, ebp
sar edx, 5
mov edx, dword [edx*4 + 0x4170c0]
lea eax, [edx + eax*8 + 4]
movzx edx, byte [eax]
and edx, 0xfffffffb
mov byte [eax], dl
mov eax, dword [edi + 0xc]
mov dword [edi - 8], eax
mov esi, eax
jmp 0x40ad7f
cmp byte [esi], 0x1a
jne 0x40ac43
mov eax, ebp
and eax, 0x1f
mov edx, ebp
sar edx, 5
mov edx, dword [edx*4 + 0x4170c0]
test byte [edx + eax*8 + 4], 0x40
jne 0x40ad8c
mov eax, ebp
and eax, 0x1f
mov edx, ebp
sar edx, 5
mov edx, dword [edx*4 + 0x4170c0]
lea eax, [edx + eax*8 + 4]
or byte [eax], 2
jmp 0x40ad8c
cmp byte [esi], 0xd
je 0x40ac5d
mov eax, dword [edi - 8]
lea edx, [eax + 1]
mov dword [edi - 8], edx
mov edx, esi
inc esi
mov dl, byte [edx]
mov byte [eax], dl
jmp 0x40ad7f
mov eax, dword [edi + 0xc]
lea eax, [eax + ebx - 1]
cmp esi, eax
jae 0x40ac97
cmp byte [esi + 1], 0xa
jne 0x40ac82
add esi, 2
mov eax, dword [edi - 8]
lea edx, [eax + 1]
mov dword [edi - 8], edx
mov byte [eax], 0xa
jmp 0x40ad7f
mov eax, dword [edi - 8]
lea edx, [eax + 1]
mov dword [edi - 8], edx
mov edx, esi
inc esi
mov dl, byte [edx]
mov byte [eax], dl
jmp 0x40ad7f
inc esi
mov dword [edi - 0x10], 0
push 0
lea eax, [edi - 4]
push eax
push 1
lea eax, [edi - 0x11]
push eax
mov eax, ebp
and eax, 0x1f
mov edx, ebp
sar edx, 5
mov edx, dword [edx*4 + 0x4170c0]
mov eax, dword [edx + eax*8]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40acd3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi - 0x10], eax
cmp dword [edi - 0x10], 0
jne 0x40acdf
cmp dword [edi - 4], 0
jne 0x40acf0
mov eax, dword [edi - 8]
lea edx, [eax + 1]
mov dword [edi - 8], edx
mov byte [eax], 0xd
jmp 0x40ad7f
mov eax, ebp
and eax, 0x1f
mov edx, ebp
sar edx, 5
mov edx, dword [edx*4 + 0x4170c0]
test byte [edx + eax*8 + 4], 0x48
je 0x40ad42
cmp byte [edi - 0x11], 0xa
jne 0x40ad1c
mov eax, dword [edi - 8]
lea edx, [eax + 1]
mov dword [edi - 8], edx
mov byte [eax], 0xa
jmp 0x40ad7f
mov eax, dword [edi - 8]
lea edx, [eax + 1]
mov dword [edi - 8], edx
mov byte [eax], 0xd
mov eax, ebp
and eax, 0x1f
mov edx, ebp
sar edx, 5
mov edx, dword [edx*4 + 0x4170c0]
mov cl, byte [edi - 0x11]
mov byte [edx + eax*8 + 5], cl
jmp 0x40ad7f
mov eax, dword [edi - 8]
mov edx, dword [edi + 0xc]
cmp eax, edx
jne 0x40ad60
cmp byte [edi - 0x11], 0xa
jne 0x40ad60
mov eax, dword [edi - 8]
lea edx, [eax + 1]
mov dword [edi - 8], edx
mov byte [eax], 0xa
jmp 0x40ad7f
push 1
push 0xffffffffffffffff
push ebp
call fcn.00409fd0
add esp, 0xc
cmp byte [edi - 0x11], 0xa
je 0x40ad7f
mov eax, dword [edi - 8]
lea edx, [eax + 1]
mov dword [edi - 8], edx
mov byte [eax], 0xd
mov eax, dword [edi + 0xc]
add eax, ebx
cmp esi, eax
jb 0x40ac05
mov eax, dword [edi - 8]
mov edx, dword [edi + 0xc]
sub eax, edx
mov ebx, eax
mov eax, ebx
pop ebx
pop esi
pop ebp
mov esp, edi
pop edi
ret