Function at 0x4a9c30
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 r10, qword [rdx]
mov r14, rcx
mov r15, rdx
jle 0x4a9d7d
mov rcx, r10
mov ebx, 1
xor r12d, r12d
mov qword [rsp + 0x30], r10
mov dword [rsp + 0x40], 0x7d0
jmp 0x4a9d58
sub dword [rsp + 0x40], 1
je 0x4a9f08
lea rdi, [rax + 1]
lea rdx, [rsp + 0x50]
mov rcx, rdi
call qword [sym.imp.msvcrt.dll__stat64]
test eax, eax
js 0x4a9d70
movzx eax, word [rsp + 0x56]
and ax, 0xf000
cmp ax, 0x4000
je 0x4a9f32
lea rdx, [0x004fe8d9]
mov rcx, rdi
call fcn.004c02b8
test rax, rax
mov rdi, rax
je 0x4a9d70
xor edx, edx
mov r8d, 2
mov rcx, rax
call sub.msvcrt.dll_fseek
cmp eax, 0xffffffff
je 0x4a9d40
mov rcx, rdi
call sub.msvcrt.dll_ftell
movsxd r13, eax
cmp r13d, 0xffffffff
je 0x4a9d40
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call sub.msvcrt.dll_fseek
cmp eax, 0xffffffff
je 0x4a9d40
lea rcx, [r13 + 1]
call fcn.004b1090
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 0x4a9d9d
mov rcx, rdi
mov qword [rsp + 0x28], rax
call sub.msvcrt.dll_ferror
test eax, eax
je 0x4a9d98
nop dword [rax]
mov r12d, ebx
lea ebx, [r12 + 1]
mov rcx, rdi
call sub.msvcrt.dll_fclose
cmp dword [r14], ebx
jle 0x4a9d7d
mov rcx, qword [r15]
movsxd rsi, ebx
mov rax, qword [rcx + rsi*8]
lea rbp, [rsi*8]
cmp byte [rax], 0x40
je 0x4a9c78
mov r12d, ebx
lea ebx, [r12 + 1]
cmp dword [r14], ebx
jg 0x4a9d55
add rsp, 0x98
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rdx, qword [rsp + 0x28]
mov rax, qword [rsp + 0x20]
mov byte [rax + rdx], 0
mov rdx, rax
movzx eax, byte [rax]
test al, al
jne 0x4a9dc8
jmp 0x4a9eb8
movzx eax, byte [rdx + 1]
add rdx, 1
test al, al
je 0x4a9eb8
mov rcx, qword [0x00500570]
test byte [rcx + rax*2], 0x40
jne 0x4a9db8
mov rcx, qword [rsp + 0x20]
call fcn.004a9940
mov rdx, qword [rsp + 0x30]
mov r13, rax
mov rax, qword [r15]
cmp rax, rdx
je 0x4a9ed9
cmp qword [r13], 0
je 0x4a9eeb
xor edx, edx
add rdx, 1
cmp qword [r13 + rdx*8], 0
jne 0x4a9e00
lea rcx, [rdx*8]
mov dword [rsp + 0x44], edx
mov qword [rsp + 0x28], rcx
lea rcx, [rsi + rdx]
shl rcx, 3
mov qword [rsp + 0x38], rcx
mov rcx, qword [rax + rsi*8]
mov qword [rsp + 0x48], rdx
call fcn.004c02e0
movsxd rax, dword [r14]
mov rdx, qword [rsp + 0x48]
mov rcx, qword [r15]
lea rdx, [rdx + rax + 1]
shl rdx, 3
call fcn.004b1110
mov edx, dword [r14]
mov rcx, qword [rsp + 0x38]
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 + 0x44]
lea eax, [rsi + rax - 1]
mov dword [r14], eax
call fcn.004c02e0
mov rcx, qword [rsp + 0x20]
call fcn.004c02e0
jmp 0x4a9d43
mov ecx, 8
call fcn.004b1090
mov rdx, qword [rsp + 0x30]
mov r13, rax
mov qword [rax], 0
mov rax, qword [r15]
cmp rax, rdx
jne 0x4a9eeb
mov rcx, qword [rsp + 0x30]
call fcn.004a9840
mov qword [r15], rax
jmp 0x4a9df3
mov qword [rsp + 0x38], rbp
xor edx, edx
mov dword [rsp + 0x44], 0
mov qword [rsp + 0x28], 0
jmp 0x4a9e2a
mov rbx, qword [rcx]
mov ecx, 2
call qword [fcn.004bfbf0]
lea rdx, str._s:_error:_too_many___files_encountered_n
mov rcx, rax
mov r8, rbx
call fcn.004a9810
mov ecx, 1
call fcn.004b0fd0
mov rax, qword [r15]
mov ecx, 2
mov rbx, qword [rax]
call qword [fcn.004bfbf0]
lea rdx, str._s:_error:___file_refers_to_a_directory_n
mov rcx, rax
mov r8, rbx
call fcn.004a9810
mov ecx, 1
call fcn.004b0fd0
nop
xor eax, eax
test rcx, rcx
je 0x4a9f81
cmp qword [rcx], 0
je 0x4a9f81
mov edx, 1
mov rax, rdx
add rdx, 1
cmp qword [rcx + rdx*8 - 8], 0
jne 0x4a9f72
ret