Function at 0x140065390
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, [0x1400bbcec]
lea rcx, [rbp - 1]
call fcn.140060c40
nop
lea r8, [rbp - 1]
mov rdx, r13
lea rcx, [rbp - 0x39]
call fcn.140064e40
nop
mov rdx, qword [rbp + 0x17]
cmp rdx, 8
jb 0x14006543e
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 1]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140065439
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x14006577c
call fcn.140078e58
mov rcx, qword [rbp - 0x39]
mov rbx, qword [rbp - 0x31]
cmp rcx, rbx
jne 0x140065453
xor dil, dil
jmp 0x140065709
mov rdx, qword [rbx - 8]
cmp rdx, 8
jb 0x140065493
mov rcx, qword [rbx - 0x20]
lea rdx, [rdx*2 + 2]
cmp rdx, 0x1000
jb 0x14006548e
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x14006577c
mov rcx, r8
call fcn.140078e58
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 0x140065622
movzx ebx, byte [rbp + 0x7f]
movabs rax, 0x7ffffffffffffffe
mov rcx, qword [r14 + 0x10]
sub rax, rcx
cmp rax, 1
jb 0x140065776
mov r9, r14
cmp qword [r14 + 0x18], 8
jb 0x140065502
mov r9, qword [r14]
mov qword [rsp + 0x30], 1
lea rax, [0x1400bbcec]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rcx
lea rcx, [rbp - 1]
call fcn.140068540
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 0x140065582
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.14007b2e0
xor eax, eax
mov word [rdi + rsi*2], ax
mov rdi, qword [rbp + 0x7f]
jmp 0x14006559c
mov qword [rsp + 0x20], rdx
movzx r8d, bl
lea rcx, [rbp - 0x21]
call fcn.1400682f0
mov r12, qword [rbp + 0x17]
mov r15, qword [rbp - 1]
cmp r12, 8
jb 0x1400655d7
lea rdx, [r12*2 + 2]
mov rax, r15
cmp rdx, 0x1000
jb 0x1400655cf
add rdx, 0x27
mov r15, qword [r15 - 8]
sub rax, r15
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140065770
mov rcx, r15
call fcn.140078e58
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 0x1400655f4
test al, 0x10
jne 0x14006560a
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 0x1400654da
mov rsi, qword [rbp + 0x77]
mov r15, qword [rbp + 0x6f]
xor r12d, r12d
mov rcx, r13
cmp qword [r13 + 0x18], 8
jb 0x140065630
mov rcx, qword [r13]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp qword [r13 + 0x18], 8
jb 0x140065641
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 0x1400656ad
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 0x1400656b0
xor dil, dil
mov rdx, qword [rbp - 9]
cmp rdx, 8
jb 0x1400656f0
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 0x21]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400656eb
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x14006577c
call fcn.140078e58
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 0x14006574b
mov rdx, rbx
call fcn.1400684b0
mov rdx, qword [rbp - 0x29]
mov rcx, qword [rbp - 0x39]
sub rdx, rcx
and rdx, 0xffffffffffffffe0
mov rax, rcx
cmp rdx, 0x1000
jb 0x140065746
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x14006576a
call fcn.140078e58
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.140088a84
nop
call fcn.140088a84
nop
call fcn.140006c00
nop
call fcn.140088a84
int3