Function at 0x406ce7
Capabilities:
Create directory
Delete directory
Delete file

Disassembly:
mov eax, 0x42ec75
call fcn.0041c368
mov eax, 0x3048
call fcn.0041c440
push ebx
xor ebx, ebx
inc ebx
cmp byte [0x43bb93], 0
push esi
push edi
mov dword [ebp - 0x18], ebx
jne 0x406d27
push str.SeRestorePrivilege
call fcn.00407610
push str.SeCreateSymbolicLinkPrivilege
call fcn.00407610
mov byte [0x43bb93], bl
push 0x1418
lea ecx, [ebp - 0x2c]
call fcn.00406c9c
mov edi, dword [ebp + 0x10]
and dword [ebp - 4], 0
push 0x800
lea eax, [edi + 0x10fc]
push eax
lea eax, [ebp - 0x1030]
push eax
call fcn.0040eb68
lea eax, [ebp - 0x1030]
push eax
call fcn.004216a5
push 4
mov dword [ebp + 0x10], eax
lea esi, [ebp - 0x1030]
mov eax, esi
push str.___
push eax
call fcn.00422b57
add esp, 0x10
neg eax
sbb al, al
inc al
mov dword [ebp - 0x14], eax
test al, al
je 0x406dbb
push 4
lea esi, [ebp - 0x1028]
mov eax, esi
push str.UNC_
push eax
call fcn.00422b57
add esp, 0xc
test eax, eax
jne 0x406dbb
push 0x5c
pop eax
mov word [ebp - 0x2030], ax
lea esi, [ebp - 0x1022]
lea eax, [ebp - 0x202e]
jmp 0x406dc1
lea eax, [ebp - 0x2030]
push esi
push eax
call fcn.00421683
lea eax, [ebp - 0x2030]
push eax
call fcn.004216a5
mov esi, eax
add esp, 0xc
mov eax, dword [ebp + 8]
mov dword [ebp - 0x10], esi
cmp byte [eax + 0x518f], 0
jne 0x406e1b
cmp byte [ebp - 0x14], 0
jne 0x407004
lea esi, [edi + 0x10fc]
push esi
call fcn.0040af7d
test al, al
jne 0x407004
push esi
lea eax, [edi + 0x20]
push eax
call fcn.0040747b
test al, al
je 0x407004
mov esi, dword [ebp - 0x10]
push ebx
mov ebx, dword [ebp + 0xc]
push ebx
call fcn.00409830
cmp byte [edi + 0x10e9], 0
jne 0x406e61
cmp byte [edi + 0x20fc], 0
jne 0x406e61
xor eax, eax
push eax
push 0x80
push 1
push eax
push eax
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
je 0x407004
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x406e72
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x407004
mov eax, dword [edi + 0x10f8]
cmp eax, 3
jne 0x406ee1
mov edx, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x2c]
lea eax, [edx + esi]
lea eax, [eax*2 + 0xc]
mov dword [ecx], 0xa0000003
mov word [ecx + 4], ax
lea esi, [edx + edx]
xor eax, eax
mov word [ecx + 0xa], si
mov dword [ecx + 6], eax
lea eax, [ebp - 0x1030]
push eax
lea eax, [ecx + 0x10]
push eax
call fcn.00421683
lea eax, [esi + 2]
mov esi, dword [ebp - 0x2c]
mov word [esi + 0xc], ax
mov eax, dword [ebp - 0x10]
add eax, eax
mov word [esi + 0xe], ax
lea eax, [ebp - 0x2030]
push eax
mov eax, dword [ebp + 0x10]
add eax, 9
lea eax, [esi + eax*2]
push eax
call fcn.00421683
add esp, 0x10
jmp 0x406f5d
cmp eax, 2
je 0x406eef
cmp eax, 1
jne 0x407004
mov edx, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x2c]
lea eax, [edx + esi]
lea eax, [eax*2 + 0x10]
mov dword [ecx], 0xa000000c
mov word [ecx + 4], ax
lea esi, [edx + edx]
xor eax, eax
mov word [ecx + 0xa], si
mov dword [ecx + 6], eax
lea eax, [ebp - 0x1030]
push eax
lea eax, [ecx + 0x14]
push eax
call fcn.00421683
lea eax, [esi + 2]
mov esi, dword [ebp - 0x2c]
mov word [esi + 0xc], ax
mov eax, dword [ebp - 0x10]
add eax, eax
mov word [esi + 0xe], ax
lea eax, [ebp - 0x2030]
push eax
mov eax, dword [ebp + 0x10]
add eax, 0xb
lea eax, [esi + eax*2]
push eax
call fcn.00421683
mov eax, dword [ebp - 0x14]
add esp, 0x10
movzx eax, al
xor eax, 1
mov dword [esi + 0x10], eax
xor eax, eax
push eax
push 0x2200000
push 3
push eax
push eax
push 0xc0000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, eax
mov dword [ebp + 0x10], ecx
cmp ecx, 0xffffffff
je 0x407004
xor edx, edx
lea eax, [ebp - 0x30]
push edx
push eax
movzx eax, word [esi + 4]
push edx
push edx
add eax, 8
push eax
push esi
push 0x900a4
push ecx
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x40702e
mov eax, dword [ebp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
push 0
push 0x14
call fcn.00401e0c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
je 0x406fcf
cmp eax, 0x522
jne 0x406fdf
call fcn.0040ed13
test al, al
jne 0x406fdf
push 0x16
call fcn.00403c75
mov esi, 0x43bbd8
mov ecx, esi
call fcn.0041d29e
push 9
mov ecx, esi
call fcn.00406bc8
cmp byte [edi + 0x10e9], 0
push ebx
je 0x407026
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
mov byte [ebp - 0x18], 0
lea ecx, [ebp - 0x2c]
call fcn.00401505
mov ecx, dword [ebp - 0xc]
mov al, byte [ebp - 0x18]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 0xc
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
jmp 0x407004
lea ecx, [ebp - 0x3054]
call fcn.00408f84
lea ecx, [ebp - 0x3054]
mov byte [ebp - 4], 1
call fcn.00409026
mov esi, dword [ebp + 8]
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x3050], eax
lea eax, [edi + 0x1048]
mov ecx, dword [esi + 0x629c]
neg ecx
sbb ecx, ecx
and ecx, eax
lea eax, [edi + 0x1040]
push ecx
mov ecx, dword [esi + 0x6298]
neg ecx
sbb ecx, ecx
and ecx, eax
lea eax, [edi + 0x1038]
push ecx
mov ecx, dword [esi + 0x6294]
neg ecx
sbb ecx, ecx
and ecx, eax
push ecx
lea ecx, [ebp - 0x3054]
call fcn.00409574
lea ecx, [ebp - 0x3054]
call fcn.00409026
cmp byte [esi + 0x51a0], 0
jne 0x4070b5
push dword [edi + 0x1c]
push ebx
call fcn.00409c25
lea ecx, [ebp - 0x3054]
call fcn.00408fba
jmp 0x407008