Function at 0x6524738d
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x6c
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x1c], 0xffffffff
mov dword [esp + 4], 0x1c
mov dword [esp], 1
call sym._calloc
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jne 0x652473e0
mov dword [esp + 4], 0x1c
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.libmagic_1.dll_file_oomem
jmp 0x652475b4
mov eax, dword [ebp - 0x28]
mov dword [eax + 8], 0
mov dword [esp + 8], 0
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._mkdbname
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x652475ad
mov dword [esp + 4], 0x8000
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._open
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
je 0x652475b0
lea eax, [ebp - 0x58]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll__fstati64]
call eax
cmp eax, 0xffffffff
jne 0x65247476
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov edx, dword [ebp - 0x20]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x65268e7b
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.libmagic_1.dll_file_error
jmp 0x652475b4
mov eax, dword [ebp - 0x40]
mov edx, dword [ebp - 0x3c]
mov ebx, 7
mov ecx, 0
cmp ebx, eax
sbb ecx, edx
jge 0x6524749f
mov esi, dword [ebp - 0x40]
mov edi, dword [ebp - 0x3c]
call sym._maxoff_t
cmp eax, esi
mov eax, edx
sbb eax, edi
jge 0x652474ec
mov eax, dword [ebp - 0x40]
mov edx, dword [ebp - 0x3c]
mov ebx, 7
mov ecx, 0
cmp ebx, eax
sbb ecx, edx
jl 0x652474bc
mov eax, str.small
jmp 0x652474c1
mov eax, str.large
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.file___s_is_too__s
mov dword [esp + 4], 0
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.libmagic_1.dll_file_error
jmp 0x652475b4
mov eax, dword [ebp - 0x40]
mov edx, dword [ebp - 0x3c]
mov edx, eax
mov eax, dword [ebp - 0x28]
mov dword [eax + 4], edx
mov eax, dword [ebp - 0x28]
mov dword [eax + 8], 1
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 4]
mov dword [esp], eax
call sym._malloc
mov edx, eax
mov eax, dword [ebp - 0x28]
mov dword [eax], edx
mov eax, dword [ebp - 0x28]
mov eax, dword [eax]
test eax, eax
jne 0x65247539
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 4]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.libmagic_1.dll_file_oomem
jmp 0x652475b4
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 4]
mov eax, dword [ebp - 0x28]
mov eax, dword [eax]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._read
mov edx, dword [ebp - 0x28]
mov edx, dword [edx + 4]
cmp eax, edx
je 0x6524756e
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.libmagic_1.dll_file_badread
jmp 0x652475b4
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._close
mov dword [ebp - 0x1c], 0xffffffff
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._check_buffer
test eax, eax
jne 0x652475b3
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x28]
jmp 0x652475de
nop
jmp 0x652475b4
nop
jmp 0x652475b4
nop
cmp dword [ebp - 0x1c], 0xffffffff
je 0x652475c5
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._close
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call sym._apprentice_unmap
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x24]
add esp, 0x6c
pop ebx
pop esi
pop edi
pop ebp
ret