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

Disassembly:
push rbp
push r14
lea rbp, [rsp - 0x6e8]
sub rsp, 0x7e8
mov rax, qword [0x1403eaa10]
xor rax, rsp
mov qword [rbp + 0x6d0], rax
mov r14, rcx
lea rcx, [rbp - 0x6c]
xor edx, edx
mov r8d, 0x118
call fcn.1402a04b0
lea rcx, [rbp - 0x70]
mov dword [rbp - 0x70], 0x11c
call qword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
jne 0x1401669d5
or eax, 0xffffffff
jmp 0x140166d2e
cmp byte [rbp + 0xaa], 1
je 0x1401669e5
xor eax, eax
jmp 0x140166d2e
lea rax, [rsp + 0x68]
lea rdx, str.SOFTWAREMicrosoftWindows_NTCurrentVersionProfileList
mov r9d, 0x20019
xor r8d, r8d
mov rcx, 0xffffffff80000002
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x1401669cd
mov rcx, qword [rsp + 0x68]
mov qword [rsp + 0x808], rbx
mov qword [rsp + 0x810], rsi
lea rax, [rsp + 0x60]
mov qword [rsp + 0x818], rdi
mov qword [rsp + 0x7e0], r15
xor r15d, r15d
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x50], r15
mov qword [rsp + 0x48], r15
mov qword [rsp + 0x40], r15
mov qword [rsp + 0x38], r15
mov qword [rsp + 0x30], r15
xor edx, edx
mov qword [rsp + 0x28], r15
mov dword [rsp + 0x60], r15d
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyW]
mov esi, r15d
cmp dword [rsp + 0x60], r15d
jbe 0x140166cf7
nop word [rax + rax]
mov rcx, qword [rsp + 0x68]
lea r8, [rbp + 0xb0]
mov r9d, 0x100
mov edx, esi
call qword [sym.imp.ADVAPI32.dll_RegEnumKeyW]
test eax, eax
jne 0x140166ceb
lea rax, [rbp - 0x78]
lea rdx, [rbp + 0xb0]
mov r9d, 0x20019
xor r8d, r8d
mov rcx, 0xffffffff80000003
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x140166ae5
mov rcx, qword [rbp - 0x78]
jmp 0x140166ce5
mov rcx, qword [rsp + 0x68]
lea rax, [rbp - 0x80]
lea rdx, [rbp + 0xb0]
mov r9d, 0x20019
xor r8d, r8d
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x140166ceb
mov rcx, qword [rbp - 0x80]
lea rax, [rsp + 0x64]
lea r9, [rsp + 0x70]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0x2b0]
lea rdx, str.ProfileImagePath
xor r8d, r8d
mov dword [rsp + 0x64], 0x208
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x140166ce1
mov eax, dword [rsp + 0x64]
shr rax, 1
add rax, rax
cmp rax, 0x208
jae 0x140166d48
cmp dword [rsp + 0x70], 2
mov word [rbp + rax + 0x2b0], r15w
jne 0x140166bcc
lea rcx, [rbp + 0x2b0]
xor r8d, r8d
xor edx, edx
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov edi, eax
lea ecx, [rax + 2]
add rcx, rcx
call fcn.140298640
mov rbx, rax
test rax, rax
je 0x140166bcc
lea rcx, [rbp + 0x2b0]
mov r8d, edi
mov rdx, rax
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea rcx, [rbp + 0x2b0]
mov r8, rbx
mov edx, 0x104
call fcn.1402980d8
mov rcx, rbx
call fcn.140298600
lea r8, [rbp + 0x2b0]
lea rcx, [rbp + 0x4c0]
mov edx, 0x104
call fcn.1402980d8
lea r8, [0x1403232c8]
lea rcx, [rbp + 0x4c0]
mov edx, 0x104
call fcn.14029a500
lea r8, str.NTUSER.DAT
lea rcx, [rbp + 0x4c0]
mov edx, 0x104
call fcn.14029a500
lea r8, [rbp + 0x4c0]
lea rdx, [rbp + 0xb0]
mov rcx, 0xffffffff80000003
call qword [sym.imp.ADVAPI32.dll_RegLoadKeyW]
test eax, eax
jne 0x140166cbf
lea rcx, [rbp + 0xb0]
call fcn.14029ab7c
mov rcx, qword [r14 + 0x10]
mov rdi, rax
mov qword [rsp + 0x78], rax
lea rax, [rsp + 0x78]
cmp rax, rcx
jae 0x140166c9d
mov rdx, qword [r14 + 8]
lea rax, [rsp + 0x78]
cmp rdx, rax
ja 0x140166c9d
lea rdi, [rsp + 0x78]
sub rdi, rdx
sar rdi, 3
cmp rcx, qword [r14 + 0x18]
jne 0x140166c82
lea rcx, [r14 + 8]
call fcn.1400bae00
mov rdx, qword [r14 + 0x10]
test rdx, rdx
je 0x140166c96
mov rax, qword [r14 + 8]
mov rcx, qword [rax + rdi*8]
mov qword [rdx], rcx
add qword [r14 + 0x10], 8
jmp 0x140166ce1
cmp rcx, qword [r14 + 0x18]
jne 0x140166cac
lea rcx, [r14 + 8]
call fcn.1400bae00
mov rax, qword [r14 + 0x10]
test rax, rax
je 0x140166cb8
mov qword [rax], rdi
add qword [r14 + 0x10], 8
jmp 0x140166ce1
cmp eax, 3
je 0x140166ce1
lea r9, [rbp + 0x4c0]
lea rdx, [rbp + 0xb0]
lea rcx, str.Hive:__s_error__d_r_n_s
mov r8d, eax
call fcn.14029a88c
mov rcx, qword [rbp - 0x80]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
inc esi
cmp esi, dword [rsp + 0x60]
jb 0x140166a90
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov rax, qword [r14 + 0x10]
mov rdi, qword [rsp + 0x818]
sub rax, qword [r14 + 8]
mov rsi, qword [rsp + 0x810]
mov rbx, qword [rsp + 0x808]
mov r15, qword [rsp + 0x7e0]
sar rax, 3
mov rcx, qword [rbp + 0x6d0]
xor rcx, rsp
call fcn.140297ff0
add rsp, 0x7e8
pop r14
pop rbp
ret
call fcn.140299f18
int3