Function at 0x1400597c0
Capabilities:
Read file on windows

Disassembly:
push rbp
push rbx
sub rsp, 0xa8
lea rbp, [rsp + 0xa0]
mov qword [rbp + 0x20], rcx
mov qword [rbp + 0x28], rdx
mov dword [rbp - 4], 0
mov rax, qword [rbp + 0x28]
mov rax, qword [rax]
mov qword [rbp - 0x20], rax
mov dword [rbp - 8], 0x7d0
jmp 0x140059b9f
mov rax, qword [rbp + 0x28]
mov rdx, qword [rax]
mov eax, dword [rbp - 4]
cdqe
shl rax, 3
add rax, rdx
mov rax, qword [rax]
mov qword [rbp - 0x28], rax
mov rax, qword [rbp - 0x28]
movzx eax, byte [rax]
cmp al, 0x40
jne 0x140059b92
sub dword [rbp - 8], 1
cmp dword [rbp - 8], 0
jne 0x140059865
mov rax, qword [rbp + 0x28]
mov rax, qword [rax]
mov rbx, qword [rax]
mov ecx, 2
mov rax, qword [fcn.140077a8f]
call rax
mov rcx, rax
mov r8, rbx
lea rax, str._s:_error:_too_many___files_encountered_n
mov rdx, rax
call fcn.140059139
mov ecx, 1
call fcn.1400640ce
mov rax, qword [rbp - 0x28]
lea rcx, [rax + 1]
lea rax, [rbp - 0x80]
mov rdx, rax
mov rax, qword [sym.imp.msvcrt.dll__stat64]
call rax
test eax, eax
js 0x140059b98
movzx eax, word [rbp - 0x7a]
movzx eax, ax
and eax, 0xf000
cmp eax, 0x4000
jne 0x1400598d3
mov rax, qword [rbp + 0x28]
mov rax, qword [rax]
mov rbx, qword [rax]
mov ecx, 2
mov rax, qword [fcn.140077a8f]
call rax
mov rcx, rax
mov r8, rbx
lea rax, str._s:_error:___file_refers_to_a_directory_n
mov rdx, rax
call fcn.140059139
mov ecx, 1
call fcn.1400640ce
add qword [rbp - 0x28], 1
mov rax, qword [rbp - 0x28]
lea rdx, [0x1400aae01]
mov rcx, rax
call sub.msvcrt.dll_fopen
mov qword [rbp - 0x30], rax
cmp qword [rbp - 0x30], 0
je 0x140059b9e
mov rax, qword [rbp - 0x30]
mov r8d, 2
mov edx, 0
mov rcx, rax
call sub.msvcrt.dll_fseek
cmp eax, 0xffffffff
je 0x140059b74
mov rax, qword [rbp - 0x30]
mov rcx, rax
call sub.msvcrt.dll_ftell
mov dword [rbp - 0x34], eax
cmp dword [rbp - 0x34], 0xffffffff
je 0x140059b7a
mov rax, qword [rbp - 0x30]
mov r8d, 0
mov edx, 0
mov rcx, rax
call sub.msvcrt.dll_fseek
cmp eax, 0xffffffff
je 0x140059b80
mov eax, dword [rbp - 0x34]
cdqe
add rax, 1
mov rcx, rax
call fcn.1400641d3
mov qword [rbp - 0x40], rax
mov eax, dword [rbp - 0x34]
movsxd rdx, eax
mov rcx, qword [rbp - 0x30]
mov rax, qword [rbp - 0x40]
mov r9, rcx
mov r8, rdx
mov edx, 1
mov rcx, rax
call sub.msvcrt.dll_fread
mov qword [rbp - 0x48], rax
mov eax, dword [rbp - 0x34]
cdqe
cmp qword [rbp - 0x48], rax
je 0x1400599c1
mov rax, qword [rbp - 0x30]
mov rcx, rax
call sub.msvcrt.dll_ferror
test eax, eax
je 0x1400599c1
mov rax, qword [rbp - 0x40]
mov rcx, rax
call fcn.1400771af
jmp 0x140059b81
mov rdx, qword [rbp - 0x40]
mov rax, qword [rbp - 0x48]
add rax, rdx
mov byte [rax], 0
mov rax, qword [rbp - 0x40]
mov rcx, rax
call fcn.140059314
test eax, eax
je 0x140059a01
mov ecx, 8
call fcn.1400641d3
mov qword [rbp - 0x10], rax
mov rax, qword [rbp - 0x10]
mov qword [rax], 0
jmp 0x140059a11
mov rax, qword [rbp - 0x40]
mov rcx, rax
call fcn.14005936f
mov qword [rbp - 0x10], rax
mov rax, qword [rbp + 0x28]
mov rax, qword [rax]
cmp qword [rbp - 0x20], rax
jne 0x140059a3b
mov rax, qword [rbp + 0x28]
mov rax, qword [rax]
mov rcx, rax
call fcn.14005917c
mov rdx, rax
mov rax, qword [rbp + 0x28]
mov qword [rax], rdx
mov qword [rbp - 0x18], 0
jmp 0x140059a4d
add qword [rbp - 0x18], 1
mov rax, qword [rbp - 0x18]
lea rdx, [rax*8]
mov rax, qword [rbp - 0x10]
add rax, rdx
mov rax, qword [rax]
test rax, rax
jne 0x140059a48
mov rax, qword [rbp + 0x28]
mov rdx, qword [rax]
mov eax, dword [rbp - 4]
cdqe
shl rax, 3
add rax, rdx
mov rax, qword [rax]
mov rcx, rax
call fcn.1400771af
mov rax, qword [rbp + 0x20]
mov eax, dword [rax]
movsxd rdx, eax
mov rax, qword [rbp - 0x18]
add rax, rdx
add rax, 1
lea rdx, [rax*8]
mov rax, qword [rbp + 0x28]
mov rax, qword [rax]
mov rcx, rax
call fcn.14006428d
mov rdx, qword [rbp + 0x28]
mov qword [rdx], rax
mov rax, qword [rbp + 0x20]
mov eax, dword [rax]
sub eax, dword [rbp - 4]
cdqe
lea rcx, [rax*8]
mov rax, qword [rbp + 0x28]
mov rdx, qword [rax]
mov eax, dword [rbp - 4]
cdqe
add rax, 1
shl rax, 3
add rdx, rax
mov rax, qword [rbp + 0x28]
mov r8, qword [rax]
mov eax, dword [rbp - 4]
movsxd r9, eax
mov rax, qword [rbp - 0x18]
add rax, r9
shl rax, 3
add rax, r8
mov r8, rcx
mov rcx, rax
call sub.msvcrt.dll_memmove
mov rax, qword [rbp - 0x18]
lea rdx, [rax*8]
mov rax, qword [rbp + 0x28]
mov rcx, qword [rax]
mov eax, dword [rbp - 4]
cdqe
shl rax, 3
add rcx, rax
mov rax, qword [rbp - 0x10]
mov r8, rdx
mov rdx, rax
call sub.msvcrt.dll_memcpy
mov rax, qword [rbp + 0x20]
mov eax, dword [rax]
mov edx, eax
mov rax, qword [rbp - 0x18]
add eax, edx
sub eax, 1
mov edx, eax
mov rax, qword [rbp + 0x20]
mov dword [rax], edx
mov rax, qword [rbp - 0x10]
mov rcx, rax
call fcn.1400771af
mov rax, qword [rbp - 0x40]
mov rcx, rax
call fcn.1400771af
sub dword [rbp - 4], 1
jmp 0x140059b81
nop
jmp 0x140059b81
nop
jmp 0x140059b81
nop
mov rax, qword [rbp - 0x30]
mov rcx, rax
call sub.msvcrt.dll_fclose
jmp 0x140059b9f
nop
jmp 0x140059b9f
nop
jmp 0x140059b9f
nop
add dword [rbp - 4], 1
mov rax, qword [rbp + 0x20]
mov eax, dword [rax]
cmp dword [rbp - 4], eax
jl 0x1400597f7
nop
nop
add rsp, 0xa8
pop rbx
pop rbp
ret