Function at 0x140004f24
Capabilities:
Query or enumerate registry value

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rdi
sub rsp, 0x90
mov dword [rsp + 0x40], 0
mov dword [rsp + 0x58], 0
mov qword [rsp + 0x78], 0
lea rax, [rsp + 0x74]
mov rdi, rax
xor eax, eax
mov ecx, 4
rep stosb byte [rdi], al
mov dword [rsp + 0x48], 0x1000
mov qword [rsp + 0x60], 0
mov eax, dword [rsp + 0x48]
mov r8d, 0x31304649
mov edx, eax
mov ecx, 1
call qword [sym.imp.ntoskrnl.exe_ExAllocatePoolWithTag]
mov qword [rsp + 0x50], rax
mov rax, qword [rsp + 0xa8]
mov dword [rax], 9
lea rax, [rsp + 0x78]
mov qword [rsp + 0x30], rax
mov byte [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov r9d, 0xf003f
xor r8d, r8d
mov edx, 0x200
mov rcx, qword [rsp + 0xa0]
call qword [sym.imp.ntoskrnl.exe_ObOpenObjectByPointer]
mov dword [rsp + 0x40], eax
cmp dword [rsp + 0x40], 0
jge 0x140004fe3
mov eax, dword [rsp + 0x58]
jmp 0x140005236
mov rax, qword [rsp + 0xa8]
add rax, 0x238
mov rcx, rax
call sub.ntoskrnl.exe_wcslen
mov dword [rsp + 0x44], eax
mov eax, dword [rsp + 0x44]
mov rcx, qword [rsp + 0xa8]
lea rax, [rcx + rax*2 + 0x238]
mov qword [rsp + 0x68], rax
mov eax, 0x2f
mov rcx, qword [rsp + 0x68]
mov word [rcx], ax
mov rax, qword [rsp + 0x68]
add rax, 2
mov qword [rsp + 0x68], rax
mov rax, qword [rsp + 0xa8]
add rax, 0x238
mov rcx, qword [rsp + 0x68]
sub rcx, rax
mov rax, rcx
sar rax, 1
mov dword [rsp + 0x70], eax
mov dword [rsp + 0x4c], 0
jmp 0x140005065
mov eax, dword [rsp + 0x4c]
inc eax
mov dword [rsp + 0x4c], eax
lea rax, [rsp + 0x44]
mov qword [rsp + 0x28], rax
mov eax, dword [rsp + 0x48]
mov dword [rsp + 0x20], eax
mov r9, qword [rsp + 0x50]
xor r8d, r8d
mov edx, dword [rsp + 0x4c]
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ntoskrnl.exe_ZwEnumerateValueKey]
mov dword [rsp + 0x40], eax
cmp dword [rsp + 0x40], 0
jge 0x140005153
cmp dword [rsp + 0x40], 0x8000001a
jne 0x1400050b1
jmp 0x140005212
cmp dword [rsp + 0x40], 0x80000005
je 0x1400050c9
cmp dword [rsp + 0x40], 0xc0000023
jne 0x140005153
mov eax, dword [rsp + 0x44]
mov r8d, 0x31304649
mov edx, eax
mov ecx, 1
call qword [sym.imp.ntoskrnl.exe_ExAllocatePoolWithTag]
mov qword [rsp + 0x80], rax
mov eax, dword [rsp + 0x48]
mov r8d, eax
mov rdx, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x80]
call fcn.140006900
mov eax, dword [rsp + 0x44]
mov dword [rsp + 0x48], eax
mov edx, 0x31304649
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.ntoskrnl.exe_ExFreePoolWithTag]
mov rax, qword [rsp + 0x80]
mov qword [rsp + 0x50], rax
lea rax, [rsp + 0x44]
mov qword [rsp + 0x28], rax
mov eax, dword [rsp + 0x48]
mov dword [rsp + 0x20], eax
mov r9, qword [rsp + 0x50]
xor r8d, r8d
mov edx, dword [rsp + 0x4c]
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ntoskrnl.exe_ZwEnumerateValueKey]
mov dword [rsp + 0x40], eax
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0x60], rax
xor edx, edx
mov rax, qword [rsp + 0x60]
mov eax, dword [rax + 8]
mov ecx, 2
div ecx
mov rcx, qword [rsp + 0x60]
mov dword [rcx + 8], eax
mov rax, qword [rsp + 0x60]
mov eax, dword [rax + 8]
inc eax
cmp eax, dword [rsp + 0x70]
jae 0x1400051be
mov rax, qword [rsp + 0x60]
mov eax, dword [rax + 8]
mov rcx, qword [rsp + 0x60]
add rcx, 0xc
mov edx, dword [rsp + 0x70]
mov r9d, eax
mov r8, rcx
mov rcx, qword [rsp + 0x68]
call sub.ntoskrnl.exe_wcsncpy_s
mov rax, qword [rsp + 0x60]
mov eax, dword [rax + 8]
xor ecx, ecx
mov rdx, qword [rsp + 0x68]
mov word [rdx + rax*2], cx
call fcn.140002fec
mov qword [rsp + 0x88], rax
mov r9d, 0x3e8
lea r8, [rsp + 0x74]
mov rdx, qword [rsp + 0xa8]
mov rcx, qword [rsp + 0x88]
call fcn.140005240
movzx eax, al
test eax, eax
je 0x14000520d
cmp dword [rsp + 0x74], 1
jne 0x14000520d
mov dword [rsp + 0x58], 0xc0000022
lea rcx, [0x140007600]
call fcn.14000659c
jmp 0x14000505b
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ntoskrnl.exe_ZwClose]
cmp qword [rsp + 0x50], 0
je 0x140005232
xor edx, edx
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.ntoskrnl.exe_ExFreePoolWithTag]
mov eax, dword [rsp + 0x58]
add rsp, 0x90
pop rdi
ret