Function at 0x65241c55
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x8c
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x30], 0xffffffff
mov dword [ebp - 0x2c], 0xffffffff
mov dword [esp + 4], 1
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.libmagic_1.dll_file_reset
cmp eax, 0xffffffff
je 0x652420b0
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0xdc]
add eax, 0x81
mov dword [esp], eax
call sym._malloc
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
jne 0x65241cd0
mov eax, 0
jmp 0x652420cc
lea eax, [ebp - 0x70]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.libmagic_1.dll_file_fsmagic
cmp eax, 0xffffffff
je 0x6524203a
test eax, eax
je 0x65241d02
mov dword [ebp - 0x1c], 0
jmp 0x65242044
nop
cmp dword [ebp + 0x10], 0
jne 0x65241d1f
mov dword [esp + 4], 0x8000
mov dword [esp], 0
mov eax, dword [sym.imp.msvcrt.dll__setmode]
call eax
cmp dword [ebp + 0xc], 0
je 0x65241df4
mov dword [ebp - 0x38], 0x8000
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov dword [eax], 0
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sym._open
mov dword [ebp + 0x10], eax
cmp dword [ebp + 0x10], 0
jns 0x65241df4
lea eax, [ebp - 0x70]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll__stati64]
call eax
test eax, eax
sete al
movzx eax, al
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
je 0x65241d9b
movzx eax, word [ebp - 0x6a]
movzx eax, ax
and eax, 0xf000
cmp eax, 0x1000
jne 0x65241d9b
mov dword [ebp - 0x24], 1
cmp dword [ebp - 0x28], 0
jne 0x65241dbc
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
cmp eax, 0xd
jne 0x65241dbc
mov word [ebp - 0x6a], 0x3000
mov dword [ebp - 0x28], 1
cmp dword [ebp - 0x28], 0
je 0x65241de8
movzx eax, word [ebp - 0x6a]
movzx eax, ax
mov edx, dword [ebp + 0xc]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._unreadable_info
cmp eax, 0xffffffff
je 0x6524203d
mov dword [ebp - 0x1c], 0
jmp 0x65242044
cmp dword [ebp + 0x10], 0xffffffff
je 0x65241e68
lea eax, [ebp - 0x70]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll__fstati64]
call eax
test eax, eax
sete al
movzx eax, al
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
je 0x65241e39
movzx eax, word [ebp - 0x6a]
movzx eax, ax
and eax, 0xf000
cmp eax, 0x1000
jne 0x65241e39
mov dword [ebp - 0x24], 1
cmp dword [ebp + 0xc], 0
jne 0x65241e68
mov dword [esp + 0xc], 1
mov dword [esp + 4], 0
mov dword [esp + 8], 0
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call dbg.lseek64
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], edx
cmp dword [ebp - 0x24], 0
je 0x65241f13
cmp dword [ebp + 0x10], 0xffffffff
je 0x65241ecd
mov dword [ebp - 0x40], 0
jmp 0x65241e90
mov eax, dword [ebp - 0x40]
add dword [ebp - 0x20], eax
cmp dword [ebp - 0x40], 0x1ff
jle 0x65241ecc
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0xdc]
mov eax, dword [ebp - 0x20]
sub edx, eax
mov ecx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x34]
add eax, ecx
mov dword [esp + 0xc], 1
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call sym.libmagic_1.dll_sread
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0
jg 0x65241e81
jmp 0x65241ecd
nop
cmp dword [ebp - 0x20], 0
jne 0x65241fd1
cmp dword [ebp + 0xc], 0
je 0x65241fd1
movzx eax, word [ebp - 0x6a]
movzx eax, ax
mov edx, dword [ebp + 0xc]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._unreadable_info
cmp eax, 0xffffffff
je 0x65242040
mov dword [ebp - 0x1c], 0
jmp 0x65242044
cmp dword [ebp + 0x10], 0xffffffff
je 0x65241fd1
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll__isatty]
call eax
test eax, eax
jne 0x65241f39
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0xdc]
jmp 0x65241f3e
mov eax, 0x2000
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x34]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call sym._read
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0xffffffff
jne 0x65241fd1
cmp dword [ebp + 0xc], 0
jne 0x65241f9b
cmp dword [ebp + 0x10], 0
je 0x65241f9b
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov edx, dword [ebp + 0x10]
mov dword [esp + 0xc], edx
mov dword [esp + 8], str.cannot_read_fd__d
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.libmagic_1.dll_file_error
jmp 0x65242044
cmp dword [ebp + 0xc], 0
je 0x65241fa6
mov ebx, dword [ebp + 0xc]
jmp 0x65241fab
mov ebx, str._dev_stdin
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], str.cannot_read___s
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.libmagic_1.dll_file_error
jmp 0x65242044
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x34]
add eax, edx
mov dword [esp + 8], 0x81
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._memset
mov edx, dword [ebp - 0x20]
cmp dword [ebp - 0x28], 0
je 0x65241fff
lea eax, [ebp - 0x70]
jmp 0x65242004
mov eax, 0
mov dword [esp + 0x14], edx
mov edx, dword [ebp - 0x34]
mov dword [esp + 0x10], edx
mov edx, dword [ebp + 0xc]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.libmagic_1.dll_file_buffer
cmp eax, 0xffffffff
je 0x65242043
mov dword [ebp - 0x1c], 0
jmp 0x65242044
nop
jmp 0x65242044
nop
jmp 0x65242044
nop
jmp 0x65242044
nop
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call sym._free
cmp dword [ebp + 0x10], 0xffffffff
je 0x652420b3
mov eax, dword [ebp - 0x30]
xor eax, 0xffffffff
mov esi, eax
mov eax, dword [ebp - 0x2c]
xor eax, 0xffffffff
mov edi, eax
mov eax, edi
or eax, esi
test eax, eax
je 0x6524208e
mov dword [esp + 0xc], 0
mov eax, dword [ebp - 0x30]
mov edx, dword [ebp - 0x2c]
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call dbg.lseek64
lea eax, [ebp - 0x70]
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._close_and_restore
jmp 0x652420b4
nop
jmp 0x652420b4
nop
cmp dword [ebp - 0x1c], 0
jne 0x652420c7
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.libmagic_1.dll_file_getbuffer
jmp 0x652420cc
mov eax, 0
add esp, 0x8c
pop ebx
pop esi
pop edi
pop ebp
ret