Function at 0x140065aa0
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 r9, qword [rdx]
mov rbp, rcx
mov r15, rdx
jle 0x140065d1d
mov qword [rsp + 0x48], r9
mov r13d, 1
mov rcx, r9
xor edi, edi
mov dword [rsp + 0x40], 0x7d0
mov r12d, r13d
movsxd rbx, r12d
mov rax, qword [rcx + rbx*8]
lea r14, [rbx*8]
cmp byte [rax], 0x40
jne 0x140065d10
sub dword [rsp + 0x40], 1
je 0x140065d9b
lea rsi, [rax + 1]
lea rdx, [rsp + 0x50]
mov rcx, rsi
call qword [sym.imp.msvcrt.dll__stat64]
test eax, eax
js 0x140065d10
movzx eax, word [rsp + 0x56]
and ax, 0xf000
cmp ax, 0x4000
je 0x140065dc5
mov rcx, rsi
lea rdx, [0x1400fb4e1]
call sym.fopen
mov rsi, rax
test rax, rax
je 0x140065d10
xor edx, edx
mov r8d, 2
mov rcx, rax
call sym.fseek
cmp eax, 0xffffffff
je 0x140065d48
mov rcx, rsi
call sym.ftell
movsxd r13, eax
cmp r13d, 0xffffffff
je 0x140065d48
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call sym.fseek
cmp eax, 0xffffffff
je 0x140065d48
lea rcx, [r13 + 1]
call sym.xmalloc
mov edx, 1
mov r9, rsi
mov r8, r13
mov rcx, rax
mov qword [rsp + 0x20], rax
call sym.fread
mov rdx, rax
cmp r13, rax
je 0x140065bd2
mov rcx, rsi
mov qword [rsp + 0x28], rax
call sym.ferror
mov rdx, qword [rsp + 0x28]
test eax, eax
jne 0x140065d38
mov rax, qword [rsp + 0x20]
mov byte [rax + rdx], 0
mov rdx, rax
movzx eax, byte [rax]
test al, al
jne 0x140065c00
jmp 0x140065d50
movzx eax, byte [rdx + 1]
add rdx, 1
test al, al
je 0x140065d50
mov rcx, qword [0x1400ff4a0]
test byte [rcx + rax*2], 0x40
jne 0x140065bf0
mov rcx, qword [rsp + 0x20]
call sym.buildargv
mov rdx, qword [rsp + 0x48]
mov r13, rax
mov rax, qword [r15]
cmp rax, rdx
je 0x140065d71
cmp qword [r13], 0
je 0x140065d83
xor edx, edx
nop dword [rax + rax]
add rdx, 1
cmp qword [r13 + rdx*8], 0
jne 0x140065c40
lea rcx, [rdx*8]
mov r11d, edx
mov qword [rsp + 0x28], rcx
lea rcx, [rbx + rdx]
shl rcx, 3
mov qword [rsp + 0x30], rcx
mov rcx, qword [rax + rbx*8]
mov dword [rsp + 0x44], r11d
mov qword [rsp + 0x38], rdx
call sym.free
movsxd rax, dword [rbp]
mov rdx, qword [rsp + 0x38]
mov rcx, qword [r15]
lea rdx, [rdx + rax + 1]
shl rdx, 3
call sym.xrealloc
mov edx, dword [rbp]
mov rcx, qword [rsp + 0x30]
mov qword [r15], rax
lea r10, [rax + r14 + 8]
sub edx, r12d
add rcx, rax
movsxd rdx, edx
lea r8, [rdx*8]
mov rdx, r10
call sym.memmove
mov rcx, qword [r15]
mov r8, qword [rsp + 0x28]
mov rdx, r13
add rcx, r14
call sym.memcpy
mov eax, dword [rbp]
mov r11d, dword [rsp + 0x44]
mov rcx, r13
lea eax, [r11 + rax - 1]
mov dword [rbp], eax
call sym.free
mov rcx, qword [rsp + 0x20]
call sym.free
mov rcx, rsi
lea r12d, [rdi + 1]
call sym.fclose
cmp dword [rbp], r12d
jle 0x140065d1d
mov rcx, qword [r15]
jmp 0x140065ae0
mov edi, r12d
lea r12d, [rdi + 1]
cmp dword [rbp], r12d
jg 0x140065d06
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 sym.free
nop word [rax + rax]
mov edi, r12d
jmp 0x140065cf4
mov ecx, 8
call sym.xmalloc
mov rdx, qword [rsp + 0x48]
mov qword [rax], 0
mov r13, rax
mov rax, qword [r15]
cmp rax, rdx
jne 0x140065d83
mov rcx, qword [rsp + 0x48]
call sym.dupargv
mov qword [r15], rax
jmp 0x140065c2b
mov qword [rsp + 0x30], r14
xor r11d, r11d
xor edx, edx
mov qword [rsp + 0x28], 0
jmp 0x140065c69
mov rbx, qword [rcx]
mov ecx, 2
call qword [sym.__acrt_iob_func]
lea rdx, str._s:_error:_too_many___files_encountered_n
mov rcx, rax
mov r8, rbx
call sym.fprintf
mov ecx, 1
call sym.xexit
mov rax, qword [r15]
mov ecx, 2
mov rbx, qword [rax]
call qword [sym.__acrt_iob_func]
lea rdx, str._s:_error:___file_refers_to_a_directory_n
mov rcx, rax
mov r8, rbx
call sym.fprintf
mov ecx, 1
call sym.xexit
nop
nop word cs:[rax + rax]
nop