Function at 0x140065320
Capabilities:
Check if file exists
Create directory
Delete file
Get file attributes
Write file on windows

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x27]
sub rsp, 0xa0
mov rsi, r8
mov r15, rdx
mov r13, rcx
xor r12d, r12d
mov qword [rbp - 1], r12
mov qword [rbp + 0xf], r12
mov qword [rbp + 0x17], 7
mov word [rbp - 1], r12w
lea r8d, [r12 + 1]
lea rdx, [0x1400b9cac]
lea rcx, [rbp - 1]
call fcn.140060bd0
nop
lea r8, [rbp - 1]
mov rdx, r13
lea rcx, [rbp - 0x39]
call fcn.140064dd0
nop
mov rdx, qword [rbp + 0x17]
cmp rdx, 8
jb 0x1400653ce
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 1]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400653c9
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x14006570c
call fcn.1400775a8
mov rcx, qword [rbp - 0x39]
mov rbx, qword [rbp - 0x31]
cmp rcx, rbx
jne 0x1400653e3
xor dil, dil
jmp 0x140065699
mov rdx, qword [rbx - 8]
cmp rdx, 8
jb 0x140065423
mov rcx, qword [rbx - 0x20]
lea rdx, [rdx*2 + 2]
cmp rdx, 0x1000
jb 0x14006541e
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x14006570c
mov rcx, r8
call fcn.1400775a8
mov word [rbx - 0x20], r12w
mov qword [rbx - 0x10], r12
mov qword [rbx - 8], 7
mov rdi, qword [rbp - 0x31]
sub rdi, 0x20
mov qword [rbp + 0x7f], rdi
mov qword [rbp - 0x31], rdi
mov qword [rbp - 0x21], r12
mov qword [rbp - 0x11], r12
mov qword [rbp - 9], 7
mov word [rbp - 0x21], r12w
mov r14, qword [rbp - 0x39]
cmp r14, rdi
je 0x1400655b2
movzx ebx, byte [rbp + 0x7f]
movabs rax, 0x7ffffffffffffffe
mov rcx, qword [r14 + 0x10]
sub rax, rcx
cmp rax, 1
jb 0x140065706
mov r9, r14
cmp qword [r14 + 0x18], 8
jb 0x140065492
mov r9, qword [r14]
mov qword [rsp + 0x30], 1
lea rax, [0x1400b9cac]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rcx
lea rcx, [rbp - 1]
call fcn.1400684d0
nop
lea r9, [rbp - 1]
mov r15, qword [rbp - 1]
mov r12, qword [rbp + 0x17]
cmp r12, 8
cmovae r9, r15
mov rcx, qword [rbp - 0x11]
mov r8, qword [rbp - 9]
mov rax, r8
sub rax, rcx
mov rdx, qword [rbp + 0xf]
cmp rdx, rax
ja 0x140065512
lea rsi, [rdx + rcx]
mov qword [rbp - 0x11], rsi
lea rdi, [rbp - 0x21]
cmp r8, 8
cmovae rdi, qword [rbp - 0x21]
lea rcx, [rdi + rcx*2]
lea r8, [rdx + rdx]
mov rdx, r9
call fcn.140079a30
xor eax, eax
mov word [rdi + rsi*2], ax
mov rdi, qword [rbp + 0x7f]
jmp 0x14006552c
mov qword [rsp + 0x20], rdx
movzx r8d, bl
lea rcx, [rbp - 0x21]
call fcn.140068280
mov r12, qword [rbp + 0x17]
mov r15, qword [rbp - 1]
cmp r12, 8
jb 0x140065567
lea rdx, [r12*2 + 2]
mov rax, r15
cmp rdx, 0x1000
jb 0x14006555f
add rdx, 0x27
mov r15, qword [r15 - 8]
sub rax, r15
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140065700
mov rcx, r15
call fcn.1400775a8
lea rcx, [rbp - 0x21]
cmp qword [rbp - 9], 8
cmovae rcx, qword [rbp - 0x21]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x140065584
test al, 0x10
jne 0x14006559a
lea rcx, [rbp - 0x21]
cmp qword [rbp - 9], 8
cmovae rcx, qword [rbp - 0x21]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
add r14, 0x20
cmp r14, rdi
jne 0x14006546a
mov rsi, qword [rbp + 0x77]
mov r15, qword [rbp + 0x6f]
xor r12d, r12d
mov rcx, r13
cmp qword [r13 + 0x18], 8
jb 0x1400655c0
mov rcx, qword [r13]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp qword [r13 + 0x18], 8
jb 0x1400655d1
mov r13, qword [r13]
mov qword [rsp + 0x30], r12
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
mov edx, 0x40000000
lea r8d, [r9 + 2]
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
dec rax
cmp rax, 0xfffffffffffffffd
ja 0x14006563d
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov qword [rsp + 0x20], r12
xor r9d, r9d
mov r8d, esi
mov rdx, r15
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov dil, 1
jmp 0x140065640
xor dil, dil
mov rdx, qword [rbp - 9]
cmp rdx, 8
jb 0x140065680
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 0x21]
mov rax, rcx
cmp rdx, 0x1000
jb 0x14006567b
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x14006570c
call fcn.1400775a8
mov qword [rbp - 0x11], r12
mov qword [rbp - 9], 7
mov word [rbp - 0x21], r12w
mov rbx, qword [rbp - 0x31]
mov rcx, qword [rbp - 0x39]
test rcx, rcx
je 0x1400656db
mov rdx, rbx
call fcn.140068440
mov rdx, qword [rbp - 0x29]
mov rcx, qword [rbp - 0x39]
sub rdx, rcx
and rdx, 0xffffffffffffffe0
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400656d6
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x1400656fa
call fcn.1400775a8
movzx eax, dil
mov rbx, qword [rsp + 0xe0]
add rsp, 0xa0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
call fcn.1400871d4
nop
call fcn.1400871d4
nop
call fcn.140006b60
nop
call fcn.1400871d4
int3