Function at 0x140020ff4
Capabilities:
Check if file exists
Clear file content
Delete file
Get file attributes

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r13
push r14
push r15
sub rsp, 0x70
mov rax, qword [0x14007b108]
xor rax, rsp
mov qword [rsp + 0x60], rax
mov rax, qword [rsp + 0xd8]
xor ebp, ebp
mov r14, qword [rsp + 0xd0]
xor ebx, ebx
mov qword [rsp + 0x48], rax
mov esi, r9d
mov r15d, r8d
mov rdi, rdx
mov r13, rcx
test rdx, rdx
je 0x1400212f9
test rax, rax
je 0x1400212f9
cmp r9d, 2
jne 0x140021074
bt r8d, 8
jb 0x140021074
mov rcx, qword [rdx + 8]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
nop dword [rax + rax]
cmp eax, 0xffffffff
je 0x140021074
mov rcx, qword [rdi + 8]
call fcn.14001a730
mov rdx, qword [rdi + 8]
or r15d, 0x2200000
cmp qword [r13 + 0x40], rbx
mov ecx, 0xc0110100
mov r8d, 0xc11d0100
mov dword [rsp + 0x30], r15d
mov rax, r13
mov dword [rsp + 0x28], esi
cmovne rax, qword [r13 + 0x40]
mov eax, dword [rax + 0x24]
mov dword [rsp + 0x40], eax
and eax, 0x30000
cmp eax, 0x10000
cmovne r8d, ecx
mov rcx, r13
call fcn.14001bf68
mov rsi, rax
cmp rax, 0xffffffffffffffff
je 0x140021266
test r14, r14
je 0x140021129
mov rdx, qword [r14]
xor r9d, r9d
xor r8d, r8d
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
nop dword [rax + rax]
test eax, eax
je 0x1400211fa
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
nop dword [rax + rax]
test eax, eax
je 0x1400211fa
mov rdx, qword [0x14007b998]
xor r9d, r9d
xor r8d, r8d
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
nop dword [rax + rax]
test eax, eax
je 0x1400211fa
mov ebp, 1
bt r15d, 9
jb 0x140021159
test r14, r14
je 0x140021249
test dword [rsp + 0x40], 0x1000000
je 0x140021249
test r15d, 0x4000100
jne 0x140021249
cmp dword [rdi + 0x20], ebx
jne 0x140021249
and qword [rsp + 0x38], rbx
lea rax, [rsp + 0x40]
mov qword [rsp + 0x30], rax
xor r9d, r9d
and dword [rsp + 0x28], ebx
xor r8d, r8d
and qword [rsp + 0x20], rbx
mov edx, 0x900c4
mov rcx, rsi
xor ebp, ebp
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
nop dword [rax + rax]
test eax, eax
je 0x1400211ee
and qword [rsp + 0x50], rbx
test r14, r14
je 0x1400211e5
and qword [rsp + 0x38], rbx
lea r9d, [rbp + 0x10]
mov rax, qword [r14]
lea r8, [rsp + 0x50]
mov qword [rsp + 0x58], rax
mov edx, 0x980c8
lea rax, [rsp + 0x40]
mov rcx, rsi
mov qword [rsp + 0x30], rax
and dword [rsp + 0x28], ebx
and qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
nop dword [rax + rax]
mov ebp, eax
jmp 0x1400211ea
mov ebp, 1
test ebp, ebp
jne 0x140021249
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
cmp dword [rsp + 0xe0], 0
mov ebx, eax
je 0x1400212be
mov dword [rsp + 0x30], 0xdbc
lea rcx, str.CreateDestinationFileEx
movzx r8d, ax
lea r9, str.SetFileSize_failed
or r8d, 0x80070000
mov qword [rsp + 0x28], rcx
test eax, eax
cmovle r8d, eax
mov dword [rsp + 0x20], r8d
jmp 0x1400212a9
mov rax, qword [rsp + 0x48]
mov rdx, rsi
mov rcx, r13
mov qword [rax], rsi
mov r9, qword [rdi + 0x18]
mov r8, qword [rdi + 8]
call fcn.14001a260
jmp 0x1400212ba
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov ebx, eax
cmp dword [rsp + 0xe0], ebp
je 0x1400212e3
mov dword [rsp + 0x30], 0xdc7
lea rcx, str.CreateDestinationFileEx
movzx eax, bx
lea r9, str.CreateFile_failed
or eax, 0x80070000
mov qword [rsp + 0x28], rcx
test ebx, ebx
cmovle eax, ebx
mov dword [rsp + 0x20], eax
mov r8, qword [rdi + 8]
mov rdx, r13
mov ecx, 1
call fcn.14000b4d0
test ebp, ebp
jne 0x1400212e3
cmp rsi, 0xffffffffffffffff
je 0x1400212e3
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop dword [rax + rax]
mov rcx, qword [rdi + 8]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
nop dword [rax + rax]
test ebx, ebx
je 0x1400212f5
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop dword [rax + rax]
mov eax, ebp
jmp 0x14002130c
mov ecx, 0x57
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop dword [rax + rax]
xor eax, eax
mov rcx, qword [rsp + 0x60]
xor rcx, rsp
call fcn.140068870
add rsp, 0x70
pop r15
pop r14
pop r13
pop rdi
pop rsi
pop rbp
pop rbx
ret