Function at 0x14000d524
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, 0x88
mov rbp, qword [0x1400b4440]
movsxd rsi, edx
mov qword [rsp + 0x48], rcx
test esi, esi
je 0x14000d550
mov r15, qword [rbp]
jmp 0x14000d55e
mov rax, qword [0x1400b4c60]
mov r15, qword [rax + 0x530]
mov edx, dword [rbp + 0x10]
cmp edx, 0x1ff
ja 0x14000d588
lea rcx, str.Unexpected_sector_size___d____Aborting
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp fcn.1400380b9
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
test eax, eax
jne 0x14000d5ab
lea rcx, str.Warning:_Unable_to_rewind_image_position___wrong_data_might_be_copied_
call fcn.1400380b9
xor eax, eax
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov dword [rsp + 0x20], eax
or ecx, 0xffffffff
call fcn.140044e4a
test esi, esi
je 0x14000d962
mov r14, qword [0x1400b49f0]
lea rax, str.Fast_zeroing_drive:
lea rcx, str.Zeroing_drive:
cmp dword [r14], 0
cmovne rcx, rax
call fcn.1400380b9
mov ecx, dword [rbp + 0x10]
xor edx, edx
lea r12d, [rcx + 0x1ffffff]
mov eax, r12d
div ecx
sub r12d, edx
mov edx, ecx
mov eax, r12d
mov ecx, r12d
mov qword [rsp + 0x50], rax
call fcn.14000d12c
mov r13, rax
test rax, rax
jne 0x14000d639
lea rcx, str.Could_not_allocate_disk_zeroing_buffer
xor r12d, r12d
xor esi, esi
mov dword [0x1400ce934], 0xc0030008
call fcn.1400380b9
jmp 0x14000d6f5
mov ecx, dword [rbp + 0x10]
xor edx, edx
mov r8d, 0x49e
div rcx
mov rbx, rdx
test rdx, rdx
jne 0x14000dcf6
mov eax, dword [r14]
test eax, eax
je 0x14000d65f
mov eax, 0xff
mov rdi, r13
mov ecx, r12d
xor esi, esi
rep stosb byte [rdi], al
cmp dword [r14], 0
je 0x14000d6c1
mov edx, dword [rbp + 0x10]
mov ecx, r12d
call fcn.14000d12c
mov rsi, rax
test rax, rax
jne 0x14000d69a
lea rcx, str.Could_not_allocate_disk_comparison_buffer
mov dword [0x1400ce934], 0xc0030008
call fcn.1400380b9
jmp 0x14000d6f2
mov ecx, dword [rbp + 0x10]
xor edx, edx
div rcx
test rdx, rdx
je 0x14000d6c1
mov r8d, 0x4aa
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 + 0x78], r12d
xor edi, edi
or r12, 0xffffffffffffffff
mov dword [rsp + 0x70], eax
jmp 0x14000d768
mov rdi, qword [0x1400b49f0]
mov edi, dword [rdi]
test edi, edi
je 0x14000d863
test eax, eax
jns 0x14000d6fe
cmp ax, 0x4c7
jne 0x14000d6fe
xor r12d, r12d
or rbx, 0xffffffffffffffff
jmp 0x14000dfb2
xor eax, eax
mov r8d, dword [rsp + 0x78]
mov rcx, qword [rsp + 0x48]
mov rdx, rsi
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x74]
call qword [sym.imp.KERNEL32.DLL_ReadFile]
test eax, eax
je 0x14000d811
mov edx, dword [rsp + 0x78]
cmp edx, dword [rsp + 0x74]
jne 0x14000d811
mov ecx, dword [rsi]
lea eax, [rcx - 1]
cmp eax, 0xfffffffd
jbe 0x14000d832
mov r8d, edx
mov eax, 1
shr r8d, 2
cmp eax, r8d
jb 0x14000d825
mov dword [rsp + 0x70], edx
xor edi, edi
mov eax, dword [rsp + 0x70]
mov r12, qword [rsp + 0x50]
add rbx, rax
cmp rbx, r15
jae 0x14000d956
mov rax, qword [0x1400b49f0]
mov r9, r15
mov r8, rbx
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.140044e4a
mov eax, 0x50
cmp r15, rax
cmovbe rax, r15
xor edx, edx
imul rax, rbx
div r15
mov qword [rsp + 0x50], rax
cmp rax, r12
je 0x14000d7c7
lea rcx, [0x14008b325]
call fcn.1400381b2
mov eax, dword [rsp + 0x78]
add rax, rbx
cmp r15, rax
jae 0x14000d7dc
mov eax, r15d
sub eax, ebx
mov dword [rsp + 0x78], eax
mov r8d, dword [rsp + 0x78]
mov ecx, dword [rbp + 0x10]
xor edx, edx
mov eax, r8d
div ecx
test edx, edx
je 0x14000d7ff
lea eax, [r8 + rcx - 1]
xor edx, edx
div ecx
imul eax, ecx
mov dword [rsp + 0x78], eax
mov eax, dword [0x1400ce934]
test edi, edi
je 0x14000d6d7
dec edi
jmp 0x14000d863
call fcn.140038579
lea rcx, str._r_nRead_error:_Could_not_read_data_for_fast_zeroing_comparison____s
mov rdx, rax
jmp 0x14000d919
inc rax
cmp ecx, dword [rsi + rax*4 - 4]
je 0x14000d74d
xor r9d, r9d
xor r8d, r8d
mov rcx, qword [rsp + 0x48]
mov rdx, rbx
call qword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
test eax, eax
jne 0x14000d85e
call fcn.140038579
lea rcx, str._r_nError:_Could_not_reset_position____s
mov rdx, rax
jmp 0x14000d919
mov edi, 0xf
mov r12d, 4
jmp 0x14000d873
mov ecx, 0xc8
call r14
mov eax, dword [0x1400ce934]
test eax, eax
jns 0x14000d887
cmp ax, 0x4c7
je 0x14000d6f2
xor r14d, r14d
mov r8d, dword [rsp + 0x78]
mov rcx, qword [rsp + 0x48]
mov rdx, r13
mov qword [rsp + 0x20], r14
lea r9, [rsp + 0x70]
call qword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x14000d923
mov r8d, dword [rsp + 0x78]
mov edx, dword [rsp + 0x70]
cmp r8d, edx
je 0x14000d75c
lea rcx, str._r_nWrite_error:_Wrote__d_bytes__expected__d_bytes
call fcn.1400380b9
dec r12d
je 0x14000d947
mov edx, 5
lea rcx, [0x14008b5e4]
call fcn.1400380b9
mov ecx, 0x1388
mov r14, qword [sym.imp.KERNEL32.DLL_Sleep]
call r14
xor r9d, r9d
xor r8d, r8d
mov rcx, qword [rsp + 0x48]
mov rdx, rbx
call qword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
test eax, eax
jne 0x14000d86b
call fcn.140038579
lea rcx, [0x14008b5fe]
mov rdx, rax
call fcn.1400380b9
jmp 0x14000d6f2
call fcn.140038579
mov ecx, dword [rbp + 0x10]
xor edx, edx
mov r8, rax
mov rax, rbx
div rcx
lea rcx, str._r_nWrite_error_at_sector__lld:__s
mov rdx, rax
call fcn.1400380b9
jmp 0x14000d8c9
mov dword [0x1400ce934], 0xc003001d
jmp 0x14000d6f2
xor r12d, r12d
or rbx, 0xffffffffffffffff
jmp 0x14000dfa8
mov r12, qword [0x1400b4c60]
mov rdi, qword [0x1400b4c50]
mov al, byte [r12 + 0x573]
lea edx, [rax - 1]
cmp dl, 7
ja 0x14000db77
lea rcx, str.Writing_compressed_image:
xor r13d, r13d
call fcn.1400380b9
mov rcx, qword [rdi]
call fcn.14000d193
mov qword [rsp + 0x30], r13
xor r9d, r9d
mov r8d, 1
mov edx, 0x80000000
mov rcx, rax
mov rsi, rax
mov dword [rsp + 0x28], 0x8000000
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.DLL_CreateFileW]
mov rbx, rax
call qword [sym.imp.KERNEL32.DLL_GetLastError]
mov r13d, eax
test rsi, rsi
je 0x14000d9e3
mov rcx, rsi
call sub.msvcrt.dll_free
mov ecx, r13d
call qword [sym.imp.KERNEL32.DLL_SetLastError]
cmp rbx, 0xffffffffffffffff
jne 0x14000da20
call fcn.140038579
mov rdx, qword [rdi]
lea rcx, [0x14008b643]
mov r8, rax
call fcn.1400380b9
mov dword [0x1400ce934], 0xc003006e
xor r12d, r12d
xor esi, esi
xor r13d, r13d
jmp 0x14000d6f5
mov ecx, dword [rbp + 0x10]
mov rdx, rcx
call fcn.14000d12c
mov qword [0x1400ce908], rax
test rax, rax
jne 0x14000da52
lea rcx, str.Could_not_allocate_disk_write_buffer
mov dword [0x1400ce934], 0xc0030008
call fcn.1400380b9
jmp 0x14000db6a
mov ecx, dword [rbp + 0x10]
xor edx, edx
div rcx
test rdx, rdx
je 0x14000da78
mov r8d, 0x50d
lea rdx, str.format.c
lea rcx, str._uintptr_t_sec_buf___SelectedDrive.SectorSize__0
jmp 0x14000d6bb
lea rax, [0x1400ce934]
xor esi, esi
xor r11d, r11d
xor r8d, r8d
mov qword [rsp + 0x30], rax
lea rax, [0x14000cf82]
mov rdx, qword [fcn.1400380b9]
lea r9, [0x14000cff9]
mov qword [rsp + 0x28], rsi
mov ecx, 0x40000
mov qword [rsp + 0x20], rax
mov dword [0x1400ce950], r11d
call fcn.14004bf1d
mov rdx, qword [rsp + 0x48]
mov rcx, rbx
movzx r8d, byte [r12 + 0x573]
call fcn.14004ba08
mov rsi, rax
call fcn.14004bfb4
lea rcx, [0x14008b6ec]
call fcn.1400381b2
test rsi, rsi
js 0x14000db23
cmp dword [0x1400ce950], 0
je 0x14000db23
lea rcx, str.Notice:_Compressed_image_data_didnt_end_on_block_boundary.
call fcn.1400380b9
xor r10d, r10d
mov r8d, dword [rbp + 0x10]
mov rdx, qword [0x1400ce908]
mov qword [rsp + 0x20], r10
mov rcx, qword [rsp + 0x48]
lea r9, [rsp + 0x70]
call qword [sym.imp.KERNEL32.DLL_WriteFile]
mov rcx, qword [0x1400ce908]
call fcn.14000d184
xor r9d, r9d
mov qword [0x1400ce908], r9
test rsi, rsi
jns 0x14000dfa0
cmp word [0x1400ce934], 0x4c7
je 0x14000dfa0
mov rdx, rsi
lea rcx, str.Could_not_write_compressed_image:__lld
call fcn.1400380b9
mov dword [0x1400ce934], 0xc003001d
xor r12d, r12d
xor esi, esi
xor r13d, r13d
jmp 0x14000dfb2
mov r8d, 0x523
lea rdx, str.format.c
lea rcx, str.img_report.compression_type___IMG_COMPRESSION_FFU
cmp al, 9
je 0x14000d6bb
sub eax, 0xa
mov r13, qword [rdi]
xor r12d, r12d
cmp al, 1
ja 0x14000dbb7
mov rcx, r13
call fcn.140048315
mov r13, rax
test rax, rax
je 0x14000da13
mov r12, rax
mov edx, 1
mov ecx, 0x38
call sub.msvcrt.dll_calloc
mov rbx, rax
test rax, rax
jne 0x14000dbde
mov ecx, 8
call qword [sym.imp.KERNEL32.DLL_SetLastError]
jmp 0x14000dcb3
xor r9d, r9d
xor r8d, r8d
mov edx, 1
xor ecx, ecx
call qword [sym.imp.KERNEL32.DLL_CreateEventA]
mov rcx, r13
mov qword [rbx + 0x28], rax
call fcn.14000d193
xor r8d, r8d
xor r9d, r9d
mov edx, 0x80000000
mov rcx, rax
mov qword [rsp + 0x30], r8
mov r8d, 1
mov dword [rsp + 0x28], 0x48000000
mov dword [rsp + 0x20], 3
mov qword [rsp + 0x50], rax
call qword [sym.imp.KERNEL32.DLL_CreateFileW]
mov r13, rax
call qword [sym.imp.KERNEL32.DLL_GetLastError]
mov rcx, qword [rsp + 0x50]
mov r14d, eax
test rcx, rcx
je 0x14000dc4c
call sub.msvcrt.dll_free
mov ecx, r14d
call qword [sym.imp.KERNEL32.DLL_SetLastError]
mov qword [rbx], r13
inc r13
jne 0x14000dc71
mov rcx, qword [rbx + 0x28]
call qword [sym.imp.KERNEL32.DLL_CloseHandle]
mov rcx, rbx
call sub.msvcrt.dll_free
jmp 0x14000dcb3
mov ecx, dword [rbp + 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.14000d12c
mov r13, rax
test rax, rax
jne 0x14000dce0
lea rcx, str.Could_not_allocate_disk_write_buffer
mov dword [0x1400ce934], 0xc0030008
call fcn.1400380b9
jmp 0x14000ddc2
call fcn.140038579
mov rdx, qword [rdi]
xor esi, esi
xor r13d, r13d
mov r8, rax
lea rcx, [0x14008b643]
xor ebx, ebx
call fcn.1400380b9
mov dword [0x1400ce934], 0xc003006e
jmp 0x14000dfb2
mov ecx, dword [rbp + 0x10]
xor edx, edx
div rcx
mov rdi, rdx
test rdx, rdx
je 0x14000dd09
mov r8d, 0x53c
lea rdx, str.format.c
lea rcx, str._uintptr_t_buffer___SelectedDrive.SectorSize__0
jmp 0x14000d6bb
mov r8d, r14d
mov rdx, r13
mov rcx, rbx
or rbp, 0xffffffffffffffff
call fcn.14000d4a0
mov dword [rsp + 0x7c], 1
mov eax, 1
jmp 0x14000dd3a
movsxd rax, esi
mov rbp, qword [rsp + 0x58]
movsxd rsi, dword [rsp + 0x50]
add rdi, r8
cmp dword [rsp + rax*4 + 0x78], 0
je 0x14000df90
xor ecx, ecx
mov edx, 0xcbd
mov r9, r15
mov r8, rdi
mov dword [rsp + 0x20], ecx
mov ecx, 4
call fcn.140044e4a
mov eax, 0x50
cmp r15, rax
cmovbe rax, r15
xor edx, edx
imul rax, rdi
div r15
mov qword [rsp + 0x58], rax
cmp rax, rbp
je 0x14000dd8b
lea rcx, [0x14008b325]
call fcn.1400381b2
cmp dword [rbx + 8], 0
jg 0x14000ddc9
mov rcx, qword [rbx + 0x28]
mov edx, 0x3a98
call qword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
test eax, eax
je 0x14000ddc9
call fcn.140038579
lea rcx, str._r_nRead_error:__s
mov rdx, rax
call fcn.1400380b9
mov dword [0x1400ce934], 0xc003001e
xor esi, esi
jmp 0x14000dfb2
mov r9d, dword [rbx + 8]
test r9d, r9d
jne 0x14000ddda
xor edx, edx
mov dword [rsp + rsi*4 + 0x78], edx
jmp 0x14000dda4
cmp dword [rbx + 0x30], 0
je 0x14000dded
mov ecx, 0x103
call qword [sym.imp.KERNEL32.DLL_SetLastError]
jmp 0x14000dda4
movsxd rbp, esi
shr r9d, 0x1f
mov rcx, qword [rbx]
lea rdx, [rbx + 0x10]
lea r8, [rsp + rbp*4 + 0x78]
call qword [sym.imp.KERNEL32.DLL_GetOverlappedResult]
test eax, eax
jne 0x14000de17
call qword [sym.imp.KERNEL32.DLL_GetLastError]
cmp eax, 0x26
je 0x14000de26
jmp 0x14000dda4
mov eax, dword [rsp + rbp*4 + 0x78]
add qword [rbx + 0x20], rax
mov dword [rbx + 0x30], 1
mov eax, dword [rsp + rbp*4 + 0x78]
add rax, rdi
cmp r15, rax
jae 0x14000de3b
mov eax, r15d
sub eax, edi
mov dword [rsp + rbp*4 + 0x78], eax
mov rax, qword [0x1400b4440]
mov r8d, dword [rsp + rbp*4 + 0x78]
xor edx, edx
mov ecx, dword [rax + 0x10]
mov eax, r8d
div ecx
test edx, edx
je 0x14000de65
lea eax, [r8 + rcx - 1]
xor edx, edx
div ecx
imul eax, ecx
mov dword [rsp + rbp*4 + 0x78], eax
lea eax, [rsi + 1]
mov r8d, r14d
mov rcx, rbx
movsxd rbp, esi
and eax, 1
mov edx, eax
mov dword [rsp + 0x50], eax
imul edx, r14d
add rdx, r13
call fcn.14000d4a0
mov eax, esi
mov dword [rsp + 0x6c], 4
imul eax, r14d
add rax, r13
mov qword [rsp + 0x60], rax
mov eax, dword [0x1400ce934]
test eax, eax
jns 0x14000deb0
cmp ax, 0x4c7
je 0x14000ddc2
xor eax, eax
mov rdx, qword [rsp + 0x60]
mov rcx, qword [rsp + 0x48]
lea r9, [rsp + 0x70]
mov qword [rsp + 0x20], rax
mov r8d, dword [rsp + rbp*4 + 0x78]
call qword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x14000def5
mov r8d, dword [rsp + rbp*4 + 0x78]
mov edx, dword [rsp + 0x70]
cmp r8d, edx
je 0x14000dd2a
lea rcx, str._r_nWrite_error:_Wrote__d_bytes__expected__d_bytes
call fcn.1400380b9
jmp 0x14000df1e
call fcn.140038579
xor edx, edx
mov r8, rax
mov rax, qword [0x1400b4440]
mov ecx, dword [rax + 0x10]
mov rax, rdi
div rcx
lea rcx, str._r_nWrite_error_at_sector__lld:__s
mov rdx, rax
call fcn.1400380b9
dec dword [rsp + 0x6c]
je 0x14000df71
mov edx, 5
lea rcx, [0x14008b5e4]
call fcn.1400380b9
mov ecx, 0x1388
call qword [sym.imp.KERNEL32.DLL_Sleep]
xor r9d, r9d
xor r8d, r8d
mov rcx, qword [rsp + 0x48]
mov rdx, rdi
call qword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
test eax, eax
jne 0x14000df80
call fcn.140038579
lea rcx, [0x14008b5fe]
mov rdx, rax
call fcn.1400380b9
jmp 0x14000ddc2
mov dword [0x1400ce934], 0xc003001d
jmp 0x14000ddc2
mov ecx, 0xc8
call qword [sym.imp.KERNEL32.DLL_Sleep]
jmp 0x14000de9c
lea rcx, [0x14008b6ec]
xor esi, esi
call fcn.1400381b2
jmp 0x14000dfa8
xor r12d, r12d
xor esi, esi
xor r13d, r13d
mov rcx, qword [rsp + 0x48]
call fcn.14000a8f7
mov rax, qword [0x1400b4c60]
lea rdx, [rbx - 1]
mov al, byte [rax + 0x573]
dec eax
cmp al, 7
ja 0x14000dfda
cmp rdx, 0xfffffffffffffffd
ja 0x14000dffa
mov rcx, rbx
call qword [sym.imp.KERNEL32.DLL_CloseHandle]
jmp 0x14000dffa
cmp rdx, 0xfffffffffffffffd
ja 0x14000dffa
mov rcx, qword [rbx]
mov rdi, qword [sym.imp.KERNEL32.DLL_CloseHandle]
call rdi
mov rcx, qword [rbx + 0x28]
call rdi
mov rcx, rbx
call sub.msvcrt.dll_free
test r12, r12
je 0x14000e004
call fcn.14004826e
mov rcx, r13
call fcn.14000d184
mov rcx, rsi
call fcn.14000d184
nop
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret