Function at 0x18004ff6
Capabilities:
Check if file exists
Delete directory
Enumerate files on windows
Enumerate files recursively
Get file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x278
mov eax, dword [0x180f51f0]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
call fcn.1800528d
test al, al
jne 0x1800502c
mov eax, 0x80004005
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1809ccb5
leave
ret
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x1800504e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x18005047
xor eax, eax
jmp 0x1800501d
call fcn.1800fc86
jmp 0x1800501d
test al, 0x10
je 0x18005018
mov ecx, esi
call fcn.18004dad
and dword [ebp - 0x25c], 0
push 0x24c
mov dword [ebp - 0x260], eax
lea eax, [ebp - 0x258]
push 0
push eax
call fcn.1809d820
add esp, 0xc
push esi
lea eax, [ebp - 0x268]
call fcn.18003fba
push 0x180c2d58
lea eax, [ebp - 0x268]
push eax
call fcn.18003097
lea eax, [ebp - 0x25c]
push eax
push dword [ebp - 0x268]
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x1800513c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x12
jne 0x180050dd
mov esi, dword [ebp - 0x260]
mov eax, dword [ebp - 0x268]
add eax, 0xfffffff0
call fcn.18004250
mov eax, esi
jmp 0x1800501d
call fcn.1800fc86
movzx ecx, byte [0x180fb8f9]
neg ecx
sbb ecx, ecx
and ecx, 0x180fbba0
mov esi, eax
je 0x18005131
push 0xfffffffffffffffe
pop ebx
xor edi, edi
push ebx
inc edi
push edi
mov dword [ebp - 0x278], ecx
call fcn.18001d8a
push esi
mov dword [ebp - 0x274], eax
lea eax, [ebp - 0x278]
push str._DeleteDirectory__failed_to_get_first_file__0x_08x_
push eax
mov dword [ebp - 0x270], ebx
mov dword [ebp - 0x26c], edi
call fcn.18001000
add esp, 0xc
cmp dword [ebp - 0x260], 0
jge 0x180050c8
jmp 0x180050c2
test byte [ebp - 0x25c], 0x10
je 0x180051d7
push 0
push 2
push 0x180c2ae0
lea eax, [ebp - 0x230]
call fcn.1800979d
add esp, 0xc
test eax, eax
je 0x180051d7
push 0
push 3
push 0x180c2dc8
lea eax, [ebp - 0x230]
call fcn.1800979d
add esp, 0xc
test eax, eax
je 0x180051d7
push esi
lea eax, [ebp - 0x264]
call fcn.18003fba
push 0x180c2748
lea eax, [ebp - 0x264]
push eax
call fcn.18003097
lea eax, [ebp - 0x230]
push eax
lea eax, [ebp - 0x264]
push eax
call fcn.18003097
mov edi, dword [ebp - 0x264]
push edi
call fcn.18004ff6
cmp dword [ebp - 0x260], 0
pop ecx
jl 0x180051cf
test eax, eax
jge 0x180051cf
mov dword [ebp - 0x260], eax
lea eax, [edi - 0x10]
call fcn.18004250
lea eax, [ebp - 0x25c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x1800513c
push ebx
call dword [sym.imp.KERNEL32.dll_FindClose]
push esi
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
test eax, eax
jne 0x180050c2
push esi
call fcn.1800ccae
pop ecx
mov dword [ebp - 0x264], eax
test eax, eax
jge 0x18005267
movzx ecx, byte [0x180fb8f9]
neg ecx
sbb ecx, ecx
and ecx, 0x180fbba0
je 0x18005267
push 0xfffffffffffffffe
pop ebx
xor edi, edi
push ebx
inc edi
push edi
mov dword [ebp - 0x278], ecx
call fcn.18001d8a
push dword [ebp - 0x264]
mov dword [ebp - 0x274], eax
push esi
lea eax, [ebp - 0x278]
push str._DeleteDirectory__failed_to_delete_after_reboot___s__0x_08x_
push eax
mov dword [ebp - 0x270], ebx
mov dword [ebp - 0x26c], edi
call fcn.18001000
add esp, 0x10
cmp dword [ebp - 0x260], 0
jl 0x180050c2
mov eax, dword [ebp - 0x264]
test eax, eax
jge 0x180050c2
mov dword [ebp - 0x260], eax
jmp 0x180050c2