Function at 0x140157530
Capabilities:
Write file on windows

Disassembly:
push rbp
push rsi
push rdi
push r14
push r15
lea rbp, [rsp - 0x1a0]
sub rsp, 0x2a0
mov qword [rsp + 0x38], 0xfffffffffffffffe
mov qword [rsp + 0x2e8], rbx
mov rax, qword [0x1403ad830]
xor rax, rsp
mov qword [rbp + 0x198], rax
mov r15, r8
mov rsi, rdx
mov rdi, rcx
add rcx, 0x40
call fcn.14001f170
cmp byte [rdi + 0x14], 0
je 0x1401575ac
lea rdx, str.disk_is_read_only
lea rcx, [rsp + 0x40]
call fcn.14001c950
nop
lea rdx, [rsp + 0x40]
lea rcx, [rdi + 0x40]
call fcn.14001d690
nop
lea rcx, [rsp + 0x40]
jmp 0x14015785c
movzx eax, byte [rdi + 0x68]
test al, al
jne 0x1401575df
lea rdx, [0x1402fcbe8]
lea rcx, [rsp + 0x68]
call fcn.14001c950
nop
lea rdx, [rsp + 0x68]
lea rcx, [rdi + 0x40]
call fcn.14001d690
nop
lea rcx, [rsp + 0x68]
jmp 0x14015785c
test rsi, rsi
js 0x1401577ed
mov r8, qword [rdi + 8]
cmp rsi, r8
jge 0x1401577ed
mov r14, qword [r15]
test r14, r14
jne 0x140157625
lea rdx, str.buff_ap_in_NULL
lea rcx, [rbp - 0x70]
call fcn.14001c950
nop
lea rdx, [rbp - 0x70]
lea rcx, [rdi + 0x40]
call fcn.14001d690
nop
lea rcx, [rbp - 0x70]
jmp 0x14015785c
mov r14, qword [r14 + 0x18]
movsxd rcx, dword [rdi + 0x10]
cmp r14, rcx
jge 0x14015765a
lea rdx, str.buff_ap_in_size_is_too_small
lea rcx, [rbp - 0x48]
call fcn.14001c950
nop
lea rdx, [rbp - 0x48]
lea rcx, [rdi + 0x40]
call fcn.14001d690
nop
lea rcx, [rbp - 0x48]
jmp 0x14015785c
mov rax, r14
cqo
idiv rcx
test rdx, rdx
je 0x14015768f
lea rdx, str.buff_ap_in_size_is_not_fit__the_sector_size
lea rcx, [rbp - 0x20]
call fcn.14001c950
nop
lea rdx, [rbp - 0x20]
lea rcx, [rdi + 0x40]
call fcn.14001d690
nop
lea rcx, [rbp - 0x20]
jmp 0x14015785c
add rax, rsi
cmp rax, r8
jle 0x1401576bf
lea rdx, str.write_out_of_bounds
lea rcx, [rbp + 8]
call fcn.14001c950
nop
lea rdx, [rbp + 8]
lea rcx, [rdi + 0x40]
call fcn.14001d690
nop
lea rcx, [rbp + 8]
jmp 0x14015785c
imul rcx, rsi
xor r9d, r9d
xor r8d, r8d
mov rdx, rcx
mov rcx, qword [rdi + 0x70]
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x140157744
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp + 0x30]
call fcn.14001c660
nop
lea rdx, str.SetFilePointerEx_failed__ec
lea rcx, [rbp + 0xd0]
call fcn.14001c950
nop
lea r8, [rbp + 0x30]
mov rdx, rax
lea rcx, [rbp + 0xa8]
call fcn.14001da00
nop
mov rdx, rax
lea rcx, [rdi + 0x40]
call fcn.14001d690
nop
lea rcx, [rbp + 0xa8]
call fcn.14001d440
nop
lea rcx, [rbp + 0xd0]
call fcn.14001d440
nop
lea rcx, [rbp + 0x30]
jmp 0x14015785c
xor ecx, ecx
mov dword [rsp + 0x30], ecx
mov rax, qword [r15]
mov qword [rsp + 0x20], rcx
lea r9, [rsp + 0x30]
mov r8d, r14d
mov rdx, qword [rax + 0x10]
mov rcx, qword [rdi + 0x70]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x140157786
mov eax, dword [rsp + 0x30]
cmp rax, r14
jne 0x140157786
mov rcx, qword [rdi + 0x70]
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov al, 1
jmp 0x140157863
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp + 0x58]
call fcn.14001c660
nop
lea rdx, str.WriteFile_failed__ec
lea rcx, [rbp + 0x120]
call fcn.14001c950
nop
lea r8, [rbp + 0x58]
mov rdx, rax
lea rcx, [rbp + 0xf8]
call fcn.14001da00
nop
mov rdx, rax
lea rcx, [rdi + 0x40]
call fcn.14001d690
nop
lea rcx, [rbp + 0xf8]
call fcn.14001d440
nop
lea rcx, [rbp + 0x120]
call fcn.14001d440
nop
lea rcx, [rbp + 0x58]
jmp 0x14015785c
mov r8d, 0xa
mov rdx, rsi
lea rcx, [rbp + 0x80]
call fcn.14001caf0
nop
lea rdx, str.sector_index_error:
lea rcx, [rbp + 0x170]
call fcn.14001c950
nop
lea r8, [rbp + 0x80]
mov rdx, rax
lea rcx, [rbp + 0x148]
call fcn.14001da00
nop
mov rdx, rax
lea rcx, [rdi + 0x40]
call fcn.14001d690
nop
lea rcx, [rbp + 0x148]
call fcn.14001d440
nop
lea rcx, [rbp + 0x170]
call fcn.14001d440
nop
lea rcx, [rbp + 0x80]
call fcn.14001d440
xor al, al
mov rcx, qword [rbp + 0x198]
xor rcx, rsp
call fcn.140283120
mov rbx, qword [rsp + 0x2e8]
add rsp, 0x2a0
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret