Function at 0x14001216a
Capabilities:
Print debug messages
Read file on windows
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x68
mov r13, qword [0x1400b1280]
movsxd rsi, edx
mov qword [rsp + 0x30], rcx
test esi, esi
je 0x140012193
mov rbp, qword [r13]
jmp 0x1400121a1
mov rax, qword [0x1400b1a80]
mov rbp, qword [rax + 0x400]
mov edx, dword [r13 + 0x10]
cmp edx, 0x1ff
ja 0x1400121c9
lea rcx, str.Unexpected_sector_size___d____Aborting
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp fcn.140036717
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
test eax, eax
jne 0x1400121ec
lea rcx, str.Warning:_Unable_to_rewind_image_position___wrong_data_might_be_copied_
call fcn.140036717
xor eax, eax
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov dword [rsp + 0x20], eax
or ecx, 0xffffffff
call fcn.140043acc
test esi, esi
je 0x14001259c
mov r15, qword [0x1400b1830]
lea rax, str.Fast_zeroing_drive:
lea rcx, str.Zeroing_drive:
cmp dword [r15], 0
cmovne rcx, rax
call fcn.140036717
mov ecx, dword [r13 + 0x10]
xor edx, edx
lea r14d, [rcx + 0x1ffffff]
mov eax, r14d
div ecx
sub r14d, edx
mov edx, ecx
mov eax, r14d
mov ecx, r14d
mov qword [rsp + 0x38], rax
call fcn.140011d3c
mov rbx, rax
test rax, rax
jne 0x140012278
lea rcx, str.Could_not_allocate_disk_zeroing_buffer
xor esi, esi
mov dword [0x1400fac54], 0xc0030008
call fcn.140036717
jmp 0x140012334
mov ecx, dword [r13 + 0x10]
xor edx, edx
mov r8d, 0x49c
div rcx
mov r12, rdx
test rdx, rdx
jne 0x140012865
mov eax, dword [r15]
test eax, eax
je 0x14001229f
mov eax, 0xff
mov rdi, rbx
mov ecx, r14d
xor esi, esi
rep stosb byte [rdi], al
cmp dword [r15], 0
je 0x140012303
mov edx, dword [r13 + 0x10]
mov ecx, r14d
call fcn.140011d3c
mov rsi, rax
test rax, rax
jne 0x1400122db
lea rcx, str.Could_not_allocate_disk_comparison_buffer
mov dword [0x1400fac54], 0xc0030008
call fcn.140036717
jmp 0x140012334
mov ecx, dword [r13 + 0x10]
xor edx, edx
div rcx
test rdx, rdx
je 0x140012303
mov r8d, 0x4a8
lea rdx, str.format.c
lea rcx, str._uintptr_t_cmp_buffer___SelectedDrive.SectorSize__0
call qword [sym.imp.msvcrt.dll__wassert]
xor eax, eax
mov dword [rsp + 0x58], r14d
xor edi, edi
or r14, 0xffffffffffffffff
mov dword [rsp + 0x50], eax
jmp 0x1400123a7
mov rdi, qword [0x1400b1830]
mov edi, dword [rdi]
test edi, edi
je 0x1400124a5
test eax, eax
jns 0x14001233d
cmp ax, 0x4c7
jne 0x14001233d
or rdi, 0xffffffffffffffff
jmp 0x140012b1e
xor eax, eax
mov r8d, dword [rsp + 0x58]
mov rcx, qword [rsp + 0x30]
mov rdx, rsi
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x54]
call qword [sym.imp.KERNEL32.DLL_ReadFile]
test eax, eax
je 0x140012451
mov edx, dword [rsp + 0x58]
cmp edx, dword [rsp + 0x54]
jne 0x140012451
mov ecx, dword [rsi]
lea eax, [rcx - 1]
cmp eax, 0xfffffffd
jbe 0x140012477
mov r8d, edx
mov eax, 1
shr r8d, 2
cmp eax, r8d
jb 0x14001246a
mov dword [rsp + 0x50], edx
xor edi, edi
mov eax, dword [rsp + 0x50]
mov r14, qword [rsp + 0x38]
add r12, rax
cmp r12, rbp
jae 0x140012593
mov rax, qword [0x1400b1830]
mov r9, rbp
mov r8, r12
mov ecx, 4
cmp dword [rax], 1
sbb edx, edx
xor eax, eax
mov dword [rsp + 0x20], eax
and edx, 0xffffffec
add edx, 0xcea
call fcn.140043acc
mov eax, 0x50
cmp rbp, rax
cmovbe rax, rbp
xor edx, edx
imul rax, r12
div rbp
mov qword [rsp + 0x38], rax
cmp rax, r14
je 0x140012406
lea rcx, [0x1400859c5]
call fcn.140036810
mov eax, dword [rsp + 0x58]
add rax, r12
cmp rbp, rax
jae 0x14001241b
mov eax, ebp
sub eax, r12d
mov dword [rsp + 0x58], eax
mov r8d, dword [rsp + 0x58]
mov ecx, dword [r13 + 0x10]
xor edx, edx
mov eax, r8d
div ecx
test edx, edx
je 0x14001243f
lea eax, [r8 + rcx - 1]
xor edx, edx
div ecx
imul eax, ecx
mov dword [rsp + 0x58], eax
mov eax, dword [0x1400fac54]
test edi, edi
je 0x140012319
dec edi
jmp 0x1400124a5
call fcn.140036bd7
lea rcx, str._r_nRead_error:_Could_not_read_data_for_fast_zeroing_comparison____s
mov rdx, rax
call fcn.140036717
jmp 0x140012334
inc rax
cmp ecx, dword [rsi + rax*4 - 4]
je 0x14001238c
xor r9d, r9d
xor r8d, r8d
mov rcx, qword [rsp + 0x30]
mov rdx, r12
call qword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
test eax, eax
jne 0x1400124a0
call fcn.140036bd7
lea rcx, str._r_nError:_Could_not_reset_position____s
mov rdx, rax
jmp 0x140012460
mov edi, 0xf
mov r14d, 4
mov eax, dword [0x1400fac54]
test eax, eax
jns 0x1400124bf
cmp ax, 0x4c7
je 0x140012334
xor r15d, r15d
mov r8d, dword [rsp + 0x58]
mov rcx, qword [rsp + 0x30]
mov rdx, rbx
mov qword [rsp + 0x20], r15
lea r9, [rsp + 0x50]
call qword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x140012503
mov r8d, dword [rsp + 0x58]
mov edx, dword [rsp + 0x50]
cmp r8d, edx
je 0x14001239b
lea rcx, str._r_nWrite_error:_Wrote__d_bytes__expected__d_bytes
call fcn.140036717
jmp 0x140012526
call fcn.140036bd7
mov ecx, dword [r13 + 0x10]
xor edx, edx
mov r8, rax
mov rax, r12
div rcx
lea rcx, str._r_nWrite_error_at_sector__lld:__s
mov rdx, rax
call fcn.140036717
dec r14d
je 0x140012577
mov edx, 5
lea rcx, [0x140085c84]
call fcn.140036717
mov ecx, 0x1388
mov r15, qword [sym.imp.KERNEL32.DLL_Sleep]
call r15
xor r9d, r9d
xor r8d, r8d
mov rcx, qword [rsp + 0x30]
mov rdx, r12
call qword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
test eax, eax
jne 0x140012586
call fcn.140036bd7
lea rcx, str.Write_error:_Could_not_reset_position____s
mov rdx, rax
jmp 0x140012460
mov dword [0x1400fac54], 0xc003001d
jmp 0x140012334
mov ecx, 0xc8
call r15
jmp 0x1400124ab
or rdi, 0xffffffffffffffff
jmp 0x140012b14
mov rbx, qword [0x1400b1a80]
mov r12, qword [0x1400b1a70]
cmp byte [rbx + 0x442], 0
je 0x14001275f
lea rcx, str.Writing_compressed_image:
call fcn.140036717
mov r9d, 3
mov r8d, 1
mov dword [rsp + 0x20], 0x8000000
mov rcx, qword [r12]
mov edx, 0x80000000
call fcn.140011e50
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x140012615
call fcn.140036bd7
mov rdx, qword [r12]
lea rcx, [0x140085ce3]
mov r8, rax
call fcn.140036717
mov dword [0x1400fac54], 0xc003006e
jmp 0x140012756
mov ecx, dword [r13 + 0x10]
mov rdx, rcx
call fcn.140011d3c
mov qword [0x1400fac28], rax
test rax, rax
jne 0x140012648
lea rcx, str.Could_not_allocate_disk_write_buffer
mov dword [0x1400fac54], 0xc0030008
call fcn.140036717
jmp 0x140012756
mov ecx, dword [r13 + 0x10]
xor edx, edx
div rcx
test rdx, rdx
je 0x14001266f
mov r8d, 0x50b
lea rdx, str.format.c
lea rcx, str._uintptr_t_sec_buf___SelectedDrive.SectorSize__0
jmp 0x1400122fd
xor r11d, r11d
lea rax, [0x1400fac54]
xor r10d, r10d
xor edx, edx
mov qword [rsp + 0x20], r11
mov rcx, qword [fcn.140036717]
lea r9, [0x140011b92]
lea r8, [0x140011c09]
mov qword [rsp + 0x28], rax
mov dword [0x1400fac70], r10d
call fcn.140049e76
movzx r8d, byte [rbx + 0x442]
mov rdx, qword [rsp + 0x30]
mov rcx, rdi
call fcn.140049972
mov rbx, rax
call fcn.140049ec0
lea rcx, [0x140085d8c]
call fcn.140036810
test rbx, rbx
js 0x14001270f
cmp dword [0x1400fac70], 0
je 0x14001270f
lea rcx, str.Notice:_Compressed_image_data_didnt_end_on_block_boundary.
call fcn.140036717
xor r9d, r9d
mov r8d, dword [r13 + 0x10]
mov rdx, qword [0x1400fac28]
mov qword [rsp + 0x20], r9
mov rcx, qword [rsp + 0x30]
lea r9, [rsp + 0x50]
call qword [sym.imp.KERNEL32.DLL_WriteFile]
mov rcx, qword [0x1400fac28]
call fcn.140011d94
xor r8d, r8d
mov qword [0x1400fac28], r8
test rbx, rbx
jns 0x140012b10
cmp word [0x1400fac54], 0x4c7
je 0x140012b10
mov rdx, rbx
lea rcx, str.Could_not_write_compressed_image:__lld
call fcn.140036717
mov dword [0x1400fac54], 0xc003001d
xor esi, esi
xor ebx, ebx
jmp 0x140012b1e
mov edx, 1
mov ecx, 0x38
mov rbx, qword [r12]
call sub.msvcrt.dll_calloc
mov rdi, rax
test rax, rax
jne 0x14001278a
mov ecx, 8
call qword [sym.imp.KERNEL32.DLL_SetLastError]
jmp 0x140012821
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
mov edx, 1
call qword [sym.imp.KERNEL32.DLL_CreateEventA]
mov r9d, 3
mov edx, 0x80000000
mov rcx, rbx
mov qword [rdi + 0x28], rax
mov r8d, 1
mov dword [rsp + 0x20], 0x48000000
call fcn.140011e50
mov qword [rdi], rax
inc rax
jne 0x1400127de
mov rcx, qword [rdi + 0x28]
call qword [sym.imp.KERNEL32.DLL_CloseHandle]
mov rcx, rdi
call sub.msvcrt.dll_free
jmp 0x140012821
mov ecx, dword [r13 + 0x10]
xor edx, edx
lea r14d, [rcx + 0x1ffffff]
mov eax, r14d
div ecx
sub r14d, edx
mov edx, ecx
lea ecx, [r14 + r14]
call fcn.140011d3c
mov rbx, rax
test rax, rax
jne 0x14001284e
lea rcx, str.Could_not_allocate_disk_write_buffer
mov dword [0x1400fac54], 0xc0030008
call fcn.140036717
jmp 0x14001292f
call fcn.140036bd7
mov rdx, qword [r12]
xor esi, esi
xor ebx, ebx
mov r8, rax
lea rcx, [0x140085ce3]
xor edi, edi
call fcn.140036717
mov dword [0x1400fac54], 0xc003006e
jmp 0x140012b1e
mov ecx, dword [r13 + 0x10]
xor edx, edx
div rcx
mov r12, rdx
test rdx, rdx
je 0x140012878
mov r8d, 0x531
lea rdx, str.format.c
lea rcx, str._uintptr_t_buffer___SelectedDrive.SectorSize__0
jmp 0x1400122fd
mov r8d, r14d
mov rdx, rbx
mov rcx, rdi
or r13, 0xffffffffffffffff
call fcn.140012121
mov dword [rsp + 0x5c], 1
mov eax, 1
jmp 0x1400128a7
movsxd rax, esi
movsxd rsi, r13d
mov r13, qword [rsp + 0x38]
add r12, r8
cmp dword [rsp + rax*4 + 0x58], 0
je 0x140012b00
xor ecx, ecx
mov edx, 0xcbd
mov r9, rbp
mov r8, r12
mov dword [rsp + 0x20], ecx
mov ecx, 4
call fcn.140043acc
mov eax, 0x50
cmp rbp, rax
cmovbe rax, rbp
xor edx, edx
imul rax, r12
div rbp
mov qword [rsp + 0x38], rax
cmp rax, r13
je 0x1400128f8
lea rcx, [0x1400859c5]
call fcn.140036810
cmp dword [rdi + 8], 0
jg 0x140012936
mov rcx, qword [rdi + 0x28]
mov edx, 0x3a98
call qword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
test eax, eax
je 0x140012936
call fcn.140036bd7
lea rcx, str._r_nRead_error:__s
mov rdx, rax
call fcn.140036717
mov dword [0x1400fac54], 0xc003001e
xor esi, esi
jmp 0x140012b1e
mov r9d, dword [rdi + 8]
test r9d, r9d
jne 0x140012947
xor edx, edx
mov dword [rsp + rsi*4 + 0x58], edx
jmp 0x140012911
cmp dword [rdi + 0x30], 0
je 0x14001295a
mov ecx, 0x103
call qword [sym.imp.KERNEL32.DLL_SetLastError]
jmp 0x140012911
movsxd r13, esi
shr r9d, 0x1f
mov rcx, qword [rdi]
lea rdx, [rdi + 0x10]
lea r8, [rsp + r13*4 + 0x58]
call qword [sym.imp.KERNEL32.DLL_GetOverlappedResult]
test eax, eax
jne 0x140012984
call qword [sym.imp.KERNEL32.DLL_GetLastError]
cmp eax, 0x26
je 0x140012994
jmp 0x140012911
mov eax, dword [rsp + r13*4 + 0x58]
add qword [rdi + 0x20], rax
mov dword [rdi + 0x30], 1
mov eax, dword [rsp + r13*4 + 0x58]
add rax, r12
cmp rbp, rax
jae 0x1400129ab
mov eax, ebp
sub eax, r12d
mov dword [rsp + r13*4 + 0x58], eax
mov rax, qword [0x1400b1280]
mov r8d, dword [rsp + r13*4 + 0x58]
xor edx, edx
mov ecx, dword [rax + 0x10]
mov eax, r8d
div ecx
test edx, edx
je 0x1400129d6
lea eax, [r8 + rcx - 1]
xor edx, edx
div ecx
imul eax, ecx
mov dword [rsp + r13*4 + 0x58], eax
lea r13d, [rsi + 1]
mov r8d, r14d
mov rcx, rdi
movsxd r15, esi
and r13d, 1
mov edx, r13d
imul edx, r14d
add rdx, rbx
call fcn.140012121
mov eax, esi
mov dword [rsp + 0x4c], 4
imul eax, r14d
add rax, rbx
mov qword [rsp + 0x40], rax
mov eax, dword [0x1400fac54]
test eax, eax
jns 0x140012a20
cmp ax, 0x4c7
je 0x14001292f
xor eax, eax
mov rdx, qword [rsp + 0x40]
mov rcx, qword [rsp + 0x30]
lea r9, [rsp + 0x50]
mov qword [rsp + 0x20], rax
mov r8d, dword [rsp + r15*4 + 0x58]
call qword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x140012a65
mov r8d, dword [rsp + r15*4 + 0x58]
mov edx, dword [rsp + 0x50]
cmp r8d, edx
je 0x140012899
lea rcx, str._r_nWrite_error:_Wrote__d_bytes__expected__d_bytes
call fcn.140036717
jmp 0x140012a8e
call fcn.140036bd7
xor edx, edx
mov r8, rax
mov rax, qword [0x1400b1280]
mov ecx, dword [rax + 0x10]
mov rax, r12
div rcx
lea rcx, str._r_nWrite_error_at_sector__lld:__s
mov rdx, rax
call fcn.140036717
dec dword [rsp + 0x4c]
je 0x140012ae1
mov edx, 5
lea rcx, [0x140085c84]
call fcn.140036717
mov ecx, 0x1388
call qword [sym.imp.KERNEL32.DLL_Sleep]
xor r9d, r9d
xor r8d, r8d
mov rcx, qword [rsp + 0x30]
mov rdx, r12
call qword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
test eax, eax
jne 0x140012af0
call fcn.140036bd7
lea rcx, str.Write_error:_Could_not_reset_position____s
mov rdx, rax
call fcn.140036717
jmp 0x14001292f
mov dword [0x1400fac54], 0xc003001d
jmp 0x14001292f
mov ecx, 0xc8
call qword [sym.imp.KERNEL32.DLL_Sleep]
jmp 0x140012a0c
lea rcx, [0x140085d8c]
xor esi, esi
call fcn.140036810
jmp 0x140012b14
xor esi, esi
xor ebx, ebx
mov rcx, qword [rsp + 0x30]
call fcn.14000f589
mov rdx, qword [0x1400b1a80]
lea rax, [rdi - 1]
cmp byte [rdx + 0x442], 0
je 0x140012b43
cmp rax, 0xfffffffffffffffd
ja 0x140012b63
mov rcx, rdi
call qword [sym.imp.KERNEL32.DLL_CloseHandle]
jmp 0x140012b63
cmp rax, 0xfffffffffffffffd
ja 0x140012b63
mov rcx, qword [rdi]
mov rbp, qword [sym.imp.KERNEL32.DLL_CloseHandle]
call rbp
mov rcx, qword [rdi + 0x28]
call rbp
mov rcx, rdi
call sub.msvcrt.dll_free
mov rcx, rbx
call fcn.140011d94
mov rcx, rsi
call fcn.140011d94
nop
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret