Function at 0x1400cb986
Capabilities:
Read file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x88
mov rax, qword [rdx]
mov rbx, rdx
xor edx, edx
mov qword [rsp + 0x30], rax
mov r12, rcx
mov dword [rsp + 0x3c], 0x7d0
mov dword [rsp + 0x38], edx
mov eax, dword [rsp + 0x38]
lea r15d, [rax + 1]
cmp dword [r12], r15d
jle 0x1400cbc16
mov rax, qword [rbx]
movsxd r13, r15d
lea rdi, [r13*8]
mov rsi, qword [rax + r13*8]
cmp byte [rsi], 0x40
jne 0x1400cbc0c
dec dword [rsp + 0x3c]
jne 0x1400cba0c
mov r8, qword [rax]
mov ecx, 2
mov qword [rsp + 0x20], r8
call qword [fcn.1400e7db0]
mov r8, qword [rsp + 0x20]
lea rdx, str._s:_error:_too_many___files_encountered_n
mov rcx, rax
jmp 0x1400cba59
inc rsi
lea rdx, [rsp + 0x48]
mov rcx, rsi
call qword [sym.imp.msvcrt.dll__stat64]
test eax, eax
js 0x1400cbc0c
mov ax, word [rsp + 0x4e]
and ax, 0xf000
cmp ax, 0x4000
jne 0x1400cba68
mov rax, qword [rbx]
mov ecx, 2
mov r8, qword [rax]
mov qword [rsp + 0x20], r8
call qword [fcn.1400e7db0]
mov r8, qword [rsp + 0x20]
lea rdx, str._s:_error:___file_refers_to_a_directory_n
mov rcx, rax
call fcn.1400cb65e
mov ecx, 1
call fcn.1400d4960
lea rdx, [0x1401d8515]
mov rcx, rsi
call sub.msvcrt.dll_fopen
mov qword [rsp + 0x20], rax
test rax, rax
je 0x1400cbc0c
xor edx, edx
mov r8d, 2
mov rcx, rax
call sub.msvcrt.dll_fseek
inc eax
je 0x1400cbc02
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_ftell
movsxd rsi, eax
cmp esi, 0xffffffff
je 0x1400cbc02
mov rcx, qword [rsp + 0x20]
xor r8d, r8d
xor edx, edx
call sub.msvcrt.dll_fseek
inc eax
je 0x1400cbc02
lea rcx, [rsi + 1]
call fcn.1400d4a13
mov r9, qword [rsp + 0x20]
mov r8, rsi
mov edx, 1
mov rcx, rax
mov qword [rsp + 0x28], rax
call sub.msvcrt.dll_fread
mov rbp, rax
cmp rsi, rax
je 0x1400cbb12
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_ferror
test eax, eax
je 0x1400cbb12
mov rcx, qword [rsp + 0x28]
call sub.msvcrt.dll_free
jmp 0x1400cbc02
mov rax, qword [rsp + 0x28]
mov byte [rax + rbp], 0
mov rdx, rax
movzx eax, byte [rdx]
test al, al
je 0x1400cbb37
mov rsi, qword [0x1401e1c30]
test byte [rsi + rax*2], 0x40
je 0x1400cbb4c
inc rdx
jmp 0x1400cbb1e
mov ecx, 8
call fcn.1400d4a13
mov rbp, rax
xor eax, eax
mov qword [rbp], rax
jmp 0x1400cbb59
mov rcx, qword [rsp + 0x28]
call fcn.1400cb71a
mov rbp, rax
mov rax, qword [rsp + 0x30]
cmp qword [rbx], rax
jne 0x1400cbb6e
mov rcx, rax
call fcn.1400cb680
mov qword [rbx], rax
xor r14d, r14d
cmp qword [rbp + r14*8], 0
je 0x1400cbb7e
inc r14
jmp 0x1400cbb71
mov rax, qword [rbx]
mov rsi, rbp
mov rcx, qword [rax + r13*8]
add r13, r14
call sub.msvcrt.dll_free
movsxd rax, dword [r12]
mov rcx, qword [rbx]
lea rdx, [r14 + rax + 1]
shl rdx, 3
call fcn.1400d4a85
mov edx, dword [r12]
mov qword [rbx], rax
lea r9, [rax + rdi + 8]
lea rcx, [rax + r13*8]
sub edx, r15d
movsxd rdx, edx
lea r8, [rdx*8]
mov rdx, r9
call sub.msvcrt.dll_memmove
mov rax, qword [rbx]
lea rcx, [r14*8]
add rax, rdi
mov rdi, rax
rep movsb byte [rdi], byte [rsi]
mov rcx, rbp
mov eax, dword [r12]
lea eax, [rax + r14 - 1]
mov dword [r12], eax
call sub.msvcrt.dll_free
mov rcx, qword [rsp + 0x28]
call sub.msvcrt.dll_free
mov r15d, dword [rsp + 0x38]
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_fclose
mov dword [rsp + 0x38], r15d
jmp 0x1400cb9b5
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret