Function at 0x140157160
Capabilities:
Read file on windows

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x1b8]
sub rsp, 0x2b8
mov qword [rsp + 0x38], 0xfffffffffffffffe
mov rax, qword [0x1403ad830]
xor rax, rsp
mov qword [rbp + 0x1a0], rax
mov rsi, r9
mov r15, r8
mov rbx, rdx
mov r13, rcx
add rcx, 0x40
call fcn.14001f170
movzx eax, byte [r13 + 0x68]
test al, al
jne 0x1401571df
lea rdx, [0x1402fcbe8]
lea rcx, [rsp + 0x48]
call fcn.14001c950
nop
lea rdx, [rsp + 0x48]
lea rcx, [r13 + 0x40]
call fcn.14001d690
nop
lea rcx, [rsp + 0x48]
jmp 0x140157500
test rbx, rbx
js 0x14015749a
mov rcx, qword [r13 + 8]
cmp rbx, rcx
jge 0x14015749a
test r15, r15
jg 0x140157262
mov r8d, 0xa
mov rdx, r15
lea rcx, [rsp + 0x70]
call fcn.14001caf0
nop
lea rdx, str.sector_count_out_of_bounds
lea rcx, [rbp + 0x88]
call fcn.14001c950
nop
lea r8, [rsp + 0x70]
mov rdx, rax
lea rcx, [rbp + 0x60]
call fcn.14001da00
nop
mov rdx, rax
lea rcx, [r13 + 0x40]
call fcn.14001d690
nop
lea rcx, [rbp + 0x60]
call fcn.14001d440
nop
lea rcx, [rbp + 0x88]
call fcn.14001d440
nop
lea rcx, [rsp + 0x70]
jmp 0x140157500
lea rax, [r15 + rbx]
cmp rax, rcx
jle 0x140157293
lea rdx, str.read_out_of_bounds
lea rcx, [rbp - 0x68]
call fcn.14001c950
nop
lea rdx, [rbp - 0x68]
lea rcx, [r13 + 0x40]
call fcn.14001d690
nop
lea rcx, [rbp - 0x68]
jmp 0x140157500
movsxd r12, dword [r13 + 0x10]
mov rdi, r12
imul rdi, r15
imul r12, rbx
cmp qword [rsi], 0
jne 0x140157337
mov ecx, 0x28
call fcn.14028314c
mov qword [rsp + 0x40], rax
test rax, rax
je 0x1401572cd
mov rcx, rax
call fcn.14006be10
mov rbx, rax
jmp 0x1401572cf
xor ebx, ebx
test rbx, rbx
je 0x1401572de
mov eax, 1
lock xadd dword [rbx + 8], eax
mov rcx, qword [rsi]
mov r15d, 0xffffffff
test rcx, rcx
je 0x14015730a
mov eax, r15d
lock xadd dword [rcx + 8], eax
cmp eax, 1
jne 0x14015730a
mov rcx, qword [rsi]
test rcx, rcx
je 0x14015730a
mov rax, qword [rcx]
lea edx, [r15 + 2]
call qword [rax]
mov qword [rsi], rbx
test rbx, rbx
je 0x140157337
mov eax, 1
lock xadd dword [rbx + 8], eax
lock xadd dword [rbx + 8], r15d
lea eax, [r15 - 1]
test eax, eax
jne 0x140157337
mov rax, qword [rbx]
mov edx, 1
mov rcx, rbx
call qword [rax]
mov rcx, qword [rsi]
cmp qword [rcx + 0x18], rdi
jge 0x140157374
mov rdx, rdi
call fcn.14006bec0
test al, al
jne 0x140157374
lea rdx, str.alloc_memory_failed
lea rcx, [rbp - 0x40]
call fcn.14001c950
nop
lea rdx, [rbp - 0x40]
lea rcx, [r13 + 0x40]
call fcn.14001d690
nop
lea rcx, [rbp - 0x40]
jmp 0x140157500
xor r9d, r9d
xor r8d, r8d
mov rdx, r12
mov rcx, qword [r13 + 0x70]
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x1401573f5
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp - 0x18]
call fcn.14001c660
nop
lea rdx, str.SetFilePointerEx_failed__ec
lea rcx, [rbp + 0xd8]
call fcn.14001c950
nop
lea r8, [rbp - 0x18]
mov rdx, rax
lea rcx, [rbp + 0xb0]
call fcn.14001da00
nop
mov rdx, rax
lea rcx, [r13 + 0x40]
call fcn.14001d690
nop
lea rcx, [rbp + 0xb0]
call fcn.14001d440
nop
lea rcx, [rbp + 0xd8]
call fcn.14001d440
nop
lea rcx, [rbp - 0x18]
jmp 0x140157500
mov dword [rsp + 0x30], 0
mov rax, qword [rsi]
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x30]
mov r8d, edi
mov rdx, qword [rax + 0x10]
mov rcx, qword [r13 + 0x70]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140157433
mov eax, dword [rsp + 0x30]
cmp rax, rdi
jne 0x140157433
mov al, 1
jmp 0x140157507
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp + 0x10]
call fcn.14001c660
nop
lea rdx, str.ReadFile_failed__ec
lea rcx, [rbp + 0x128]
call fcn.14001c950
nop
lea r8, [rbp + 0x10]
mov rdx, rax
lea rcx, [rbp + 0x100]
call fcn.14001da00
nop
mov rdx, rax
lea rcx, [r13 + 0x40]
call fcn.14001d690
nop
lea rcx, [rbp + 0x100]
call fcn.14001d440
nop
lea rcx, [rbp + 0x128]
call fcn.14001d440
nop
lea rcx, [rbp + 0x10]
jmp 0x140157500
mov r8d, 0xa
mov rdx, rbx
lea rcx, [rbp + 0x38]
call fcn.14001caf0
nop
lea rdx, str.sector_index_out_of_bounds
lea rcx, [rbp + 0x178]
call fcn.14001c950
nop
lea r8, [rbp + 0x38]
mov rdx, rax
lea rcx, [rbp + 0x150]
call fcn.14001da00
nop
mov rdx, rax
lea rcx, [r13 + 0x40]
call fcn.14001d690
nop
lea rcx, [rbp + 0x150]
call fcn.14001d440
nop
lea rcx, [rbp + 0x178]
call fcn.14001d440
nop
lea rcx, [rbp + 0x38]
call fcn.14001d440
xor al, al
mov rcx, qword [rbp + 0x1a0]
xor rcx, rsp
call fcn.140283120
add rsp, 0x2b8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret