Function at 0x1400017b0
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 0x20], rbp
push rdi
push r12
push r15
sub rsp, 0x20
mov rbp, qword [rcx]
mov rdi, rcx
test rbp, rbp
jne 0x1400017e8
add rcx, 0x78
lea rdx, [0x1400244d0]
call fcn.140003b40
mov qword [rdi], rax
mov rbp, rax
test rax, rax
je 0x140001907
xor r12d, r12d
mov qword [rsp + 0x50], r14
mov ecx, 0x2000
mov r15d, r12d
call fcn.14000d1b8
mov r14, rax
test rax, rax
je 0x1400018d0
xor edx, edx
lea r8d, [r12 + 2]
mov rcx, rbp
call fcn.14000c9e0
test eax, eax
js 0x1400018d0
mov rcx, rbp
mov qword [rsp + 0x40], rbx
call fcn.14000ceb8
mov rbx, rax
cmp rax, 8
jb 0x1400018cb
mov qword [rsp + 0x48], rsi
nop
cmp rbx, 0x2000
lea rsi, [rbx - 0x2000]
cmovb rsi, r12
sub rbx, rsi
cmp rbx, 8
jb 0x1400018c6
xor r8d, r8d
mov rdx, rsi
mov rcx, rbp
call fcn.14000c9e0
test eax, eax
js 0x1400018c6
mov r9, rbp
mov r8, rbx
mov edx, 1
mov rcx, r14
call fcn.14000c710
cmp rax, rbx
jne 0x1400018c6
lea rax, [rbx - 7]
test rax, rax
je 0x1400018b4
mov ecx, dword [0x1400244a8]
mov edx, dword [str.MEI_f_v]
nop word [rax + rax]
cmp dword [r14 + rax - 1], edx
jne 0x1400018ae
cmp dword [r14 + rax + 3], ecx
je 0x1400018bf
sub rax, 1
jne 0x1400018a0
lea rbx, [rsi + 7]
test rsi, rsi
jne 0x140001840
jmp 0x1400018c6
lea r15, [rax - 1]
add r15, rsi
mov rsi, qword [rsp + 0x48]
mov rbx, qword [rsp + 0x40]
mov rcx, r14
call fcn.14000d1a4
mov r14, qword [rsp + 0x50]
test r15, r15
je 0x140001907
mov rcx, qword [rdi]
xor r8d, r8d
mov rdx, r15
call fcn.14000c9e0
test eax, eax
jns 0x14000191b
lea rdx, str.Failed_to_seek_to_cookie_position__n
lea rcx, str.fseek
call fcn.140002530
mov eax, 0xffffffff
mov rbp, qword [rsp + 0x58]
add rsp, 0x20
pop r15
pop r12
pop rdi
ret
mov r9, qword [rdi]
lea rcx, [rdi + 0x20]
mov edx, 0x58
lea r8d, [rdx - 0x57]
call fcn.14000c710
cmp rax, 1
jae 0x14000195d
lea rdx, str.Failed_to_read_cookie__n
lea rcx, str.fread
call fcn.140002530
mov eax, 0xffffffff
mov rbp, qword [rsp + 0x58]
add rsp, 0x20
pop r15
pop r12
pop rdi
ret
mov ecx, dword [rdi + 0x28]
xor r8d, r8d
mov eax, dword [rdi + 0x2c]
bswap eax
mov dword [rdi + 0x2c], eax
mov eax, dword [rdi + 0x30]
bswap eax
mov dword [rdi + 0x30], eax
mov eax, dword [rdi + 0x34]
bswap ecx
mov ecx, ecx
sub r15, rcx
mov dword [rdi + 0x28], ecx
bswap eax
mov dword [rdi + 0x34], eax
add r15, 0x58
mov qword [rdi + 8], r15
mov dword [rdi + 0x407c], r12d
mov dword [0x140035af4], eax
mov edx, dword [rdi + 0x2c]
add rdx, qword [rdi + 8]
mov rcx, qword [rdi]
call fcn.14000c9e0
movsxd rcx, dword [rdi + 0x30]
call fcn.14000d1b8
mov qword [rdi + 0x10], rax
test rax, rax
jne 0x1400019e2
lea rdx, str.Could_not_allocate_buffer_for_TOC__n
lea rcx, str.malloc
call fcn.140002530
mov eax, 0xffffffff
mov rbp, qword [rsp + 0x58]
add rsp, 0x20
pop r15
pop r12
pop rdi
ret
movsxd rdx, dword [rdi + 0x30]
mov r8d, 1
mov r9, qword [rdi]
mov rcx, rax
call fcn.14000c710
cmp rax, 1
jae 0x140001a09
lea rdx, str.Could_not_read_full_TOC__n
jmp 0x14000193d
movsxd rax, dword [rdi + 0x30]
add rax, qword [rdi + 0x10]
mov rcx, qword [rdi]
mov qword [rdi + 0x18], rax
call fcn.14000c454
test eax, eax
je 0x140001a32
lea rcx, str.Error_on_file._n
call fcn.1400027d0
jmp 0x140001907
mov rdx, qword [rdi + 0x10]
cmp rdx, qword [rdi + 0x18]
jae 0x140001a8b
nop dword [rax]
mov eax, dword [rdx + 4]
mov ecx, dword [rdx]
bswap eax
mov dword [rdx + 4], eax
mov eax, dword [rdx + 8]
bswap eax
mov dword [rdx + 8], eax
mov eax, dword [rdx + 0xc]
bswap eax
mov dword [rdx + 0xc], eax
bswap ecx
mov dword [rdx], ecx
movsxd rax, ecx
add rax, rdx
mov rdx, rax
cmp rax, qword [rdi + 0x10]
jae 0x140001a82
lea rcx, str.Cannot_read_Table_of_Contents._n
call fcn.1400027d0
mov rdx, qword [rdi + 0x18]
mov rax, rdx
jmp 0x140001a86
mov rax, qword [rdi + 0x18]
cmp rdx, rax
jb 0x140001a40
mov rcx, qword [rdi]
test rcx, rcx
je 0x140001a9b
call fcn.14000c3c4
mov qword [rdi], r12
mov rbp, qword [rsp + 0x58]
xor eax, eax
add rsp, 0x20
pop r15
pop r12
pop rdi
ret