Function at 0x1800051a0
Capabilities:
Check if file exists
Delete directory
Delete file
Enumerate files on windows
Enumerate files recursively
Get file attributes
Set file attributes

Disassembly:
push rdi
sub rsp, 0x690
mov rdi, rcx
test rcx, rcx
jne 0x1800051c7
mov ecx, 0x57
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
add rsp, 0x690
pop rdi
ret
movzx eax, word [rcx]
cmp ax, 0x5c
je 0x1800051b1
test ax, ax
je 0x1800051b1
cmp ax, 0x2e
je 0x1800051b1
lea rdx, [0x18003fbf8]
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
je 0x1800051b1
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x1800051bc
not eax
test al, 0x10
jne 0x1800051b1
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
cmp eax, 1
jne 0x18000521f
add rsp, 0x690
pop rdi
ret
test eax, eax
jne 0x180005230
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x91
jne 0x1800051bc
mov rcx, rdi
mov qword [rsp + 0x6a0], rbx
call qword [sym.imp.KERNEL32.dll_lstrlenW]
lea rcx, str..
movsxd rbx, eax
call qword [sym.imp.KERNEL32.dll_lstrlenW]
lea ecx, [rax + 1]
add ecx, ebx
cmp ecx, 0x104
jle 0x180005271
xor eax, eax
mov rbx, qword [rsp + 0x6a0]
add rsp, 0x690
pop rdi
ret
lea rbx, [rbx*2 - 2]
mov qword [rsp + 0x6a8], rsi
mov r8, rdi
cmp word [rbx + rdi], 0x5c
lea rcx, [rsp + 0x270]
lea rdx, [0x18003fc10]
je 0x1800052a1
lea rdx, str._s.
call qword [sym.imp.USER32.dll_wsprintfW]
lea rdx, [rsp + 0x20]
lea rcx, [rsp + 0x270]
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
je 0x18000541a
lea rcx, [rsp + 0x270]
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
cmp word [rsp + rbx + 0x270], 0x5c
jne 0x1800052f0
xor eax, eax
mov word [rsp + rbx + 0x270], ax
nop dword [rax]
lea rdx, [0x18003fc30]
lea rcx, [rsp + 0x4c]
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
je 0x1800053ee
lea rdx, [0x18003fbf8]
lea rcx, [rsp + 0x4c]
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
je 0x1800053ee
lea rcx, [0x18003fc34]
call qword [sym.imp.KERNEL32.dll_lstrlenW]
lea rcx, [rsp + 0x4c]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_lstrlenW]
lea rcx, [rsp + 0x270]
add ebx, eax
call qword [sym.imp.KERNEL32.dll_lstrlenW]
lea ecx, [rax + 1]
add ecx, ebx
cmp ecx, 0x104
jg 0x1800053ee
lea r9, [rsp + 0x4c]
lea r8, [rsp + 0x270]
lea rdx, [0x18003fc38]
lea rcx, [rsp + 0x480]
call qword [sym.imp.USER32.dll_wsprintfW]
mov eax, dword [rsp + 0x20]
test al, 0x10
je 0x1800053c5
test al, 1
je 0x1800053a8
and eax, 0xfffffffe
lea rcx, [rsp + 0x480]
mov edx, eax
mov dword [rsp + 0x20], eax
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, dword [rsp + 0x20]
lea rcx, [rsp + 0x480]
bt eax, 0xa
jae 0x1800053be
call qword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
jmp 0x1800053ee
call fcn.1800051a0
jmp 0x1800053ee
test al, 1
jne 0x1800053cd
test al, 4
je 0x1800053e0
lea rcx, [rsp + 0x480]
mov edx, 0x80
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea rcx, [rsp + 0x480]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
lea rdx, [rsp + 0x20]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x1800052f0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, rsi
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_FindClose]
cmp ebx, 0x12
je 0x18000541e
xor eax, eax
jmp 0x180005427
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
mov rsi, qword [rsp + 0x6a8]
mov rbx, qword [rsp + 0x6a0]
add rsp, 0x690
pop rdi
ret