Function at 0x180005660
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 0x180005687
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 0x180005671
test ax, ax
je 0x180005671
cmp ax, 0x2e
je 0x180005671
lea rdx, [0x180041bf8]
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
je 0x180005671
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x18000567c
not eax
test al, 0x10
jne 0x180005671
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
cmp eax, 1
jne 0x1800056df
add rsp, 0x690
pop rdi
ret
test eax, eax
jne 0x1800056f0
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x91
jne 0x18000567c
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 0x180005731
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, [0x180041c10]
je 0x180005761
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 0x1800058da
lea rcx, [rsp + 0x270]
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
cmp word [rsp + rbx + 0x270], 0x5c
jne 0x1800057b0
xor eax, eax
mov word [rsp + rbx + 0x270], ax
nop dword [rax]
lea rdx, [0x180041c30]
lea rcx, [rsp + 0x4c]
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
je 0x1800058ae
lea rdx, [0x180041bf8]
lea rcx, [rsp + 0x4c]
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
je 0x1800058ae
lea rcx, [0x180041c34]
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 0x1800058ae
lea r9, [rsp + 0x4c]
lea r8, [rsp + 0x270]
lea rdx, [0x180041c38]
lea rcx, [rsp + 0x480]
call qword [sym.imp.USER32.dll_wsprintfW]
mov eax, dword [rsp + 0x20]
test al, 0x10
je 0x180005885
test al, 1
je 0x180005868
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 0x18000587e
call qword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
jmp 0x1800058ae
call fcn.180005660
jmp 0x1800058ae
test al, 1
jne 0x18000588d
test al, 4
je 0x1800058a0
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 0x1800057b0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, rsi
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_FindClose]
cmp ebx, 0x12
je 0x1800058de
xor eax, eax
jmp 0x1800058e7
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