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

Disassembly:
push 0x16c
mov eax, 0x46b8ab
call fcn.0042dc0b
mov eax, dword [ebp + 8]
lea ecx, [ebp - 0x158]
xor ebx, ebx
mov dword [ebp - 0x170], eax
mov byte [ebp - 0x151], bl
call fcn.0040699e
mov dword [ebp - 4], ebx
mov byte [ebp - 0x159], bl
mov dword [ebp - 0x16c], ebx
mov dword [ebp - 0x168], ebx
mov dword [ebp - 0x164], ebx
mov edi, 0x104
mov byte [ebp - 4], 1
push edi
call fcn.00432c26
mov esi, eax
push edi
mov dword [ebp - 0x178], esi
call fcn.00432c26
mov ebx, eax
push edi
mov dword [ebp - 0x160], ebx
call fcn.00432c26
add esp, 0xc
mov edi, eax
test esi, esi
je 0x4185e6
test ebx, ebx
je 0x4185e6
test edi, edi
je 0x4185e6
push dword [ebp - 0x170]
lea eax, [ebp - 0x158]
push str.IN_Operations::_RemoveDirectory_:_Entering__RemoveDirectory__s_
push eax
call fcn.00406b1a
mov eax, dword [ebp - 0x158]
add esp, 0xc
cmp dword [eax - 4], 1
jle 0x418372
push dword [eax - 0xc]
lea ecx, [ebp - 0x158]
call fcn.00406aae
mov eax, dword [ebp - 0x158]
push 4
mov ebx, 0x493f4c
push eax
mov ecx, ebx
call fcn.0040c5b8
push 1
push edi
push dword [ebp - 0x170]
call fcn.0041618b
add esp, 0xc
test al, al
jne 0x4183be
call fcn.00413e75
test al, al
je 0x4183ab
mov byte [ebp - 0x151], 0
jmp 0x4185f9
mov byte [ebp - 0x159], 1
mov byte [ebp - 0x151], 1
jmp 0x4185f9
push str..
push edi
push 0x471a0c
push 0x104
push esi
call fcn.00404ae0
add esp, 0x14
lea eax, [ebp - 0x150]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x418456
cmp byte [ebp - 0x124], 0x2e
je 0x418443
lea eax, [ebp - 0x124]
push eax
push 0x46f9b8
push edi
push 0x473288
push 0x104
push dword [ebp - 0x160]
call fcn.00404ae0
add esp, 0x18
test byte [ebp - 0x150], 0x10
push dword [ebp - 0x160]
je 0x418439
call fcn.004182aa
pop ecx
test al, al
je 0x4185f9
jmp 0x418443
call fcn.0041891a
pop ecx
test al, al
je 0x418475
lea eax, [ebp - 0x150]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
cmp eax, 1
je 0x4183ec
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x12
je 0x4184b8
push edi
call esi
push eax
push str.IN_Operations::_RemoveDirectory_:_Unexpected_error__d__not_all_files_are_removed_in_directory__s
jmp 0x418481
push edi
push dword [ebp - 0x160]
push str.IN_Operations::_RemoveDirectory_:_Failed_to_remove_file__s_while_deleting_directory__s
lea eax, [ebp - 0x158]
push eax
call fcn.00406b1a
add esp, 0x10
mov eax, dword [ebp - 0x158]
cmp dword [eax - 4], 1
jle 0x4184b0
push dword [eax - 0xc]
lea ecx, [ebp - 0x158]
call fcn.00406aae
mov eax, dword [ebp - 0x158]
push 4
push eax
jmp 0x4185f2
push 0x80
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
test eax, eax
jne 0x41856c
call esi
push eax
lea eax, [ebp - 0x158]
push str.SetFileAttributes___failed._Error:__d
push eax
call fcn.00406b1a
mov eax, dword [ebp - 0x158]
add esp, 0xc
cmp dword [eax - 4], 1
jle 0x418503
push dword [eax - 0xc]
lea ecx, [ebp - 0x158]
call fcn.00406aae
mov eax, dword [ebp - 0x158]
push 7
push eax
mov ecx, ebx
call fcn.0040c5b8
push edi
lea eax, [ebp - 0x158]
push str.IN_Operations::_RemoveDirectory_:_Failed_to_set_file_attribute_for_directory__s_to_normal
push eax
call fcn.00406b1a
mov eax, dword [ebp - 0x158]
add esp, 0xc
cmp dword [eax - 4], 1
jle 0x418542
push dword [eax - 0xc]
lea ecx, [ebp - 0x158]
call fcn.00406aae
mov eax, dword [ebp - 0x158]
push 4
push eax
mov ecx, ebx
call fcn.0040c5b8
cmp byte [0x493f5e], 1
jne 0x4185f9
push 4
push str.IN__RemoveDirectory_:_SetFileAttributes___failed._Returning_true_since_MGS_installed
mov ecx, ebx
call fcn.0040c5b8
jmp 0x4183b2
lea eax, [ebp - 0x16c]
push eax
push edi
call fcn.00413ed0
mov eax, dword [ebp - 0x168]
mov esi, dword [ebp - 0x16c]
mov dword [ebp - 0x174], eax
pop ecx
pop ecx
cmp esi, eax
je 0x4183b2
mov ecx, esi
call fcn.0040d3bb
push eax
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryA]
test eax, eax
jne 0x4185bc
push 1
mov ecx, esi
call fcn.0040d3bb
push eax
call fcn.00418d7b
pop ecx
pop ecx
test al, al
je 0x4185cc
add esi, 4
cmp esi, dword [ebp - 0x174]
jne 0x418595
jmp 0x4183b2
push edi
lea eax, [ebp - 0x158]
push str.IN_Operations::_RemoveDirectory_:_Failed_to_remove_directory__s
push eax
call fcn.00406b1a
add esp, 0xc
jmp 0x418490
push 6
push str.Operations::_RemoveDirectory__szPattern
mov ebx, 0x493f4c
mov ecx, ebx
call fcn.0040c5b8
call fcn.00413e75
test al, al
je 0x4186e5
mov byte [ebp - 0x151], 0
push dword [ebp - 0x170]
lea eax, [ebp - 0x158]
push str.Failed_to_remove__s
push eax
call fcn.00406b1a
mov esi, dword [ebp - 0x158]
add esp, 0xc
cmp dword [esi - 4], 1
jle 0x418647
push dword [esi - 0xc]
lea ecx, [ebp - 0x158]
call fcn.00406aae
mov esi, dword [ebp - 0x158]
push 3
push esi
mov ecx, ebx
call fcn.0040c5b8
mov eax, dword [ebp - 0x178]
test eax, eax
je 0x418662
push eax
call fcn.00432c0b
pop ecx
mov eax, dword [ebp - 0x160]
test eax, eax
je 0x418673
push eax
call fcn.00432c0b
pop ecx
test edi, edi
je 0x41867e
push edi
call fcn.00432c0b
pop ecx
mov edi, dword [ebp - 0x16c]
test edi, edi
je 0x4186d1
mov ebx, dword [ebp - 0x168]
cmp edi, ebx
je 0x4186a9
mov ecx, dword [edi]
sub ecx, 0x10
call fcn.00406c57
add edi, 4
cmp edi, ebx
jne 0x418692
mov edi, dword [ebp - 0x16c]
mov eax, dword [ebp - 0x164]
sub eax, edi
and eax, 0xfffffffc
push eax
push edi
call fcn.00401d6d
xor eax, eax
pop ecx
pop ecx
mov dword [ebp - 0x16c], eax
mov dword [ebp - 0x168], eax
mov dword [ebp - 0x164], eax
lea ecx, [esi - 0x10]
call fcn.00406c57
mov al, byte [ebp - 0x151]
call fcn.0042dbb5
ret
cmp byte [ebp - 0x151], 0
je 0x41860d
cmp byte [ebp - 0x159], 0
mov ecx, str._s_does_not_exist
mov eax, str._s_removed_successfully
cmovne eax, ecx
push edi
push eax
lea eax, [ebp - 0x158]
push eax
call fcn.00406b1a
mov esi, dword [ebp - 0x158]
add esp, 0xc
cmp dword [esi - 4], 1
jle 0x418737
push dword [esi - 0xc]
lea ecx, [ebp - 0x158]
call fcn.00406aae
mov esi, dword [ebp - 0x158]
push 2
push esi
mov ecx, ebx
call fcn.0040c5b8
mov al, byte [ebp - 0x151]
mov byte [ebp - 0x151], al
jmp 0x418651