Function at 0x140001790
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
push r14
push r15
sub rsp, 0x20
mov rbp, qword [rcx]
mov rdi, rcx
test rbp, rbp
jne 0x1400017d2
add rcx, 0x78
lea rdx, [0x140025420]
call fcn.140002d90
mov qword [rdi], rax
mov rbp, rax
test rax, rax
je 0x1400018e8
xor r15d, r15d
mov ecx, 0x2000
mov esi, r15d
call fcn.14000c9c8
mov r14, rax
test rax, rax
je 0x1400018b6
xor edx, edx
lea r8d, [r15 + 2]
mov rcx, rbp
call fcn.14000c1f0
test eax, eax
js 0x1400018b6
mov rcx, rbp
call fcn.14000c6c8
mov rbx, rax
cmp rax, 8
jb 0x1400018b6
nop dword [rax]
cmp rbx, 0x2000
lea rsi, [rbx - 0x2000]
cmovb rsi, r15
sub rbx, rsi
cmp rbx, 8
jb 0x14000189e
xor r8d, r8d
mov rdx, rsi
mov rcx, rbp
call fcn.14000c1f0
test eax, eax
js 0x14000189e
mov r9, rbp
mov r8, rbx
mov edx, 1
mov rcx, r14
call fcn.14000bf20
cmp rax, rbx
jne 0x14000189e
lea rcx, [rbx - 7]
test rcx, rcx
je 0x140001895
mov edx, dword [0x1400253f8]
lea rax, [r14 - 1]
mov r8d, dword [str.MEI_f_v]
add rax, rcx
cmp dword [rax], r8d
jne 0x14000188c
cmp dword [rax + 4], edx
je 0x1400018b0
dec rax
sub rcx, 1
jne 0x140001882
lea rbx, [rsi + 7]
test rsi, rsi
jne 0x140001820
mov rcx, r14
call fcn.14000c9b4
mov eax, 0xffffffff
jmp 0x140001a54
dec rsi
add rsi, rcx
mov rcx, r14
call fcn.14000c9b4
test rsi, rsi
je 0x1400018e8
mov rcx, qword [rdi]
xor r8d, r8d
mov rdx, rsi
call fcn.14000c1f0
test eax, eax
jns 0x1400018f2
lea rdx, str.Failed_to_seek_to_cookie_position__n
lea rcx, str.fseek
call fcn.140001c30
mov eax, 0xffffffff
jmp 0x140001a54
mov r9, qword [rdi]
lea rcx, [rdi + 0x20]
mov edx, 0x58
lea r8d, [rdx - 0x57]
call fcn.14000bf20
cmp rax, 1
jae 0x14000192a
lea rdx, str.Failed_to_read_cookie__n
lea rcx, str.fread
call fcn.140001c30
mov eax, 0xffffffff
jmp 0x140001a54
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 rsi, rcx
mov dword [rdi + 0x28], ecx
bswap eax
mov dword [rdi + 0x34], eax
add rsi, 0x58
mov qword [rdi + 8], rsi
mov dword [rdi + 0x407c], r15d
mov dword [0x140037c24], eax
mov edx, dword [rdi + 0x2c]
add rdx, qword [rdi + 8]
mov rcx, qword [rdi]
call fcn.14000c1f0
movsxd rcx, dword [rdi + 0x30]
call fcn.14000c9c8
mov qword [rdi + 0x10], rax
test rax, rax
jne 0x1400019a5
lea rdx, str.Could_not_allocate_buffer_for_TOC__n
lea rcx, str.malloc
call fcn.140001c30
mov eax, 0xffffffff
jmp 0x140001a54
movsxd rdx, dword [rdi + 0x30]
mov r8d, 1
mov r9, qword [rdi]
mov rcx, rax
call fcn.14000bf20
cmp rax, 1
jae 0x1400019cc
lea rdx, str.Could_not_read_full_TOC__n
jmp 0x140001914
movsxd rax, dword [rdi + 0x30]
add rax, qword [rdi + 0x10]
mov rcx, qword [rdi]
mov qword [rdi + 0x18], rax
call fcn.14000bc94
test eax, eax
je 0x1400019f7
lea rcx, str.Error_on_file._n
call fcn.140001c70
mov eax, 0xffffffff
jmp 0x140001a54
mov rdx, qword [rdi + 0x10]
cmp rdx, qword [rdi + 0x18]
jae 0x140001a42
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]
jb 0x140001a36
cmp rax, qword [rdi + 0x18]
jb 0x140001a01
jmp 0x140001a42
lea rcx, str.Cannot_read_Table_of_Contents._n
call fcn.140001c70
mov rcx, qword [rdi]
test rcx, rcx
je 0x140001a52
call fcn.14000bc04
mov qword [rdi], r15
xor eax, eax
mov rbx, qword [rsp + 0x40]
mov rbp, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x50]
add rsp, 0x20
pop r15
pop r14
pop rdi
ret