Function at 0x140058318
Capabilities:
Delete directory
Delete file
Enumerate files on windows
Enumerate files recursively
Set file attributes

Disassembly:
mov qword [rsp + 0x10], rbx
mov dword [rsp + 0x18], r8d
push rbp
push rsi
push rdi
lea rbp, [rsp - 0x5b0]
sub rsp, 0x6b0
xor ebx, ebx
mov rsi, rdx
mov rdi, rcx
test rcx, rcx
je 0x14005863b
cmp word [rcx], bx
je 0x14005863b
mov rdx, rcx
lea rcx, [rsp + 0x40]
mov r8d, 0x104
call sub.msvcrt.dll_wcsncpy
mov rcx, rdi
mov word [rbp + 0x148], bx
call sub.msvcrt.dll_wcslen
test eax, eax
je 0x140058396
cmp eax, 0x104
jge 0x140058396
cdqe
cmp word [rdi + rax*2 - 2], 0x5c
je 0x140058396
lea rdx, [0x1400ced88]
lea rcx, [rsp + 0x40]
call sub.msvcrt.dll_wcscat
lea rdx, [rsp + 0x40]
lea rcx, [rbp + 0x3a0]
mov r8d, 0x104
call sub.msvcrt.dll_wcsncpy
mov word [rbp + 0x5a8], bx
test rsi, rsi
je 0x1400584d5
cmp word [rsi], bx
je 0x1400584d5
lea rdx, [0x1400ced80]
mov rcx, rsi
call sub.msvcrt.dll_wcscmp
test eax, eax
je 0x1400584d5
mov edi, dword [rbp + 0x5e0]
test dil, 1
je 0x1400584cd
lea r9, [rbp + 0x3a0]
lea r8, str._s.
lea rcx, [rsp + 0x40]
mov edx, 0x104
call sub.msvcrt.dll__snwprintf
lea rdx, [rbp + 0x150]
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov qword [rbp + 0x5d0], rax
cmp rax, 0xffffffffffffffff
je 0x1400584c6
lea rax, [rbp + 0x17c]
lea r9, [rbp + 0x3a0]
lea r8, [0x1400ceda0]
lea rcx, [rsp + 0x40]
mov edx, 0x104
mov qword [rsp + 0x20], rax
call sub.msvcrt.dll__snwprintf
test byte [rbp + 0x150], 0x10
je 0x14005849d
lea rdx, [0x1400cedac]
lea rcx, [rbp + 0x17c]
call sub.msvcrt.dll_wcscmp
test eax, eax
je 0x14005849d
lea rdx, [0x1400cedb4]
lea rcx, [rbp + 0x17c]
call sub.msvcrt.dll_wcscmp
test eax, eax
je 0x14005849d
lea rcx, [rsp + 0x40]
mov r8d, edi
mov rdx, rsi
call fcn.140058318
mov rcx, qword [rbp + 0x5d0]
lea rdx, [rbp + 0x150]
call qword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x14005842d
mov rcx, qword [rbp + 0x5d0]
call qword [sym.imp.KERNEL32.dll_FindClose]
mov edi, 1
jmp 0x1400584de
mov edi, dword [rbp + 0x5d0]
jmp 0x1400584de
lea rsi, [0x1400ced80]
mov edi, ebx
lea r9, [rbp + 0x3a0]
lea r8, [0x1400ceda0]
lea rcx, [rsp + 0x40]
mov edx, 0x104
mov dword [rbp + 0x5d0], edi
mov qword [rsp + 0x20], rsi
call sub.msvcrt.dll__snwprintf
lea rdx, [rbp + 0x150]
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov qword [rbp + 0x5e8], rax
cmp rax, 0xffffffffffffffff
je 0x14005863b
movsxd rax, edi
mov edi, dword [rbp + 0x5e0]
mov qword [rsp + 0x30], rax
lea rax, [rbp + 0x17c]
lea r9, [rbp + 0x3a0]
lea r8, [0x1400ceda0]
lea rcx, [rsp + 0x40]
mov edx, 0x104
mov qword [rsp + 0x20], rax
call sub.msvcrt.dll__snwprintf
test byte [rbp + 0x150], 0x10
je 0x1400585b6
cmp qword [rsp + 0x30], rbx
jne 0x1400585d7
test dil, 1
je 0x1400585d7
lea rdx, [0x1400cedac]
lea rcx, [rbp + 0x17c]
call sub.msvcrt.dll_wcscmp
test eax, eax
je 0x1400585d7
lea rdx, [0x1400cedb4]
lea rcx, [rbp + 0x17c]
call sub.msvcrt.dll_wcscmp
test eax, eax
je 0x1400585d7
lea rcx, [rsp + 0x40]
mov r8d, edi
mov rdx, rsi
call fcn.140058318
jmp 0x1400585d7
test dil, 2
je 0x1400585cc
lea rcx, [rsp + 0x40]
mov edx, pe_nt_image_headers64
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
mov rcx, qword [rbp + 0x5e8]
lea rdx, [rbp + 0x150]
call qword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x140058537
mov rcx, qword [rbp + 0x5e8]
call qword [sym.imp.KERNEL32.dll_FindClose]
test byte [rbp + 0x5e0], 2
mov edi, dword [rbp + 0x5d0]
je 0x140058621
lea rcx, [rbp + 0x3a0]
mov edx, pe_nt_image_headers64
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
test edi, edi
je 0x14005862c
mov ebx, 1
jmp 0x14005863b
lea rcx, [rbp + 0x3a0]
call qword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
mov ebx, eax
movsxd rax, ebx
mov rbx, qword [rsp + 0x6d8]
add rsp, 0x6b0
pop rdi
pop rsi
pop rbp
ret