Function at 0x280a6f3b
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
mov eax, dword [ebp + 8]
push esi
cmp eax, 0x800
push edi
jae 0x280a71a3
mov edi, eax
and eax, 0x1f
sar edi, 5
lea esi, [eax + eax*8]
mov eax, dword [sym.imp.MSVCRT.dll___pioinfo]
shl edi, 2
shl esi, 2
mov eax, dword [edi + eax]
add eax, esi
test byte [eax + 4], 1
je 0x280a71a3
cmp dword [eax + 8], 0
je 0x280a6f86
add eax, 0xc
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
and dword [ebp - 8], 0
cmp dword [ebp + 0x10], 0
push ebx
mov ebx, dword [ebp + 0xc]
mov ecx, ebx
je 0x280a7183
mov eax, dword [sym.imp.MSVCRT.dll___pioinfo]
mov eax, dword [edi + eax]
add eax, esi
mov dl, byte [eax + 4]
test dl, 2
jne 0x280a7183
test dl, 0x48
je 0x280a6fd8
mov al, byte [eax + 5]
cmp al, 0xa
je 0x280a6fd8
dec dword [ebp + 0x10]
mov byte [ebx], al
mov eax, dword [sym.imp.MSVCRT.dll___pioinfo]
lea ecx, [ebx + 1]
mov dword [ebp - 8], 1
mov eax, dword [edi + eax]
mov byte [eax + esi + 5], 0xa
lea eax, [ebp - 0xc]
push 0
push eax
mov eax, dword [sym.imp.MSVCRT.dll___pioinfo]
push dword [ebp + 0x10]
mov eax, dword [edi + eax]
push ecx
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x280a7032
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop ebx
cmp eax, ebx
jne 0x280a7021
call dword [sym.imp.MSVCRT.dll__errno]
mov dword [eax], 9
call dword [sym.imp.MSVCRT.dll___doserrno]
or dword [ebp - 8], 0xffffffff
mov dword [eax], ebx
jmp 0x280a7183
xor ecx, ecx
cmp eax, 0x6d
sete cl
dec ecx
mov dword [ebp - 8], ecx
jmp 0x280a7183
mov eax, dword [ebp - 0xc]
add dword [ebp - 8], eax
mov eax, dword [sym.imp.MSVCRT.dll___pioinfo]
mov eax, dword [edi + eax]
lea ecx, [eax + esi + 4]
mov al, byte [eax + esi + 4]
test al, 0x80
je 0x280a7183
and al, 0xfb
mov byte [ecx], al
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 8]
mov dword [ebp + 0x10], eax
add ecx, eax
cmp eax, ecx
mov dword [ebp - 8], ecx
jae 0x280a717d
mov eax, dword [ebp + 0x10]
mov al, byte [eax]
cmp al, 0x1a
je 0x280a7165
cmp al, 0xd
je 0x280a7086
mov byte [ebx], al
inc ebx
inc dword [ebp + 0x10]
jmp 0x280a7157
dec ecx
cmp dword [ebp + 0x10], ecx
jae 0x280a70a7
mov eax, dword [ebp + 0x10]
inc eax
cmp byte [eax], 0xa
jne 0x280a709b
add dword [ebp + 0x10], 2
jmp 0x280a70f1
mov byte [ebx], 0xd
inc ebx
mov dword [ebp + 0x10], eax
jmp 0x280a7157
lea eax, [ebp - 0xc]
push 0
push eax
lea eax, [ebp - 1]
push 1
push eax
mov eax, dword [sym.imp.MSVCRT.dll___pioinfo]
inc dword [ebp + 0x10]
mov eax, dword [edi + eax]
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x280a70d5
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x280a7153
cmp dword [ebp - 0xc], 0
je 0x280a7153
mov eax, dword [sym.imp.MSVCRT.dll___pioinfo]
mov eax, dword [edi + eax]
test byte [eax + esi + 4], 0x48
je 0x280a7109
mov al, byte [ebp - 1]
cmp al, 0xa
jne 0x280a70f6
mov byte [ebx], 0xa
jmp 0x280a7156
mov byte [ebx], 0xd
mov ecx, dword [sym.imp.MSVCRT.dll___pioinfo]
inc ebx
mov ecx, dword [edi + ecx]
mov byte [ecx + esi + 5], al
jmp 0x280a7157
cmp byte [ebp - 1], 0xa
jne 0x280a7126
mov byte [ebx], 0xa
mov eax, dword [sym.imp.MSVCRT.dll___pioinfo]
inc ebx
mov eax, dword [edi + eax]
or byte [eax + esi + 4], 4
lea eax, [eax + esi + 4]
jmp 0x280a7157
push dword [ebp + 8]
call dword [sym.imp.MSVCRT.dll__get_osfhandle]
cmp eax, 0xffffffff
pop ecx
je 0x280a714d
push 1
push 0
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x280a714d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp byte [ebp - 1], 0xa
je 0x280a7157
mov byte [ebx], 0xd
inc ebx
mov ecx, dword [ebp - 8]
cmp dword [ebp + 0x10], ecx
jb 0x280a706a
jmp 0x280a717d
mov eax, dword [sym.imp.MSVCRT.dll___pioinfo]
mov eax, dword [edi + eax]
lea ecx, [eax + esi + 4]
mov al, byte [eax + esi + 4]
test al, 0x40
jne 0x280a717d
or al, 2
mov byte [ecx], al
sub ebx, dword [ebp + 0xc]
mov dword [ebp - 8], ebx
mov eax, dword [sym.imp.MSVCRT.dll___pioinfo]
pop ebx
mov eax, dword [edi + eax]
add esi, eax
cmp dword [esi + 8], 0
je 0x280a719e
add esi, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 8]
jmp 0x280a71bb
call dword [sym.imp.MSVCRT.dll__errno]
mov dword [eax], 9
call dword [sym.imp.MSVCRT.dll___doserrno]
and dword [eax], 0
or eax, 0xffffffff
pop edi
pop esi
leave
ret