Function at 0x408aaa
Capabilities:
Delete directory
Delete file

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x44700c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x18]
push ebx
push esi
mov dword [ebp - 0x3c], eax
xor ebx, ebx
mov eax, dword [ebp + 8]
mov esi, edx
mov dword [ebp - 0x40], eax
push edi
test ecx, ecx
je 0x408cd3
test esi, esi
je 0x408cd3
cmp dword [esi + 0x50], ebx
je 0x408cd3
xor eax, eax
lea edi, [ebp - 0x10]
stosd dword es:[edi], eax
push ecx
lea ecx, [ebp - 0x10]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
call fcn.00413e89
push ecx
push ecx
lea ecx, [ebp - 0x10]
call fcn.00414317
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
and dword [ebp + 0xc], 0x10
mov edi, dword [ebp - 0x3c]
je 0x408b29
mov edx, dword [ebp + 0x14]
mov ecx, dword [ebp - 0x10]
push edi
call fcn.004085d0
pop ecx
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
cmp dword [ebp + 0x10], 2
jne 0x408c86
lea ecx, [ebp - 0x10]
call fcn.0040828e
mov ecx, dword [ebp - 0x10]
call fcn.0040890e
mov ecx, dword [esi + 0x50]
test ecx, ecx
je 0x408b69
movzx eax, word [ecx]
test ax, ax
je 0x408b69
push 0x5c
pop edx
cmp ax, dx
jne 0x408b60
cmp word [ecx + 2], dx
je 0x408ba1
call fcn.00407952
test al, al
jne 0x408ba1
push dword [esi + 0x50]
lea ecx, [ebp - 0x1c]
call fcn.00413e89
push dword [esi]
lea ecx, [ebp - 0x28]
call fcn.00413e89
lea edx, [ebp - 0x1c]
lea ecx, [ebp - 0x28]
call fcn.00408453
lea ecx, [ebp - 0x28]
mov bl, al
call fcn.00413fa9
lea ecx, [ebp - 0x1c]
call fcn.00413fa9
test bl, bl
jne 0x408bac
xor ebx, ebx
mov dword [edi], 0xa0000077
jmp 0x408cc7
xor eax, eax
lea edi, [ebp - 0x28]
stosd dword es:[edi], eax
lea edx, [ebp - 0x10]
lea ecx, [ebp - 0x28]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
call fcn.0041435b
xor eax, eax
lea edi, [ebp - 0x1c]
stosd dword es:[edi], eax
sub esp, 0xc
mov ecx, esp
stosd dword es:[edi], eax
push 0x4410ac
stosd dword es:[edi], eax
call fcn.00413e89
sub esp, 0xc
mov ecx, esp
push dword [esi + 0x50]
call fcn.00413e89
sub esp, 0xc
lea eax, [ebp - 0x28]
mov ecx, esp
push eax
call fcn.00413ead
lea ecx, [ebp - 0x1c]
call fcn.00407a43
add esp, 0x24
push dword [ebp - 0x1c]
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
xor ecx, ecx
inc ecx
test eax, eax
mov eax, dword [ebp + 0xc]
cmovne eax, ecx
xor ebx, ebx
test eax, eax
setne bl
add ebx, 2
push ebx
push dword [esi + 0x50]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CreateSymbolicLinkW]
movzx edi, al
test al, al
jne 0x408c72
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 3
jne 0x408c72
xor eax, eax
lea edi, [ebp - 0x34]
stosd dword es:[edi], eax
sub esp, 0xc
mov ecx, esp
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp - 0x10]
push eax
call fcn.00413ead
lea ecx, [ebp - 0x34]
call fcn.00407ff6
add esp, 0xc
push ebx
push dword [esi + 0x50]
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_CreateSymbolicLinkW]
lea ecx, [ebp - 0x34]
movzx edi, al
call fcn.00413fa9
lea ecx, [ebp - 0x1c]
call fcn.00413fa9
lea ecx, [ebp - 0x28]
call fcn.00413fa9
xor ebx, ebx
jmp 0x408c9d
cmp dword [ebp + 0x10], 1
jne 0x408ca8
push dword [esi + 0x50]
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x40]
call fcn.00408958
pop ecx
mov edi, eax
test edi, edi
je 0x408caa
mov eax, dword [ebp - 0x3c]
mov dword [eax], ebx
jmp 0x408cc5
mov edi, ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor ecx, ecx
cmp eax, 0x522
mov eax, dword [ebp - 0x3c]
setne cl
add ecx, 0xa0000076
mov dword [eax], ecx
mov ebx, edi
lea ecx, [ebp - 0x10]
call fcn.00413fa9
mov eax, ebx
jmp 0x408cd5
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00421e3f
leave
ret