Function at 0x140005a60
Capabilities:
Query environment variable
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x5d0
mov qword [rsp + 0x90], 0xfffffffffffffffe
mov qword [rsp + 0x610], rbx
mov rax, qword [0x14004b200]
xor rax, rsp
mov qword [rsp + 0x5c0], rax
mov r15, r9
mov r14, r8
mov rsi, rdx
mov r13, rcx
xor ebx, ebx
mov word [rsp + 0x1a0], bx
call fcn.14000bcac
mov rcx, rax
mov edx, ebx
test rax, rax
setne dl
test edx, edx
jne 0x140005ace
mov ecx, 0x80004005
call fcn.140002350
int3
mov rax, qword [rax]
call qword [rax + 0x18]
lea rdi, [rax + 0x18]
mov qword [rsp + 0x40], rdi
lea rax, str.TypeLib_
mov ebp, 1
or r12, 0xffffffffffffffff
test rax, 0xffffffffffff0000
jne 0x140005b1d
movzx edi, ax
mov ecx, edi
call fcn.14000c328
test rax, rax
je 0x140005bf6
mov r8d, edi
mov rdx, rax
lea rcx, [rsp + 0x40]
call fcn.140001ea0
jmp 0x140005bf6
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rbx
mov r9d, r12d
mov r8, rax
xor edx, edx
lea ecx, [rdx + 3]
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea ebx, [rax - 1]
test ebx, ebx
jle 0x140005b99
mov edx, ebp
sub edx, dword [rdi - 8]
mov ecx, dword [rdi - 0xc]
sub ecx, ebx
or ecx, edx
jge 0x140005b5d
mov edx, ebx
lea rcx, [rsp + 0x40]
call fcn.140002140
mov rdi, qword [rsp + 0x40]
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rdi
mov r9d, r12d
lea r8, str.TypeLib_
xor edx, edx
lea ecx, [rdx + 3]
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
cmp ebx, dword [rdi - 0xc]
jg 0x140005b8e
mov dword [rdi - 0x10], ebx
movsxd rax, ebx
xor ebx, ebx
mov word [rdi + rax*2], bx
jmp 0x140005bf6
mov ecx, 0x80070057
call fcn.140002350
int3
lea rdx, [rdi - 0x18]
mov rbx, qword [rdx]
cmp dword [rdx + 8], 0
je 0x140005bf4
cmp dword [rdx + 0x10], 0
jge 0x140005bc7
cmp dword [rdi - 0xc], 0
jge 0x140005bbd
mov ecx, 0x80070057
call fcn.140002350
int3
xor ebx, ebx
mov dword [rdi - 0x10], ebx
mov word [rdi], bx
jmp 0x140005bf6
mov eax, r12d
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x140005bde
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x40], rax
xor ebx, ebx
jmp 0x140005bf6
xor ebx, ebx
test rsi, rsi
jne 0x140005bff
mov ecx, ebx
jmp 0x140005c10
xor eax, eax
mov rcx, r12
mov rdi, rsi
repne scasw ax, word [rdi]
not rcx
dec rcx
mov r8d, ecx
mov rdx, rsi
lea rcx, [rsp + 0x40]
call fcn.140002930
lea rdx, [rsp + 0x58]
mov qword [rsp + 0x20], rdx
mov r9d, 0x20019
xor r8d, r8d
mov rdi, qword [rsp + 0x40]
mov rdx, rdi
mov rcx, 0xffffffff80000000
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x140005d9f
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rbx
mov r9d, r12d
lea r8, str.Wow6432NodeTypeLib_
xor edx, edx
lea ecx, [rdx + 3]
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea ebx, [rax - 1]
test ebx, ebx
jle 0x140005cce
sub ebp, dword [rdi - 8]
mov edx, dword [rdi - 0xc]
sub edx, ebx
or edx, ebp
jge 0x140005c92
mov edx, ebx
lea rcx, [rsp + 0x40]
call fcn.140002140
mov rdi, qword [rsp + 0x40]
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rdi
mov r9d, r12d
lea r8, str.Wow6432NodeTypeLib_
xor edx, edx
lea ecx, [rdx + 3]
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
cmp ebx, dword [rdi - 0xc]
jg 0x140005cc3
mov dword [rdi - 0x10], ebx
movsxd rax, ebx
xor ecx, ecx
mov word [rdi + rax*2], cx
jmp 0x140005d2b
mov ecx, 0x80070057
call fcn.140002350
int3
lea rdx, [rdi - 0x18]
mov rbx, qword [rdx]
cmp dword [rdx + 8], 0
je 0x140005d29
cmp dword [rdx + 0x10], 0
jge 0x140005cfc
cmp dword [rdi - 0xc], 0
jge 0x140005cf2
mov ecx, 0x80070057
call fcn.140002350
int3
xor ecx, ecx
mov dword [rdi - 0x10], ecx
mov word [rdi], cx
jmp 0x140005d2b
mov eax, r12d
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x140005d13
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x40], rax
xor ecx, ecx
jmp 0x140005d2b
xor ecx, ecx
test rsi, rsi
je 0x140005d41
xor eax, eax
mov rcx, r12
mov rdi, rsi
repne scasw ax, word [rdi]
not rcx
dec rcx
mov r8d, ecx
mov rdx, rsi
lea rcx, [rsp + 0x40]
call fcn.140002930
lea rdx, [rsp + 0x58]
mov qword [rsp + 0x20], rdx
mov r9d, 0x20019
xor r8d, r8d
mov rdi, qword [rsp + 0x40]
mov rdx, rdi
mov rcx, 0xffffffff80000000
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x140005d9f
lea rdx, [rdi - 0x18]
lock xadd dword [rdx + 0x10], r12d
dec r12d
test r12d, r12d
jg 0x140005d98
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
xor eax, eax
jmp 0x1400060ac
mov dword [rsp + 0x50], 0x80
mov dword [rsp + 0x48], 0x40
xor ebx, ebx
mov ebp, ebx
lea rax, [rsp + 0x80]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], rbx
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x48]
lea r8, [rsp + 0x120]
xor edx, edx
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
jne 0x140006083
nop word [rax + rax]
lea rax, [rsp + 0x68]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
lea rdx, [rsp + 0x120]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x14000600f
mov dword [rsp + 0x4c], 0x40
mov esi, ebx
lea rax, [rsp + 0x88]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], rbx
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x4c]
lea r8, [rsp + 0xa0]
xor edx, edx
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
jne 0x140006004
nop word [rax + rax]
lea rax, [rsp + 0x78]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
lea rdx, [rsp + 0xa0]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x140005fbc
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
lea rdx, str.win32
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x140005f04
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
lea rdx, str.win64
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x140005fb1
mov dword [rsp + 0x50], 0x105
lea rax, [rsp + 0x50]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x1a0]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x70]
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x140005fa6
mov eax, dword [rsp + 0x70]
cmp eax, 1
je 0x140005f84
cmp eax, 2
jne 0x140005fa6
mov r8d, 0x104
lea rdx, [rsp + 0x3b0]
lea rcx, [rsp + 0x1a0]
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x140005f84
lea r8, [rsp + 0x3b0]
mov edx, 0x104
lea rcx, [rsp + 0x1a0]
call fcn.140022470
mov r9, r15
lea r8, [rsp + 0x1a0]
mov rdx, r14
mov rcx, r13
call fcn.1400060e0
mov ebx, eax
test eax, eax
jg 0x140006058
xor ebx, ebx
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
inc esi
mov dword [rsp + 0x4c], 0x40
lea rax, [rsp + 0x88]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], rbx
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x4c]
lea r8, [rsp + 0xa0]
mov edx, esi
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
je 0x140005e80
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
inc ebp
mov dword [rsp + 0x48], 0x40
lea rax, [rsp + 0x80]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], rbx
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x48]
lea r8, [rsp + 0x120]
mov edx, ebp
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
jne 0x140006083
jmp 0x140005e00
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
nop
lea rdx, [rdi - 0x18]
lock xadd dword [rdx + 0x10], r12d
dec r12d
test r12d, r12d
jg 0x14000607f
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov eax, ebx
jmp 0x1400060ac
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
nop
lea rdx, [rdi - 0x18]
lock xadd dword [rdx + 0x10], r12d
dec r12d
test r12d, r12d
jg 0x1400060aa
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
xor eax, eax
mov rcx, qword [rsp + 0x5c0]
xor rcx, rsp
call fcn.1400216a0
mov rbx, qword [rsp + 0x610]
add rsp, 0x5d0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret