Function at 0x140101240
Capabilities:
Check if file exists
Write file on windows

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
mov qword [rsp + 0x18], rdi
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x1a0]
sub rsp, 0x2a0
mov rax, qword [0x1403c13c0]
xor rax, rsp
mov qword [rbp + 0x190], rax
xor edx, edx
lea rcx, [rbp - 0x70]
mov r8d, 0x200
call fcn.1402bfc40
xor ebx, ebx
mov edi, 0x8000000
mov r12d, ebx
mov dword [rsp + 0x40], ebx
mov eax, ebx
movabs r15, 0xc80000000
movabs r13, 0x7d00000000
nop dword [rax]
mov r9d, eax
lea r8, str..PhysicalDrive_d
mov edx, 0x20
lea rcx, [rsp + 0x68]
call fcn.1400fc570
mov qword [rsp + 0x30], rbx
lea rcx, [rsp + 0x68]
mov dword [rsp + 0x28], ebx
xor r9d, r9d
mov edx, 0xc0000000
mov dword [rsp + 0x20], 3
mov r8d, 3
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x14010132b
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x1401017b1
mov r8d, eax
lea rdx, [rsp + 0x68]
lea rcx, str.CreateFile_failed_for__s._Error_code:__lu_n
call fcn.1400fc4c0
mov eax, dword [rsp + 0x40]
inc eax
mov dword [rsp + 0x40], eax
jmp 0x1401012b0
mov qword [rsp + 0x38], rbx
lea rax, [rsp + 0x48]
mov qword [rsp + 0x30], rax
xor r9d, r9d
lea rax, [rsp + 0x50]
mov dword [rsp + 0x28], 0x18
xor r8d, r8d
mov qword [rsp + 0x20], rax
mov edx, 0x70000
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x140101396
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [rsp + 0x68]
lea rcx, str.Failed_to_get_disk_geometry_for__s._Error_code:__lu_n
call fcn.1400fc4c0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [rsp + 0x40]
inc eax
mov dword [rsp + 0x40], eax
jmp 0x1401012b0
mov eax, dword [rsp + 0x60]
mov r14d, dword [rsp + 0x5c]
imul r14, rax
mov eax, dword [rsp + 0x64]
imul r14, rax
imul r14, qword [rsp + 0x50]
cmp r14, r15
jae 0x1401013be
mov r15d, 0x4000000
jmp 0x1401013cb
cmp r14, r13
mov r15d, 0x10000000
cmovb r15d, edi
mov ecx, r15d
mov edi, r15d
call fcn.140295bfc
mov qword [rsp + 0x38], rbx
mov r12, rax
lea rax, [rsp + 0x48]
xor r9d, r9d
mov qword [rsp + 0x30], rax
xor r8d, r8d
mov dword [rsp + 0x28], ebx
mov edx, 0x90018
mov rcx, rsi
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x140101431
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [rsp + 0x68]
lea rcx, str.FSCTL_LOCK_VOLUME_failed_for__s._Error_code:__lu_n
call fcn.1400fc4c0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140101793
xor r9d, r9d
xor r8d, r8d
mov edx, 0x200
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x140101471
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [rsp + 0x68]
lea rcx, str.Failed_to_set_file_pointer_for_GPT_header_on__s._Error:__lu_n
call fcn.1400fc4c0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140101793
lea r9, [rsp + 0x44]
mov qword [rsp + 0x20], rbx
mov r8d, 0x200
lea rdx, [rbp - 0x70]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1401014ba
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [rsp + 0x68]
lea rcx, str.WriteFile_failed_for_GPT_header_on__s._Error:__lu_n
call fcn.1400fc4c0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140101793
lea rdx, [rsp + 0x68]
lea rcx, str.Main_GPT_header_corrupted_on__s._n
call fcn.1400fc4c0
xor r9d, r9d
xor r8d, r8d
mov edx, 0x400
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x14010150b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [rsp + 0x68]
lea rcx, str.Failed_to_set_file_pointer_for_GPT_partition_table_on__s._Error:__lu_n
call fcn.1400fc4c0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140101793
lea r9, [rsp + 0x44]
mov qword [rsp + 0x20], rbx
mov r8d, 0x200
lea rdx, [rbp - 0x70]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x140101554
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [rsp + 0x68]
lea rcx, str.WriteFile_failed_for_GPT_partition_table_on__s._Error:__lu_n
call fcn.1400fc4c0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140101793
lea rdx, [rsp + 0x68]
lea rcx, str.Main_GPT_partition_table_corrupted_on__s._n
call fcn.1400fc4c0
xor r9d, r9d
xor r8d, r8d
mov edx, 0x1c000
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x1401015a5
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [rsp + 0x68]
lea rcx, str.Failed_to_set_file_pointer_for_backup_GPT_header_on__s._Error:__lu_n
call fcn.1400fc4c0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140101793
lea r9, [rsp + 0x44]
mov qword [rsp + 0x20], rbx
mov r8d, 0x200
lea rdx, [rbp - 0x70]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1401015ee
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [rsp + 0x68]
lea rcx, str.WriteFile_failed_for_backup_GPT_header_on__s._Error:__lu_n
call fcn.1400fc4c0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140101793
lea rdx, [rsp + 0x68]
lea rcx, str.Backup_GPT_header_corrupted_on__s._n
call fcn.1400fc4c0
xor r9d, r9d
xor r8d, r8d
mov edx, 0x1d000
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x14010163f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [rsp + 0x68]
lea rcx, str.Failed_to_set_file_pointer_for_backup_GPT_partition_table_on__s._Error:__lu_n
call fcn.1400fc4c0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140101793
lea r9, [rsp + 0x44]
mov qword [rsp + 0x20], rbx
mov r8d, 0x200
lea rdx, [rbp - 0x70]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x140101688
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [rsp + 0x68]
lea rcx, str.WriteFile_failed_for_backup_GPT_partition_table_on__s._Error:__lu_n
call fcn.1400fc4c0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140101793
lea rdx, [rsp + 0x68]
lea rcx, str.Backup_GPT_partition_table_corrupted_on__s._n
call fcn.1400fc4c0
mov r13d, ebx
nop dword [rax]
mov rdx, rdi
mov rcx, r12
call fcn.140100d30
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x14010173a
mov edi, ebx
test r14, r14
je 0x140101714
nop dword [rax + rax]
lea r9, [rsp + 0x4c]
mov qword [rsp + 0x20], rbx
mov r8d, r15d
mov rdx, r12
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1401016fa
add edi, dword [rsp + 0x4c]
mov eax, edi
cmp rax, r14
jb 0x1401016d0
jmp 0x140101714
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [rsp + 0x68]
lea rcx, str.WriteFile_failed_during_overwrite_on__s._Error:__lu_n
call fcn.1400fc4c0
inc r13d
lea r8, [rsp + 0x68]
mov edx, r13d
lea rcx, str.Disk_overwrite_pass__d_completed_on__s._n
call fcn.1400fc4c0
mov edi, r15d
cmp r13d, 7
jl 0x1401016a0
jmp 0x140101754
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, [rsp + 0x68]
lea rcx, str.Failed_to_set_file_pointer_for_overwrite_on__s._Error:__lu_n
call fcn.1400fc4c0
mov qword [rsp + 0x38], rbx
lea rax, [rsp + 0x48]
mov qword [rsp + 0x30], rax
xor r9d, r9d
mov dword [rsp + 0x28], ebx
xor r8d, r8d
mov edx, 0x9001c
mov qword [rsp + 0x20], rbx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
movabs r13, 0x7d00000000
mov eax, dword [rsp + 0x40]
movabs r15, 0xc80000000
inc eax
mov edi, 0x8000000
mov dword [rsp + 0x40], eax
jmp 0x1401012b0
mov rcx, r12
call fcn.140295840
xor eax, eax
mov rcx, qword [rbp + 0x190]
xor rcx, rsp
call fcn.140295820
lea r11, [rsp + 0x2a0]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rdi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret