Function at 0x1400057b0
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.14000ba9c
mov rcx, rax
mov edx, ebx
test rax, rax
setne dl
test edx, edx
jne 0x14000581e
mov ecx, 0x80004005
call fcn.140001fe0
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 0x14000586d
movzx edi, ax
mov ecx, edi
call fcn.14000c120
test rax, rax
je 0x140005946
mov r8d, edi
mov rdx, rax
lea rcx, [rsp + 0x40]
call fcn.140001b30
jmp 0x140005946
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 0x1400058e9
mov edx, ebp
sub edx, dword [rdi - 8]
mov ecx, dword [rdi - 0xc]
sub ecx, ebx
or ecx, edx
jge 0x1400058ad
mov edx, ebx
lea rcx, [rsp + 0x40]
call fcn.140001dd0
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 0x1400058de
mov dword [rdi - 0x10], ebx
movsxd rax, ebx
xor ebx, ebx
mov word [rdi + rax*2], bx
jmp 0x140005946
mov ecx, 0x80070057
call fcn.140001fe0
int3
lea rdx, [rdi - 0x18]
mov rbx, qword [rdx]
cmp dword [rdx + 8], 0
je 0x140005944
cmp dword [rdx + 0x10], 0
jge 0x140005917
cmp dword [rdi - 0xc], 0
jge 0x14000590d
mov ecx, 0x80070057
call fcn.140001fe0
int3
xor ebx, ebx
mov dword [rdi - 0x10], ebx
mov word [rdi], bx
jmp 0x140005946
mov eax, r12d
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x14000592e
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 0x140005946
xor ebx, ebx
test rsi, rsi
jne 0x14000594f
mov ecx, ebx
jmp 0x140005960
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.1400025a0
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 0x140005aef
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 0x140005a1e
sub ebp, dword [rdi - 8]
mov edx, dword [rdi - 0xc]
sub edx, ebx
or edx, ebp
jge 0x1400059e2
mov edx, ebx
lea rcx, [rsp + 0x40]
call fcn.140001dd0
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 0x140005a13
mov dword [rdi - 0x10], ebx
movsxd rax, ebx
xor ecx, ecx
mov word [rdi + rax*2], cx
jmp 0x140005a7b
mov ecx, 0x80070057
call fcn.140001fe0
int3
lea rdx, [rdi - 0x18]
mov rbx, qword [rdx]
cmp dword [rdx + 8], 0
je 0x140005a79
cmp dword [rdx + 0x10], 0
jge 0x140005a4c
cmp dword [rdi - 0xc], 0
jge 0x140005a42
mov ecx, 0x80070057
call fcn.140001fe0
int3
xor ecx, ecx
mov dword [rdi - 0x10], ecx
mov word [rdi], cx
jmp 0x140005a7b
mov eax, r12d
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x140005a63
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 0x140005a7b
xor ecx, ecx
test rsi, rsi
je 0x140005a91
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.1400025a0
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 0x140005aef
lea rdx, [rdi - 0x18]
lock xadd dword [rdx + 0x10], r12d
dec r12d
test r12d, r12d
jg 0x140005ae8
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
xor eax, eax
jmp 0x140005dfc
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 0x140005dd3
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 0x140005d5f
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 0x140005d54
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 0x140005d0c
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 0x140005c54
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 0x140005d01
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 0x140005cf6
mov eax, dword [rsp + 0x70]
cmp eax, 1
je 0x140005cd4
cmp eax, 2
jne 0x140005cf6
mov r8d, 0x104
lea rdx, [rsp + 0x3b0]
lea rcx, [rsp + 0x1a0]
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x140005cd4
lea r8, [rsp + 0x3b0]
mov edx, 0x104
lea rcx, [rsp + 0x1a0]
call fcn.140021d78
mov r9, r15
lea r8, [rsp + 0x1a0]
mov rdx, r14
mov rcx, r13
call fcn.140005e30
mov ebx, eax
test eax, eax
jg 0x140005da8
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 0x140005bd0
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 0x140005dd3
jmp 0x140005b50
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 0x140005dcf
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov eax, ebx
jmp 0x140005dfc
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 0x140005dfa
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.1400213b0
mov rbx, qword [rsp + 0x610]
add rsp, 0x5d0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret