Function at 0x406caf
Capabilities:
Delete directory
Delete file
Enumerate files on windows
Enumerate files recursively

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x25c
push edi
mov edi, dword [ebp + 8]
push edi
call fcn.00406798
test byte [ebp + 0xc], 8
mov dword [ebp - 0xc], eax
je 0x406ce2
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
neg eax
sbb eax, eax
inc eax
add dword [0x473e88], eax
jmp 0x406ee1
push ebx
mov ebx, dword [ebp + 0xc]
and ebx, 1
push esi
mov dword [ebp - 4], ebx
je 0x406d01
test eax, eax
je 0x406e5f
test byte [ebp + 0xc], 2
je 0x406e5f
push edi
mov esi, 0x45d918
push esi
call fcn.0040602d
test ebx, ebx
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcatW]
je 0x406d21
push str..
push esi
call ebx
jmp 0x406d27
push edi
call fcn.0040676c
cmp word [edi], 0
jne 0x406d37
cmp word [0x45d918], 0x5c
jne 0x406d3f
push 0x4098a0
push edi
call ebx
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea eax, [edi + eax*2]
mov dword [ebp - 8], eax
lea eax, [ebp - 0x25c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
mov dword [ebp + 8], eax
je 0x406e50
lea esi, [ebp - 0x230]
push 0x3f
mov eax, esi
push eax
call fcn.00405d2c
xor ebx, ebx
cmp word [eax], bx
je 0x406d86
cmp word [ebp - 0x28], bx
je 0x406d86
lea esi, [ebp - 0x28]
cmp word [esi], 0x2e
jne 0x406da9
movzx eax, word [esi + 2]
cmp ax, bx
je 0x406e2d
cmp ax, 0x2e
jne 0x406da9
cmp word [esi + 4], bx
je 0x406e2d
push esi
push dword [ebp - 8]
call fcn.0040602d
test byte [ebp - 0x25c], 0x10
je 0x406dd0
mov eax, dword [ebp + 0xc]
and eax, 3
cmp al, 3
jne 0x406e2d
push dword [ebp + 0xc]
push edi
call fcn.00406caf
jmp 0x406e2d
push edi
push str.Delete:_DeleteFile___s__
call fcn.004062c7
pop ecx
pop ecx
push edi
call fcn.00405e57
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
push edi
jne 0x406e26
test byte [ebp + 0xc], 4
je 0x406e12
push str.Delete:_DeleteFile_on_Reboot___s__
call fcn.004062c7
pop ecx
pop ecx
push edi
push 0xfffffffffffffff1
call fcn.00404fa5
push ebx
push edi
call fcn.00406c7c
jmp 0x406e2d
push str.Delete:_DeleteFile_failed___s__
call fcn.004062c7
inc dword [0x473e88]
pop ecx
pop ecx
jmp 0x406e2d
push 0xfffffffffffffff2
call fcn.00404fa5
lea eax, [ebp - 0x25c]
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x406d66
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_FindClose]
jmp 0x406e52
xor ebx, ebx
cmp dword [ebp - 4], ebx
je 0x406e5f
mov eax, dword [ebp - 8]
and word [eax - 2], 0
xor esi, esi
cmp dword [ebp - 4], esi
je 0x406edf
cmp dword [ebp - 0xc], esi
push edi
jne 0x406e73
push str.RMDir:_RemoveDirectory_invalid_input___s__
jmp 0x406ec9
call fcn.004062f9
test eax, eax
je 0x406edf
push edi
call fcn.0040673d
push edi
push str.RMDir:_RemoveDirectory___s__
call fcn.004062c7
pop ecx
pop ecx
push edi
call fcn.00405e57
push edi
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
test eax, eax
push edi
jne 0x406ed8
test byte [ebp + 0xc], 4
je 0x406ec4
push str.RMDir:_RemoveDirectory_on_Reboot___s__
call fcn.004062c7
pop ecx
pop ecx
push edi
push 0xfffffffffffffff1
call fcn.00404fa5
push esi
push edi
call fcn.00406c7c
jmp 0x406edf
push str.RMDir:_RemoveDirectory_failed___s__
call fcn.004062c7
inc dword [0x473e88]
pop ecx
pop ecx
jmp 0x406edf
push 0xffffffffffffffe5
call fcn.00404fa5
pop esi
pop ebx
pop edi
leave
ret 8