Function at 0x140009db8
Capabilities:
Delete registry key

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r14
push r15
lea rbp, [rsp - 0x37]
sub rsp, 0x90
mov rax, qword [0x14006cfc0]
xor rax, rsp
mov qword [rbp + 0x27], rax
mov rbx, qword [rdx]
xor edi, edi
mov r15d, r9d
mov rsi, rdx
mov r14, rcx
test rbx, rbx
jne 0x140009eb1
mov rcx, r14
mov qword [rsi], rdi
call fcn.140009b30
mov r9d, r15d
mov qword [rsp + 0x20], rsi
xor r8d, r8d
mov rdx, rax
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
nop dword [rax + rax]
test eax, eax
je 0x140009e8b
cmp eax, 5
jne 0x140009e8d
xorps xmm0, xmm0
lea r8d, [rax + 0xc]
xorps xmm1, xmm1
lea rdx, str.SeBackupPrivilege
lea rcx, [rbp + 7]
movups xmmword [rbp + 7], xmm0
movdqu xmmword [rbp + 0x17], xmm1
call fcn.1400135a8
lea rcx, [rbp + 7]
call fcn.14000a0a4
lea rcx, [rbp + 7]
mov bl, al
call fcn.140013e34
test bl, bl
je 0x14000a094
lea r9, [rbp - 0x11]
mov dword [rbp - 0x11], edi
mov r8, rsi
mov rdx, r14
call fcn.1400153dc
mov ebx, eax
test eax, eax
jne 0x140009ed7
cmp dword [rbp - 0x11], 1
je 0x140009f65
xor eax, eax
mov rcx, qword [rbp + 0x27]
xor rcx, rsp
call fcn.1400165f0
mov rbx, qword [rsp + 0xd0]
add rsp, 0x90
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret
lea rcx, [rbp - 0x19]
call fcn.14001b988
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
nop dword [rax + rax]
lea rcx, [rbp - 0x19]
call fcn.14001baf0
jmp 0x140009df5
call fcn.14001279c
mov rdi, rax
cmp dword [rax], 3
jbe 0x140009f5e
mov rcx, r14
call fcn.140009b30
mov qword [rbp - 9], rax
lea rdx, [0x14005dae6]
lea rax, str.Could_not_open_the_registry_key
mov qword [rbp - 1], rax
lea rax, [rbp - 9]
mov qword [rsp + 0x30], rax
lea rax, [rbp - 0x19]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 1]
jmp 0x140009f4e
mov rcx, r14
call fcn.140009b30
mov qword [rbp - 1], rax
lea rdx, [0x14005dae6]
lea rax, str.Could_not_re_open_the_registry_key
mov qword [rbp - 9], rax
lea rax, [rbp - 1]
mov qword [rsp + 0x30], rax
lea rax, [rbp - 0x19]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 9]
mov rcx, rdi
mov qword [rsp + 0x20], rax
mov dword [rbp - 0x19], ebx
call fcn.14000d108
mov eax, ebx
jmp 0x140009e8d
call fcn.14001279c
mov rbx, rax
cmp dword [rax], 3
jbe 0x140009fb6
mov rcx, r14
call fcn.140009b30
mov qword [rbp - 1], rax
lea rdx, [0x14005dae6]
lea rax, str.Created_a_new_key_where_one_should_have_existed
mov dword [rbp - 0x19], edi
mov qword [rbp - 9], rax
mov rcx, rbx
lea rax, [rbp - 1]
mov qword [rsp + 0x30], rax
lea rax, [rbp - 0x19]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 9]
mov qword [rsp + 0x20], rax
call fcn.14000d108
lea rdx, str.SeRestorePrivilege
lea rcx, [rbp + 7]
call fcn.14001356c
lea rcx, [rbp + 7]
call fcn.14000a0a4
lea rcx, [rbp + 7]
call fcn.140013e34
lea r9, [rbp - 0x11]
mov qword [rsi], rdi
mov r8, rsi
mov rdx, r14
call fcn.1400153dc
mov ebx, eax
test eax, eax
je 0x14000a017
mov r8d, eax
lea rcx, str.RegOpenKeyWithBackup_should_be_able_to_open_whatever_it_created.
mov edx, eax
call fcn.14003f3a8
call fcn.14001279c
mov rdi, rax
cmp dword [rax], 3
jbe 0x140009f5e
jmp 0x140009f1a
mov rcx, qword [rsi]
call qword [sym.imp.ntdll.dll_NtDeleteKey]
nop dword [rax + rax]
mov ebx, eax
test eax, eax
je 0x14000a094
call fcn.14003f47c
call fcn.14001279c
mov rsi, rax
cmp dword [rax], 3
jbe 0x14000a082
mov rcx, r14
call fcn.140009b30
mov qword [rbp - 1], rax
lea rdx, [0x14005dae6]
lea rax, str.Could_not_delete_the_registry_key
mov dword [rbp - 0x19], ebx
mov qword [rbp - 9], rax
mov rcx, rsi
lea rax, [rbp - 1]
mov qword [rsp + 0x30], rax
lea rax, [rbp - 0x19]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 9]
mov qword [rsp + 0x20], rax
call fcn.14000d108
cmp ebx, 0xc0000022
setne dil
lea eax, [rdi + 5]
jmp 0x140009e8d
mov eax, 0xa
jmp 0x140009e8d