Function at 0x1401d802c
Capabilities:
Delete registry key

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x88]
sub rsp, 0x188
mov qword [rsp + 0x40], 0xfffffffffffffffe
mov rax, qword [0x14049e510]
xor rax, rsp
mov qword [rbp + 0x70], rax
mov r12d, r9d
mov r13, r8
mov r15, rdx
mov rsi, rcx
xor edi, edi
mov dword [rsp + 0x30], edi
mov r14, qword [rdx]
test r14, r14
je 0x1401d8092
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
mov rcx, r14
call qword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegCloseKey]
mov ecx, ebx
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_SetLastError]
mov qword [r15], rdi
mov rdx, rsi
cmp qword [rsi + 0x18], 8
jb 0x1401d80a2
mov rdx, qword [rsi]
mov qword [rsp + 0x20], r15
mov r9d, r12d
xor r8d, r8d
mov rcx, r13
call qword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
mov dword [rsp + 0x30], eax
test eax, eax
je 0x1401d845c
cmp eax, 5
jne 0x1401d845c
movdqa xmm0, xmmword [0x14038ac40]
movdqu xmmword [rsp + 0x58], xmm0
mov word [rsp + 0x48], di
lea rdx, str.SeBackupPrivilege
lea rcx, [rsp + 0x48]
call fcn.14004d5c4
nop
lea rdx, [rsp + 0x48]
lea rcx, [rbp - 0x70]
call fcn.1402486a4
nop
lea rcx, [rsp + 0x48]
call fcn.14004e0f0
cmp byte [rbp - 0x38], dil
je 0x1401d844c
mov dword [rsp + 0x38], edi
lea r9, [rsp + 0x38]
mov r8, r15
mov rdx, rsi
mov rcx, r13
call fcn.1401d5d48
mov dword [rsp + 0x30], eax
test eax, eax
je 0x1401d81d2
call fcn.14004d8a4
mov rcx, qword [rax + 8]
cmp dword [rcx], 3
jbe 0x1401d81c9
lea rax, str.Could_not_open_the_registry_key
mov qword [rbp - 0x10], rax
mov qword [rbp - 8], 0x40
lea rax, [rsp + 0x30]
mov qword [rbp], rax
mov qword [rbp + 8], 4
cmp qword [rsi + 0x18], 8
jb 0x1401d8176
mov rsi, qword [rsi]
lea r14, [0x140344690]
mov rbx, rdi
test rsi, rsi
je 0x1401d8195
mov r14, rsi
or rbx, 0xffffffffffffffff
inc rbx
cmp word [rsi + rbx*2], di
jne 0x1401d818c
mov qword [rbp + 0x10], r14
lea eax, [rbx*2 + 2]
mov dword [rbp + 0x18], eax
mov dword [rbp + 0x1c], edi
lea rax, [rbp - 0x30]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 5
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403ddd55]
call fcn.140001158
mov edi, dword [rsp + 0x30]
jmp 0x1401d8451
cmp dword [rsp + 0x38], 1
jne 0x1401d8451
call fcn.14004d8a4
mov r10, qword [rax + 8]
lea r14, [0x140344690]
or rbx, 0xffffffffffffffff
cmp dword [r10], 3
jbe 0x1401d827d
lea rax, str.Created_a_new_key_where_one_should_have_existed
mov qword [rbp - 0x10], rax
mov qword [rbp - 8], 0x60
lea rax, [rsp + 0x30]
mov qword [rbp], rax
mov qword [rbp + 8], 4
mov rax, rsi
cmp qword [rsi + 0x18], 8
jb 0x1401d822c
mov rax, qword [rsi]
mov rdx, r14
mov rcx, rdi
test rax, rax
je 0x1401d8246
mov rdx, rax
mov rcx, rbx
inc rcx
cmp word [rax + rcx*2], di
jne 0x1401d823d
mov qword [rbp + 0x10], rdx
lea eax, [rcx*2 + 2]
mov dword [rbp + 0x18], eax
mov dword [rbp + 0x1c], edi
lea rax, [rbp - 0x30]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 5
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403ddd55]
mov rcx, r10
call fcn.140001158
mov dword [rsp + 0x34], 6
movdqa xmm0, xmmword [0x14038ac40]
movdqu xmmword [rsp + 0x78], xmm0
mov word [rsp + 0x68], di
lea rdx, str.SeRestorePrivilege
lea rcx, [rsp + 0x68]
call fcn.14004d5c4
nop
lea rdx, [rsp + 0x68]
lea rcx, [rbp - 0x30]
call fcn.1402486a4
nop
lea rcx, [rsp + 0x68]
call fcn.14004e0f0
mov qword [r15], rdi
lea r9, [rsp + 0x38]
mov r8, r15
mov rdx, rsi
mov rcx, r13
call fcn.1401d5d48
mov dword [rsp + 0x30], eax
test eax, eax
je 0x1401d838f
mov r8d, eax
mov edx, eax
lea rcx, str.RegOpenKeyWithBackup_should_be_able_to_open_whatever_it_created.
call fcn.1402b9b90
call fcn.14004d8a4
mov rcx, qword [rax + 8]
cmp dword [rcx], 3
jbe 0x1401d837d
lea rax, str.Could_not_re_open_the_registry_key
mov qword [rbp + 0x40], rax
mov qword [rbp + 0x48], VarR8FromUI1
lea rax, [rsp + 0x30]
mov qword [rbp + 0x50], rax
mov qword [rbp + 0x58], 4
cmp qword [rsi + 0x18], 8
jb 0x1401d8332
mov rsi, qword [rsi]
mov rax, rdi
test rsi, rsi
je 0x1401d8349
mov r14, rsi
mov rax, rbx
inc rax
cmp word [rsi + rax*2], di
jne 0x1401d8340
mov qword [rbp + 0x60], r14
lea eax, [rax*2 + 2]
mov dword [rbp + 0x68], eax
mov dword [rbp + 0x6c], edi
lea rax, [rbp + 0x20]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 5
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403ddd55]
call fcn.140001158
mov edi, dword [rsp + 0x30]
lea rcx, [rbp - 0x30]
call fcn.140248b48
jmp 0x1401d8451
mov rcx, qword [r15]
call qword [sym.imp.ntdll.dll_NtDeleteKey]
mov dword [rsp + 0x34], eax
lea rcx, [rbp - 0x30]
call fcn.140248b48
cmp dword [rsp + 0x34], edi
je 0x1401d844c
call fcn.1402b9bb8
call fcn.14004d8a4
mov rcx, qword [rax + 8]
cmp dword [rcx], 3
jbe 0x1401d843b
lea rax, str.Could_not_delete_the_registry_key
mov qword [rbp + 0x40], rax
mov qword [rbp + 0x48], 0x44
lea rax, [rsp + 0x34]
mov qword [rbp + 0x50], rax
mov qword [rbp + 0x58], 4
cmp qword [rsi + 0x18], 8
jb 0x1401d83f0
mov rsi, qword [rsi]
mov rax, rdi
test rsi, rsi
je 0x1401d8407
mov r14, rsi
mov rax, rbx
inc rax
cmp word [rsi + rax*2], di
jne 0x1401d83fe
mov qword [rbp + 0x60], r14
lea eax, [rax*2 + 2]
mov dword [rbp + 0x68], eax
mov dword [rbp + 0x6c], edi
lea rax, [rbp + 0x20]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 5
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403ddd55]
call fcn.140001158
cmp dword [rsp + 0x34], 0xc0000022
setne dil
add edi, 5
jmp 0x1401d8451
mov edi, 0xa
lea rcx, [rbp - 0x70]
call fcn.140248b48
mov eax, edi
mov rcx, qword [rbp + 0x70]
xor rcx, rsp
call fcn.1402dfdb0
add rsp, 0x188
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret