Function at 0x140005870
Capabilities:
Clear file content
Get file size
Write file on windows

Disassembly:
mov rax, rsp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x80
mov qword [rax - 0x68], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x20], rbp
mov rax, qword [section..data]
xor rax, rsp
mov qword [rsp + 0x78], rax
movzx r14d, r9b
mov rdi, r8
mov r12, rdx
xor sil, sil
mov r9, rdx
lea rdx, str.Creating_file__s_of_size__I64u._n
movzx ecx, byte [rsp + 0xd0]
call fcn.140002960
lea rcx, str.SeManageVolumePrivilege
call fcn.1400024e0
test al, al
jne 0x1400058ec
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.WARNING:_Could_not_set_privileges_for_setting_valid_file_size__will_use_a_slower_method_of_preparing_the_file_n
call fcn.140002900
mov sil, 1
mov rdx, rdi
call fcn.140005760
test eax, eax
je 0x14000590b
cmp eax, 0x32
je 0x14000590b
mov edx, eax
lea rcx, str.WARNING:_Could_not_create_intermediate_directory__error_code:__u__n
call fcn.140002900
xor ebx, ebx
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
mov edx, 0x40000000
lea r8d, [rbx + 2]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov rbp, rax
cmp rax, 0xffffffffffffffff
jne 0x14000595b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.Could_not_create_the_file__error_code:__u__n
call fcn.140002900
xor al, al
jmp 0x140005c09
test r12, r12
je 0x140005bcc
xor r9d, r9d
lea r8, [rsp + 0x50]
mov rdx, r12
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x1400059a0
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.Could_not_set_file_pointer_during_file_creation_when_extending_file__error_code:__u__n
mov edx, eax
call fcn.140002900
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
jmp 0x140005c09
cmp qword [rsp + 0x50], r12
je 0x1400059c3
lea rcx, str.File_pointer_improperly_moved_during_file_creation_when_extending_file_n
call fcn.140002900
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
jmp 0x140005c09
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x1400059df
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.Error_setting_end_of_file__error_code:__u__n
jmp 0x140005989
test sil, sil
jne 0x140005a0c
mov rdx, r12
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_SetFileValidData]
test eax, eax
jne 0x140005bcc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.WARNING:_Could_not_set_valid_file_size__error_code:__u___trying_a_slower_method_of_filling_the_file__this_does_not_affect_performance__just_makes_the_test_preparation_longer__n
call fcn.140002900
xor r9d, r9d
lea r8, [rsp + 0x50]
mov rdx, rbx
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x140005a36
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.Could_not_set_file_pointer_during_file_creation__error_code:__u__n
jmp 0x140005989
cmp qword [rsp + 0x50], rbx
je 0x140005a4e
lea rcx, str.File_pointer_improperly_moved_during_file_creation_n
call fcn.140002900
jmp 0x140005990
mov esi, 0x100000
cmp r12, rsi
cmovb esi, r12d
xor eax, eax
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x68], rax
mov r15d, esi
mov edx, esi
lea rcx, [rsp + 0x58]
call fcn.140007b80
nop
mov eax, ebx
mov rdi, qword [rsp + 0x58]
test esi, esi
je 0x140005aa5
mov rdx, rdi
nop dword [rax]
test r14b, r14b
mov ecx, ebx
jne 0x140005a9a
movzx ecx, al
mov byte [rdx], cl
inc eax
inc rdx
cmp eax, esi
jb 0x140005a90
mov r14, r12
nop dword [rax + rax]
cmp r15, r14
cmova esi, r14d
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x48]
mov r8d, esi
mov rdx, rdi
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x140005b4f
cmp dword [rsp + 0x48], esi
jne 0x140005b41
mov r15d, esi
sub r14, r15
jne 0x140005ab0
test rdi, rdi
je 0x140005bcc
mov rax, qword [rsp + 0x68]
sub rax, rdi
cmp rax, 0x1000
jb 0x140005b34
test dil, 0x1f
je 0x140005b07
call fcn.140025594
int3
mov rax, qword [rdi - 8]
cmp rax, rdi
jb 0x140005b16
call fcn.140025594
int3
sub rdi, rax
cmp rdi, 8
jae 0x140005b25
call fcn.140025594
int3
cmp rdi, 0x27
jbe 0x140005b31
call fcn.140025594
int3
mov rdi, rax
mov rcx, rdi
call fcn.14001d3f4
jmp 0x140005bcc
lea rcx, str.Improperly_written_data_during_file_creation_n
call fcn.140002900
jmp 0x140005b63
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.Error_while_writng_during_file_creation__error_code:__u__n
call fcn.140002900
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
test rdi, rdi
je 0x140005999
mov rax, qword [rsp + 0x68]
sub rax, rdi
cmp rax, 0x1000
jb 0x140005bbf
test dil, 0x1f
je 0x140005b92
call fcn.140025594
int3
mov rax, qword [rdi - 8]
cmp rax, rdi
jb 0x140005ba1
call fcn.140025594
int3
sub rdi, rax
cmp rdi, 8
jae 0x140005bb0
call fcn.140025594
int3
cmp rdi, 0x27
jbe 0x140005bbc
call fcn.140025594
int3
mov rdi, rax
mov rcx, rdi
call fcn.14001d3f4
jmp 0x140005999
lea rdx, [rsp + 0x70]
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x140005bfe
cmp qword [rsp + 0x70], r12
je 0x140005bfe
mov r8d, 0x7b4
lea rdx, str.....IORequestGeneratorIORequestGenerator.cpp
lea rcx, str.li.QuadPart___LONGLONG_ullFileSize
call fcn.140027440
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
mov rcx, qword [rsp + 0x78]
xor rcx, rsp
call fcn.14001d3d0
lea r11, [rsp + 0x80]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret