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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x148
push edi
mov edi, dword [ebp + 8]
push edi
call fcn.00405f49
test byte [ebp + 0xc], 8
mov dword [ebp - 8], eax
je 0x4065ca
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
neg eax
sbb eax, eax
inc eax
add dword [0x4488c8], eax
jmp 0x4067b6
push ebx
mov ebx, dword [ebp + 0xc]
and ebx, 1
push esi
mov dword [ebp - 4], ebx
je 0x4065e9
test eax, eax
je 0x406734
test byte [ebp + 0xc], 2
je 0x406734
push edi
mov esi, 0x43d778
push esi
call fcn.00405cc5
test ebx, ebx
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcatA]
je 0x406609
push str..
push esi
call ebx
jmp 0x40660f
push edi
call fcn.00405f22
cmp byte [edi], 0
jne 0x40661d
cmp byte [0x43d778], 0x5c
jne 0x406625
push 0x408534
push edi
call ebx
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ebx, eax
lea eax, [ebp - 0x148]
push eax
push esi
add ebx, edi
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
mov dword [ebp + 8], eax
je 0x40672a
lea esi, [ebp - 0x11c]
push 0x3f
mov eax, esi
push eax
call fcn.00405a63
cmp byte [eax], 0
je 0x406668
cmp byte [ebp - 0x18], 0
je 0x406668
lea esi, [ebp - 0x18]
cmp byte [esi], 0x2e
jne 0x406686
mov al, byte [esi + 1]
test al, al
je 0x406709
cmp al, 0x2e
jne 0x406686
cmp byte [esi + 2], 0
je 0x406709
push esi
push ebx
call fcn.00405cc5
test byte [ebp - 0x148], 0x10
je 0x4066ab
mov eax, dword [ebp + 0xc]
and eax, 3
cmp al, 3
jne 0x406709
push dword [ebp + 0xc]
push edi
call fcn.00406597
jmp 0x406709
push edi
push str.Delete:_DeleteFile___s__
call fcn.004063ce
pop ecx
pop ecx
push edi
call fcn.00405b15
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
push edi
jne 0x406702
test byte [ebp + 0xc], 4
je 0x4066ee
push str.Delete:_DeleteFile_on_Reboot___s__
call fcn.004063ce
pop ecx
pop ecx
push edi
push 0xfffffffffffffff1
call fcn.00404d14
push 0
push edi
call fcn.004063fe
jmp 0x406709
push str.Delete:_DeleteFile_failed___s__
call fcn.004063ce
inc dword [0x4488c8]
pop ecx
pop ecx
jmp 0x406709
push 0xfffffffffffffff2
call fcn.00404d14
lea eax, [ebp - 0x148]
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x40664a
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_FindClose]
cmp dword [ebp - 4], 0
je 0x406734
mov byte [ebx - 1], 0
xor esi, esi
cmp dword [ebp - 4], esi
je 0x4067b4
cmp dword [ebp - 8], esi
push edi
jne 0x406748
push str.RMDir:_RemoveDirectory_invalid_input___s__
jmp 0x40679e
call fcn.00405e64
test eax, eax
je 0x4067b4
push edi
call fcn.00405ef5
push edi
push str.RMDir:_RemoveDirectory___s__
call fcn.004063ce
pop ecx
pop ecx
push edi
call fcn.00405b15
push edi
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryA]
test eax, eax
push edi
jne 0x4067ad
test byte [ebp + 0xc], 4
je 0x406799
push str.RMDir:_RemoveDirectory_on_Reboot___s__
call fcn.004063ce
pop ecx
pop ecx
push edi
push 0xfffffffffffffff1
call fcn.00404d14
push esi
push edi
call fcn.004063fe
jmp 0x4067b4
push str.RMDir:_RemoveDirectory_failed___s__
call fcn.004063ce
inc dword [0x4488c8]
pop ecx
pop ecx
jmp 0x4067b4
push 0xffffffffffffffe5
call fcn.00404d14
pop esi
pop ebx
pop edi
leave
ret 8