Function at 0x140004d00
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 [0x140048200]
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.1400095b4
mov rcx, rax
mov edx, ebx
test rax, rax
setne dl
test edx, edx
jne 0x140004d6e
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 0x140004dbd
movzx edi, ax
mov ecx, edi
call fcn.140009c88
test rax, rax
je 0x140004e96
mov r8d, edi
mov rdx, rax
lea rcx, [rsp + 0x40]
call fcn.140001e90
jmp 0x140004e96
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 0x140004e39
mov edx, ebp
sub edx, dword [rdi - 8]
mov ecx, dword [rdi - 0xc]
sub ecx, ebx
or ecx, edx
jge 0x140004dfd
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 0x140004e2e
mov dword [rdi - 0x10], ebx
movsxd rax, ebx
xor ebx, ebx
mov word [rdi + rax*2], bx
jmp 0x140004e96
mov ecx, 0x80070057
call fcn.140002350
int3
lea rdx, [rdi - 0x18]
mov rbx, qword [rdx]
cmp dword [rdx + 8], 0
je 0x140004e94
cmp dword [rdx + 0x10], 0
jge 0x140004e67
cmp dword [rdi - 0xc], 0
jge 0x140004e5d
mov ecx, 0x80070057
call fcn.140002350
int3
xor ebx, ebx
mov dword [rdi - 0x10], ebx
mov word [rdi], bx
jmp 0x140004e96
mov eax, r12d
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x140004e7e
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 0x140004e96
xor ebx, ebx
test rsi, rsi
jne 0x140004e9f
mov ecx, ebx
jmp 0x140004eb0
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.140002900
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 0x14000503f
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 0x140004f6e
sub ebp, dword [rdi - 8]
mov edx, dword [rdi - 0xc]
sub edx, ebx
or edx, ebp
jge 0x140004f32
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 0x140004f63
mov dword [rdi - 0x10], ebx
movsxd rax, ebx
xor ecx, ecx
mov word [rdi + rax*2], cx
jmp 0x140004fcb
mov ecx, 0x80070057
call fcn.140002350
int3
lea rdx, [rdi - 0x18]
mov rbx, qword [rdx]
cmp dword [rdx + 8], 0
je 0x140004fc9
cmp dword [rdx + 0x10], 0
jge 0x140004f9c
cmp dword [rdi - 0xc], 0
jge 0x140004f92
mov ecx, 0x80070057
call fcn.140002350
int3
xor ecx, ecx
mov dword [rdi - 0x10], ecx
mov word [rdi], cx
jmp 0x140004fcb
mov eax, r12d
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x140004fb3
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 0x140004fcb
xor ecx, ecx
test rsi, rsi
je 0x140004fe1
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.140002900
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 0x14000503f
lea rdx, [rdi - 0x18]
lock xadd dword [rdx + 0x10], r12d
dec r12d
test r12d, r12d
jg 0x140005038
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
xor eax, eax
jmp 0x14000534c
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 0x140005323
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 0x1400052af
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 0x1400052a4
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 0x14000525c
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 0x1400051a4
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 0x140005251
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 0x140005246
mov eax, dword [rsp + 0x70]
cmp eax, 1
je 0x140005224
cmp eax, 2
jne 0x140005246
mov r8d, 0x104
lea rdx, [rsp + 0x3b0]
lea rcx, [rsp + 0x1a0]
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x140005224
lea r8, [rsp + 0x3b0]
mov edx, 0x104
lea rcx, [rsp + 0x1a0]
call fcn.14001fcb0
mov r9, r15
lea r8, [rsp + 0x1a0]
mov rdx, r14
mov rcx, r13
call fcn.140005380
mov ebx, eax
test eax, eax
jg 0x1400052f8
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 0x140005120
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 0x140005323
jmp 0x1400050a0
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 0x14000531f
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov eax, ebx
jmp 0x14000534c
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 0x14000534a
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.14001eee0
mov rbx, qword [rsp + 0x610]
add rsp, 0x5d0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret