Function at 0x51c276
Capabilities:
Delete directory
Delete file

Disassembly:
mov eax, 0x6db1e9
call fcn.006899cc
sub esp, 0x70
push ebx
mov ebx, dword [ecx + 8]
push esi
mov esi, dword [ecx + 4]
mov dword [ebp - 0x18], ebx
cmp esi, ebx
je 0x51c4fd
add ecx, 0x28
mov dword [ebp - 0x1c], ecx
push edi
push 0
lea eax, [esi + 0x38]
push eax
push ecx
lea eax, [ebp - 0x64]
push eax
call fcn.0046f380
and dword [ebp - 4], 0
cmp dword [eax + 0x14], 8
jb 0x51c2b9
mov eax, dword [eax]
and dword [ebp - 0x34], 0
xor ecx, ecx
and dword [ebp - 0x24], 0
mov word [ebp - 0x34], cx
lea ecx, [ebp - 0x34]
push eax
mov dword [ebp - 0x20], 7
call fcn.004482e2
lea ecx, [ebp - 0x64]
mov byte [ebp - 4], 2
call fcn.0044823e
mov edx, dword [ebp - 0x20]
lea edi, [ebp - 0x34]
mov ecx, dword [ebp - 0x34]
cmp edx, 8
jb 0x51c2f3
mov edi, ecx
mov eax, dword [ebp - 0x24]
sub eax, dword [esi + 0x48]
lea edi, [edi + eax*2]
add edi, 0xfffffffe
lea eax, [ebp - 0x34]
cmp edx, 8
jb 0x51c309
mov eax, ecx
push 0x5c
push eax
call fcn.0068d26b
pop ecx
pop ecx
cmp eax, edi
jb 0x51c4ab
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x34]
cmp dword [ebp - 0x20], 8
jb 0x51c32c
mov eax, dword [ebp - 0x34]
push eax
call dword [sym.imp.KERNEL32.DLL_RemoveDirectoryW]
test eax, eax
jne 0x51c4a0
call dword [sym.imp.KERNEL32.DLL_GetLastError]
cmp eax, 0x91
jne 0x51c4a0
and dword [ebp - 0x4c], 0
lea ecx, [ebp - 0x4c]
and dword [ebp - 0x3c], 0
xor eax, eax
push str.thumbs.db
mov dword [ebp - 0x38], 7
mov word [ebp - 0x4c], ax
call fcn.004482e2
push 0
lea eax, [ebp - 0x4c]
mov byte [ebp - 4], 3
push eax
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x7c]
push eax
call fcn.0046f380
cmp dword [eax + 0x14], 8
jb 0x51c38d
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.DLL_DeleteFileW]
test eax, eax
lea ecx, [ebp - 0x7c]
setne bh
call fcn.0044823e
mov eax, dword [ebp - 0x38]
mov byte [ebp - 4], 2
cmp eax, 8
jb 0x51c3e0
mov ecx, dword [ebp - 0x4c]
lea eax, [eax*2 + 2]
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x14], ecx
cmp eax, 0x1000
jb 0x51c3d7
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x14]
push eax
call fcn.0044810a
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
push eax
push ecx
call fcn.0068976d
pop ecx
pop ecx
and dword [ebp - 0x4c], 0
lea ecx, [ebp - 0x4c]
and dword [ebp - 0x3c], 0
xor eax, eax
push str..DS_Store
mov dword [ebp - 0x38], 7
mov word [ebp - 0x4c], ax
call fcn.004482e2
push 0
lea eax, [ebp - 0x4c]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x7c]
push eax
call fcn.0046f380
cmp dword [eax + 0x14], 8
jb 0x51c421
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.DLL_DeleteFileW]
test eax, eax
lea ecx, [ebp - 0x7c]
setne bl
call fcn.0044823e
mov eax, dword [ebp - 0x38]
mov byte [ebp - 4], 2
cmp eax, 8
jb 0x51c474
mov ecx, dword [ebp - 0x4c]
lea eax, [eax*2 + 2]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], ecx
cmp eax, 0x1000
jb 0x51c46b
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
call fcn.0044810a
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x10]
push eax
push ecx
call fcn.0068976d
pop ecx
pop ecx
test bh, bh
jne 0x51c47c
test bl, bl
je 0x51c4ab
cmp dword [ebp - 0x20], 8
lea eax, [ebp - 0x34]
jb 0x51c488
mov eax, dword [ebp - 0x34]
push eax
call dword [sym.imp.KERNEL32.DLL_RemoveDirectoryW]
test eax, eax
jne 0x51c4a0
call dword [sym.imp.KERNEL32.DLL_GetLastError]
cmp eax, 0x91
je 0x51c4ab
mov edx, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x34]
jmp 0x51c2ff
or dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x20]
cmp eax, 8
jb 0x51c4ea
mov ecx, dword [ebp - 0x34]
lea eax, [eax*2 + 2]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], ecx
cmp eax, 0x1000
jb 0x51c4e1
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
call fcn.0044810a
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x10]
push eax
push ecx
call fcn.0068976d
pop ecx
pop ecx
mov ecx, dword [ebp - 0x1c]
add esi, 0xa0
cmp esi, dword [ebp - 0x18]
jne 0x51c29d
pop edi
mov ecx, dword [ebp - 0xc]
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret