Function at 0x4e3f00
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 0x4e404d
mov rcx, r10
mov ebx, 1
xor r12d, r12d
mov qword [rsp + 0x30], r10
mov dword [rsp + 0x40], 0x7d0
jmp 0x4e4028
sub dword [rsp + 0x40], 1
je 0x4e41d8
lea rdi, [rax + 1]
lea rdx, [rsp + 0x50]
mov rcx, rdi
call qword [sym.imp.msvcrt.dll__stat64]
test eax, eax
js 0x4e4040
movzx eax, word [rsp + 0x56]
and ax, 0xf000
cmp ax, 0x4000
je 0x4e4202
lea rdx, [0x005a99b9]
mov rcx, rdi
call sub.msvcrt.dll_fopen
test rax, rax
mov rdi, rax
je 0x4e4040
xor edx, edx
mov r8d, 2
mov rcx, rax
call sub.msvcrt.dll_fseek
cmp eax, 0xffffffff
je 0x4e4010
mov rcx, rdi
call sub.msvcrt.dll_ftell
movsxd r13, eax
cmp r13d, 0xffffffff
je 0x4e4010
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call sub.msvcrt.dll_fseek
cmp eax, 0xffffffff
je 0x4e4010
lea rcx, [r13 + 1]
call fcn.004eb9b0
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 0x4e406d
mov rcx, rdi
mov qword [rsp + 0x28], rax
call sub.msvcrt.dll_ferror
test eax, eax
je 0x4e4068
nop dword [rax]
mov r12d, ebx
lea ebx, [r12 + 1]
mov rcx, rdi
call sub.msvcrt.dll_fclose
cmp dword [r14], ebx
jle 0x4e404d
mov rcx, qword [r15]
movsxd rsi, ebx
mov rax, qword [rcx + rsi*8]
lea rbp, [rsi*8]
cmp byte [rax], 0x40
je 0x4e3f48
mov r12d, ebx
lea ebx, [r12 + 1]
cmp dword [r14], ebx
jg 0x4e4025
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 0x4e4098
jmp 0x4e4188
movzx eax, byte [rdx + 1]
add rdx, 1
test al, al
je 0x4e4188
mov rcx, qword [0x005ab6f0]
test byte [rcx + rax*2], 0x40
jne 0x4e4088
mov rcx, qword [rsp + 0x20]
call fcn.004e3c10
mov rdx, qword [rsp + 0x30]
mov r13, rax
mov rax, qword [r15]
cmp rax, rdx
je 0x4e41a9
cmp qword [r13], 0
je 0x4e41bb
xor edx, edx
add rdx, 1
cmp qword [r13 + rdx*8], 0
jne 0x4e40d0
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 sub.msvcrt.dll_free
movsxd rax, dword [r14]
mov rdx, qword [rsp + 0x48]
mov rcx, qword [r15]
lea rdx, [rdx + rax + 1]
shl rdx, 3
call fcn.004eba30
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 sub.msvcrt.dll_free
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_free
jmp 0x4e4013
mov ecx, 8
call fcn.004eb9b0
mov rdx, qword [rsp + 0x30]
mov r13, rax
mov qword [rax], 0
mov rax, qword [r15]
cmp rax, rdx
jne 0x4e41bb
mov rcx, qword [rsp + 0x30]
call fcn.004e3b10
mov qword [r15], rax
jmp 0x4e40c3
mov qword [rsp + 0x38], rbp
xor edx, edx
mov dword [rsp + 0x44], 0
mov qword [rsp + 0x28], 0
jmp 0x4e40fa
mov rbx, qword [rcx]
mov ecx, 2
call qword [fcn.004fa060]
lea rdx, str._s:_error:_too_many___files_encountered_n
mov rcx, rax
mov r8, rbx
call fcn.004e3ae0
mov ecx, 1
call fcn.004eb8f0
mov rax, qword [r15]
mov ecx, 2
mov rbx, qword [rax]
call qword [fcn.004fa060]
lea rdx, str._s:_error:___file_refers_to_a_directory_n
mov rcx, rax
mov r8, rbx
call fcn.004e3ae0
mov ecx, 1
call fcn.004eb8f0
nop
xor eax, eax
test rcx, rcx
je 0x4e4251
cmp qword [rcx], 0
je 0x4e4251
mov edx, 1
mov rax, rdx
add rdx, 1
cmp qword [rcx + rdx*8 - 8], 0
jne 0x4e4242
ret