Function at 0x14005c780
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 0x14005c9fd
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 0x14005c9f0
sub dword [rsp + 0x38], 1
je 0x14005ca80
lea rdi, [rax + 1]
lea rdx, [rsp + 0x50]
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__stat64]
test eax, eax
js 0x14005c9f0
movzx eax, word [rsp + 0x56]
and ax, 0xf000
cmp ax, 0x4000
je 0x14005caaa
lea rdx, [0x14010ba61]
mov rcx, rdi
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fopen
test rax, rax
mov rdi, rax
je 0x14005c9f0
xor edx, edx
mov r8d, 2
mov rcx, rax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fseek
cmp eax, 0xffffffff
je 0x14005ca28
mov rcx, rdi
call sub.api_ms_win_crt_stdio_l1_1_0.dll_ftell
movsxd r13, eax
cmp r13d, 0xffffffff
je 0x14005ca28
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fseek
cmp eax, 0xffffffff
je 0x14005ca28
lea rcx, [r13 + 1]
call fcn.1400657f0
mov edx, 1
mov r9, rdi
mov r8, r13
mov rcx, rax
mov qword [rsp + 0x20], rax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fread
cmp r13, rax
mov rdx, rax
je 0x14005c8b2
mov rcx, rdi
mov qword [rsp + 0x28], rax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_ferror
mov rdx, qword [rsp + 0x28]
test eax, eax
jne 0x14005ca18
mov rax, qword [rsp + 0x20]
mov byte [rax + rdx], 0
mov rdx, rax
movzx eax, byte [rax]
test al, al
jne 0x14005c8e0
jmp 0x14005ca30
movzx eax, byte [rdx + 1]
add rdx, 1
test al, al
je 0x14005ca30
mov rcx, qword [0x1401e05e0]
test byte [rcx + rax*2], 0x40
jne 0x14005c8d0
mov rcx, qword [rsp + 0x20]
call fcn.14005c470
mov rdx, qword [rsp + 0x48]
mov r13, rax
mov rax, qword [r15]
cmp rax, rdx
je 0x14005ca51
cmp qword [r13], 0
je 0x14005ca63
xor edx, edx
nop dword [rax + rax]
add rdx, 1
cmp qword [r13 + rdx*8], 0
jne 0x14005c920
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.140088000
movsxd rax, dword [r14]
mov rdx, qword [rsp + 0x40]
mov rcx, qword [r15]
lea rdx, [rdx + rax + 1]
shl rdx, 3
call fcn.140065870
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.api_ms_win_crt_private_l1_1_0.dll_memmove
mov rcx, qword [r15]
mov rdx, r13
mov r8, qword [rsp + 0x28]
add rcx, rbp
call sub.api_ms_win_crt_private_l1_1_0.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.140088000
mov rcx, qword [rsp + 0x20]
call fcn.140088000
lea ebx, [r12 + 1]
mov rcx, rdi
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fclose
cmp dword [r14], ebx
jle 0x14005c9fd
mov rcx, qword [r15]
jmp 0x14005c7c0
mov r12d, ebx
lea ebx, [r12 + 1]
cmp dword [r14], ebx
jg 0x14005c9de
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.140088000
nop word [rax + rax]
mov r12d, ebx
jmp 0x14005c9cc
mov ecx, 8
call fcn.1400657f0
mov rdx, qword [rsp + 0x48]
mov r13, rax
mov qword [rax], 0
mov rax, qword [r15]
cmp rax, rdx
jne 0x14005ca63
mov rcx, qword [rsp + 0x48]
call fcn.14005c370
mov qword [r15], rax
jmp 0x14005c90b
mov qword [rsp + 0x30], rbp
xor edx, edx
mov dword [rsp + 0x3c], 0
mov qword [rsp + 0x28], 0
jmp 0x14005c94a
mov rbx, qword [rcx]
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
lea rdx, str._s:_error:_too_many___files_encountered_n
mov rcx, rax
mov r8, rbx
call fcn.14005c340
mov ecx, 1
call fcn.140065730
mov rax, qword [r15]
mov ecx, 2
mov rbx, qword [rax]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
lea rdx, str._s:_error:___file_refers_to_a_directory_n
mov rcx, rax
mov r8, rbx
call fcn.14005c340
mov ecx, 1
call fcn.140065730
nop
nop dword [rax + rax]
xor eax, eax
test rcx, rcx
je 0x14005cb01
cmp qword [rcx], 0
je 0x14005cb01
mov edx, 1
mov rax, rdx
add rdx, 1
cmp qword [rcx + rdx*8 - 8], 0
jne 0x14005caf2
ret