Function at 0x14022c680
Capabilities:
Check if file exists
Delete file
Get file attributes
Set file attributes

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x288
mov rsi, rcx
mov rax, qword [0x14039ce38]
xor rax, rsp
mov qword [rsp + 0x280], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x14022c50d
test eax, 0x400
jne 0x14022c640
test al, 0x10
jne 0x14022c444
mov rcx, qword [rsp + 0x280]
xor rcx, rsp
call fcn.140258ea0
mov rcx, rsi
add rsp, 0x288
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
jmp 0x14022c680
mov rbx, qword [rsi]
mov rax, qword [rsi + 8]
mov edi, 0x7fff
mov edx, 0x7fff
sub rdx, rax
lea rcx, [rbx + rax*2]
lea r8, [0x140298b32]
lea r9, [0x140345ba8]
call fcn.140012ac0
mov word [rbx + 0xfffe], 0
test eax, eax
js 0x14022c514
movsxd rbx, eax
sub rdi, qword [rsi + 8]
cmp rdi, rbx
jl 0x14022c514
lea rcx, [0x140345ba8]
mov edx, 0x8000
call fcn.14026cad4
cmp rax, rbx
jne 0x14022c514
add qword [rsi + 8], rbx
mov rcx, qword [rsi]
lea rdx, [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp rax, 0xffffffffffffffff
je 0x14022c50d
mov rdi, rax
mov rax, qword [rsi]
mov rdx, qword [rsi + 8]
shl rdx, 0x20
movabs rcx, 0xffffffff00000000
mov qword [rsp + 0x28], rdx
add rcx, rdx
mov r13, rcx
sar r13, 0x20
mov qword [rsi + 8], r13
sar rcx, 0x1f
mov word [rax + rcx], 0
lea rbx, [rsp + 0x5c]
lea r14, [0x140345bb2]
lea r15, [rsp + 0x30]
mov rbp, qword [sym.imp.KERNEL32.dll_FindNextFileW]
jmp 0x14022c55e
xor esi, esi
jmp 0x14022c64f
mov ecx, reloc.WS2_32.dll_WSAGetLastError
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor esi, esi
jmp 0x14022c64f
mov rcx, rsi
call 0x14022c680
test al, al
je 0x14022c600
nop word cs:[rax + rax]
mov qword [rsi + 8], r13
mov rax, qword [rsi]
mov word [rax + r13*2], 0
mov rcx, rdi
mov rdx, r15
call rbp
test eax, eax
je 0x14022c600
mov rcx, rbx
mov rdx, r14
call fcn.14027dd20
test eax, eax
je 0x14022c540
mov rcx, rbx
lea rdx, [0x140345bb6]
call fcn.14027dd20
test eax, eax
je 0x14022c540
mov r12, qword [rsi]
mov rax, qword [rsi + 8]
mov edx, 0x7fff
sub rdx, rax
lea rcx, [r12 + rax*2]
lea r8, [0x140298b32]
mov r9, rbx
call fcn.140012ac0
mov word [r12 + 0xfffe], 0
test eax, eax
js 0x14022c5f5
movsxd r12, eax
mov eax, 0x7fff
sub rax, qword [rsi + 8]
cmp rax, r12
jl 0x14022c5f5
mov edx, 0x8000
mov rcx, rbx
call fcn.14026cad4
cmp rax, r12
jne 0x14022c5f5
add qword [rsi + 8], r12
test byte [rsp + 0x30], 0x10
je 0x14022c526
mov rcx, rsi
call fcn.14022c3d0
test al, al
jne 0x14022c540
jmp 0x14022c600
mov ecx, reloc.WS2_32.dll_WSAGetLastError
call qword [sym.imp.KERNEL32.dll_SetLastError]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_FindClose]
cmp ebx, 0x12
jne 0x14022c675
movabs rax, 0xfffffffe00000000
mov rcx, qword [rsp + 0x28]
add rcx, rax
mov rax, rcx
sar rax, 0x20
mov qword [rsi + 8], rax
mov rax, qword [rsi]
sar rcx, 0x1f
mov word [rax + rcx], 0
mov rcx, qword [rsi]
call qword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
test eax, eax
setne sil
mov rcx, qword [rsp + 0x280]
xor rcx, rsp
call fcn.140258ea0
mov eax, esi
add rsp, 0x288
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov ecx, ebx
jmp 0x14022c519
push rsi
sub rsp, 0x20
mov rsi, rcx
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
mov ecx, eax
mov al, 1
test ecx, ecx
jne 0x14022c6df
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
jne 0x14022c6dd
mov rcx, qword [rsi]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov edx, eax
xor eax, eax
cmp edx, 0xffffffff
je 0x14022c6df
mov ecx, edx
and ecx, 1
je 0x14022c6df
and edx, 0xfffffffe
mov rcx, qword [rsi]
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
test eax, eax
je 0x14022c6dd
mov rcx, qword [rsi]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
setne al
jmp 0x14022c6df
xor eax, eax
add rsp, 0x20
pop rsi
ret