Function at 0x487f00
Capabilities:
Read file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x98
cmp dword [rcx], 1
mov r8, qword [rdx]
mov r14, rcx
mov r15, rdx
jle 0x48817d
mov rcx, r8
mov ebx, 1
xor r12d, r12d
mov qword [rsp + 0x48], r8
mov dword [rsp + 0x38], 0x7d0
nop dword [rax]
movsxd rsi, ebx
mov rax, qword [rcx + rsi*8]
lea rbp, [rsi*8]
cmp byte [rax], 0x40
jne 0x488170
sub dword [rsp + 0x38], 1
je 0x488200
lea rdi, [rax + 1]
lea rdx, [rsp + 0x50]
mov rcx, rdi
call qword [sym.imp.msvcrt.dll__stat64]
test eax, eax
js 0x488170
movzx eax, word [rsp + 0x56]
and ax, 0xf000
cmp ax, 0x4000
je 0x48822a
lea rdx, [0x00586e61]
mov rcx, rdi
call sub.msvcrt.dll_fopen
test rax, rax
mov rdi, rax
je 0x488170
xor edx, edx
mov r8d, 2
mov rcx, rax
call sub.msvcrt.dll_fseek
cmp eax, 0xffffffff
je 0x4881a8
mov rcx, rdi
call sub.msvcrt.dll_ftell
movsxd r13, eax
cmp r13d, 0xffffffff
je 0x4881a8
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call sub.msvcrt.dll_fseek
cmp eax, 0xffffffff
je 0x4881a8
lea rcx, [r13 + 1]
call fcn.0048c870
mov edx, 1
mov r9, rdi
mov r8, r13
mov rcx, rax
mov qword [rsp + 0x20], rax
call sub.msvcrt.dll_fread
cmp r13, rax
mov rdx, rax
je 0x488032
mov rcx, rdi
mov qword [rsp + 0x28], rax
call sub.msvcrt.dll_ferror
mov rdx, qword [rsp + 0x28]
test eax, eax
jne 0x488198
mov rax, qword [rsp + 0x20]
mov byte [rax + rdx], 0
mov rdx, rax
movzx eax, byte [rax]
test al, al
jne 0x488060
jmp 0x4881b0
movzx eax, byte [rdx + 1]
add rdx, 1
test al, al
je 0x4881b0
mov rcx, qword [0x0058b0e0]
test byte [rcx + rax*2], 0x40
jne 0x488050
mov rcx, qword [rsp + 0x20]
call fcn.00487bf0
mov rdx, qword [rsp + 0x48]
mov r13, rax
mov rax, qword [r15]
cmp rax, rdx
je 0x4881d1
cmp qword [r13], 0
je 0x4881e3
xor edx, edx
nop dword [rax + rax]
add rdx, 1
cmp qword [r13 + rdx*8], 0
jne 0x4880a0
lea rcx, [rdx*8]
mov dword [rsp + 0x3c], edx
mov qword [rsp + 0x28], rcx
lea rcx, [rsi + rdx]
shl rcx, 3
mov qword [rsp + 0x30], rcx
mov rcx, qword [rax + rsi*8]
mov qword [rsp + 0x40], rdx
call fcn.004a6450
movsxd rax, dword [r14]
mov rdx, qword [rsp + 0x40]
mov rcx, qword [r15]
lea rdx, [rdx + rax + 1]
shl rdx, 3
call fcn.0048c8f0
mov edx, dword [r14]
mov rcx, qword [rsp + 0x30]
lea r10, [rax + rbp + 8]
mov qword [r15], rax
sub edx, ebx
movsxd rdx, edx
add rcx, rax
lea r8, [rdx*8]
mov rdx, r10
call sub.msvcrt.dll_memmove
mov rcx, qword [r15]
mov rdx, r13
mov r8, qword [rsp + 0x28]
add rcx, rbp
call sub.msvcrt.dll_memcpy
mov eax, dword [r14]
mov rcx, r13
mov esi, dword [rsp + 0x3c]
lea eax, [rsi + rax - 1]
mov dword [r14], eax
call fcn.004a6450
mov rcx, qword [rsp + 0x20]
call fcn.004a6450
lea ebx, [r12 + 1]
mov rcx, rdi
call sub.msvcrt.dll_fclose
cmp dword [r14], ebx
jle 0x48817d
mov rcx, qword [r15]
jmp 0x487f40
mov r12d, ebx
lea ebx, [r12 + 1]
cmp dword [r14], ebx
jg 0x48815e
add rsp, 0x98
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, qword [rsp + 0x20]
call fcn.004a6450
nop word [rax + rax]
mov r12d, ebx
jmp 0x48814c
mov ecx, 8
call fcn.0048c870
mov rdx, qword [rsp + 0x48]
mov r13, rax
mov qword [rax], 0
mov rax, qword [r15]
cmp rax, rdx
jne 0x4881e3
mov rcx, qword [rsp + 0x48]
call fcn.00487af0
mov qword [r15], rax
jmp 0x48808b
mov qword [rsp + 0x30], rbp
xor edx, edx
mov dword [rsp + 0x3c], 0
mov qword [rsp + 0x28], 0
jmp 0x4880ca
mov rbx, qword [rcx]
mov ecx, 2
call qword [fcn.004a5d20]
lea rdx, str._s:_error:_too_many___files_encountered_n
mov rcx, rax
mov r8, rbx
call sub.msvcrt.dll_fprintf
mov ecx, 1
call fcn.0048c7e0
mov rax, qword [r15]
mov ecx, 2
mov rbx, qword [rax]
call qword [fcn.004a5d20]
lea rdx, str._s:_error:___file_refers_to_a_directory_n
mov rcx, rax
mov r8, rbx
call sub.msvcrt.dll_fprintf
mov ecx, 1
call fcn.0048c7e0
nop
nop dword [rax + rax]
xor eax, eax
test rcx, rcx
je 0x488281
cmp qword [rcx], 0
je 0x488281
mov edx, 1
mov rax, rdx
add rdx, 1
cmp qword [rcx + rdx*8 - 8], 0
jne 0x488272
ret