Function at 0x140021c30
Capabilities:
Check os version
Query or enumerate registry value

Disassembly:
mov rax, rsp
push rbp
push r14
push r15
lea rbp, [rax - 0x1f8]
sub rsp, 0x2e0
mov qword [rbp - 0x70], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x1403b88b0]
xor rax, rsp
mov qword [rbp + 0x1d0], rax
mov rdi, rcx
mov rax, qword [rcx + 0x98]
test byte [rax + 0x1a0], 8
je 0x140021ebc
xor r15d, r15d
mov qword [rsp + 0x78], r15
mov dword [rbp - 0x80], r15d
mov qword [rbp - 0x78], r15
mov r9d, 0x20019
lea r8, str.SoftwareRealtekAudioGUI_INFORMATIONDeviceDefault
mov rdx, 0xffffffff80000002
lea rcx, [rsp + 0x78]
call fcn.1400146e0
test eax, eax
je 0x140021cd1
lea r8, str.c:userschunyung_source_repos_rtkngui_rtkngui_audiodevicemgr.cpp
mov edx, 0x79c
lea rcx, str._VCpl__RETURN_ON_FALSE:_Line___d__File___s_n
call fcn.140052e90
jmp 0x140021eac
call fcn.1400f5f94
mov rcx, rax
test rax, rax
je 0x14002248e
mov rax, qword [rax]
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x30], rbx
mov edx, 0xa
lea rcx, [rbp - 0x68]
call fcn.140104d88
nop
mov rdi, qword [rdi + 0xf48]
test rdi, rdi
je 0x140021d3d
nop dword [rax]
mov rdx, rdi
test rdi, rdi
je 0x140022499
mov rdi, qword [rdi]
mov rdx, qword [rdx + 0x10]
test rdx, rdx
je 0x140021d38
add rdx, 0x118
lea rcx, [rbp - 0x68]
call fcn.140104e8c
test rdi, rdi
jne 0x140021d10
xor edx, edx
mov r8d, 0x200
lea rcx, [rbp - 0x30]
call fcn.1402841a0
mov dword [rsp + 0x38], 0x200
mov edi, r15d
lea rax, [rsp + 0x38]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x30]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x68]
xor r8d, r8d
lea rdx, str.DefaultPlaybackDevice
mov r14, qword [rsp + 0x78]
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov rsi, 0xffffffffffffffff
test eax, eax
jne 0x140021dc0
mov eax, dword [rsp + 0x68]
dec eax
cmp eax, 1
ja 0x140021dc0
mov ecx, dword [rsp + 0x38]
test ecx, ecx
je 0x140021ee8
test cl, 1
jne 0x140021dc0
mov eax, ecx
shr rax, 1
cmp word [rbp + rax*2 - 0x32], di
je 0x140021eed
xor edx, edx
mov r8d, 0x200
lea rcx, [rbp - 0x30]
call fcn.1402841a0
lea eax, [rdi + rdi]
mov dword [rsp + 0x3c], eax
mov edi, r15d
lea rax, [rsp + 0x3c]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x30]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x6c]
xor r8d, r8d
lea rdx, str.DefaultCaptureDevice
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x140021e36
mov eax, dword [rsp + 0x6c]
dec eax
cmp eax, 1
ja 0x140021e36
mov ecx, dword [rsp + 0x3c]
test ecx, ecx
je 0x14002200f
test cl, 1
jne 0x140021e36
mov eax, ecx
shr rax, 1
cmp word [rbp + rax*2 - 0x32], di
je 0x140022014
mov eax, dword [0x1403db8d4]
test eax, eax
jne 0x140021e5d
mov dword [0x1403db8d0], 0x114
lea rcx, [0x1403db8d0]
call qword [sym.imp.KERNEL32.dll_GetVersionExW]
mov eax, dword [0x1403db8d4]
cmp eax, 6
jne 0x14002213f
cmp dword [0x1403db8d8], 1
jae 0x140022145
test r14, r14
je 0x140021e86
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov qword [rsp + 0x78], r15
mov dword [rbp - 0x80], r15d
lea rcx, [rbp - 0x68]
call fcn.140104db0
nop
lea rdx, [rbx - 0x18]
lock xadd dword [rdx + 0x10], esi
sub esi, 1
jg 0x140021eac
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rcx, qword [rsp + 0x78]
test rcx, rcx
je 0x140021ebc
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov rcx, qword [rbp + 0x1d0]
xor rcx, rsp
call fcn.140281bf0
lea r11, [rsp + 0x2e0]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rdi, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop rbp
ret
mov word [rbp - 0x30], r15w
mov edi, ecx
shr edi, 1
lea r8, [rsp + 0x30]
mov edx, 1
xor ecx, ecx
call fcn.140053280
mov rbx, qword [rsp + 0x30]
mov rax, rbx
lea rdx, [rbp - 0x30]
sub rdx, rbx
movzx ecx, word [rax]
cmp cx, word [rax + rdx]
jne 0x140021f28
add rax, 2
test cx, cx
jne 0x140021f11
mov eax, r15d
jmp 0x140021f2d
sbb eax, eax
or eax, 1
test eax, eax
je 0x140021fe3
lea rcx, [rbp - 0x30]
mov rax, rsi
nop dword [rax]
inc rax
cmp word [rcx + rax*2], 0
jne 0x140021f40
mov r8d, eax
lea rdx, [rbp - 0x30]
lea rcx, [rsp + 0x30]
call fcn.140010390
xor r8d, r8d
mov rbx, qword [rsp + 0x30]
mov rdx, rbx
lea rcx, [rbp - 0x68]
call fcn.140104f90
test rax, rax
je 0x140021fe3
mov qword [rsp + 0x48], r15
lea rax, [rsp + 0x48]
mov qword [rsp + 0x20], rax
lea r9, [0x140322af8]
xor edx, edx
lea r8d, [rdx + 1]
lea rcx, [0x140322b08]
call qword [sym.imp.ole32.dll_CoCreateInstance]
test eax, eax
jns 0x140021fbe
mov r9d, eax
lea r8, str.c:userschunyung_source_repos_rtkngui_rtknguidefdevsetting.cpp
mov edx, 0x4c
lea rcx, str._VCpl__RETURN_FALSE_ON_ERROR:_Line___d__File___s__hr__0x_X_n
call fcn.140052e90
jmp 0x140021fd3
mov rcx, qword [rsp + 0x48]
mov rax, qword [rcx]
mov r8d, 1
mov rdx, rbx
call qword [rax + 0x60]
nop
mov rcx, qword [rsp + 0x48]
test rcx, rcx
je 0x140021fe3
mov rax, qword [rcx]
call qword [rax + 0x10]
movsxd rdx, dword [rbx - 0xc]
mov rcx, rbx
call fcn.140289b40
test eax, eax
js 0x14002249f
cmp eax, dword [rbx - 0xc]
jg 0x14002249f
mov dword [rbx - 0x10], eax
cdqe
mov word [rbx + rax*2], r15w
jmp 0x140021dc0
mov word [rbp - 0x30], r15w
mov edi, ecx
shr edi, 1
lea r8, [rsp + 0x30]
mov edx, 1
mov ecx, edx
call fcn.140053280
mov rbx, qword [rsp + 0x30]
mov rax, rbx
lea rdx, [rbp - 0x30]
sub rdx, rbx
nop dword [rax + rax]
movzx ecx, word [rax]
cmp cx, word [rax + rdx]
jne 0x140022057
add rax, 2
test cx, cx
jne 0x140022040
mov eax, r15d
jmp 0x14002205c
sbb eax, eax
or eax, 1
test eax, eax
je 0x140022113
lea rcx, [rbp - 0x30]
mov rax, rsi
nop dword [rax + rax]
inc rax
cmp word [rcx + rax*2], 0
jne 0x140022070
mov r8d, eax
lea rdx, [rbp - 0x30]
lea rcx, [rsp + 0x30]
call fcn.140010390
xor r8d, r8d
mov rbx, qword [rsp + 0x30]
mov rdx, rbx
lea rcx, [rbp - 0x68]
call fcn.140104f90
test rax, rax
je 0x140022113
mov qword [rsp + 0x50], r15
lea rax, [rsp + 0x50]
mov qword [rsp + 0x20], rax
lea r9, [0x140322af8]
xor edx, edx
lea r8d, [rdx + 1]
lea rcx, [0x140322b08]
call qword [sym.imp.ole32.dll_CoCreateInstance]
test eax, eax
jns 0x1400220ee
mov r9d, eax
lea r8, str.c:userschunyung_source_repos_rtkngui_rtknguidefdevsetting.cpp
mov edx, 0x4c
lea rcx, str._VCpl__RETURN_FALSE_ON_ERROR:_Line___d__File___s__hr__0x_X_n
call fcn.140052e90
jmp 0x140022103
mov rcx, qword [rsp + 0x50]
mov rax, qword [rcx]
mov r8d, 1
mov rdx, rbx
call qword [rax + 0x60]
nop
mov rcx, qword [rsp + 0x50]
test rcx, rcx
je 0x140022113
mov rax, qword [rcx]
call qword [rax + 0x10]
movsxd rdx, dword [rbx - 0xc]
mov rcx, rbx
call fcn.140289b40
test eax, eax
js 0x1400224aa
cmp eax, dword [rbx - 0xc]
jg 0x1400224aa
mov dword [rbx - 0x10], eax
cdqe
mov word [rbx + rax*2], r15w
jmp 0x140021e36
jbe 0x140021e73
xor edx, edx
mov r8d, 0x200
lea rcx, [rbp - 0x30]
call fcn.1402841a0
lea eax, [rdi + rdi]
mov dword [rsp + 0x40], eax
mov edi, r15d
lea rax, [rsp + 0x40]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x30]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x70]
xor r8d, r8d
lea rdx, str.DefaultCommPlaybackDevice
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x1400221bb
mov eax, dword [rsp + 0x70]
dec eax
cmp eax, 1
ja 0x1400221bb
mov ecx, dword [rsp + 0x40]
test ecx, ecx
je 0x14002223d
test cl, 1
jne 0x1400221bb
mov eax, ecx
shr rax, 1
cmp word [rbp + rax*2 - 0x32], di
je 0x140022242
xor edx, edx
mov r8d, 0x200
lea rcx, [rbp - 0x30]
call fcn.1402841a0
lea eax, [rdi + rdi]
mov dword [rsp + 0x44], eax
lea rax, [rsp + 0x44]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x30]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x74]
xor r8d, r8d
lea rdx, str.DefaultCommCaptureDevice
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x140021e73
mov eax, dword [rsp + 0x74]
dec eax
cmp eax, 1
ja 0x140021e73
mov eax, dword [rsp + 0x44]
test eax, eax
je 0x140022360
test al, 1
jne 0x140021e73
shr rax, 1
cmp word [rbp + rax*2 - 0x32], 0
je 0x140022365
jmp 0x140021e73
mov word [rbp - 0x30], r15w
mov edi, ecx
shr edi, 1
lea r8, [rsp + 0x30]
mov edx, 2
xor ecx, ecx
call fcn.140053280
mov rbx, qword [rsp + 0x30]
mov rax, rbx
lea rdx, [rbp - 0x30]
sub rdx, rbx
movzx ecx, word [rax]
cmp cx, word [rax + rdx]
jne 0x14002227d
add rax, 2
test cx, cx
jne 0x140022266
mov eax, r15d
jmp 0x140022282
sbb eax, eax
or eax, 1
test eax, eax
je 0x140022334
lea rcx, [rbp - 0x30]
mov rax, rsi
inc rax
cmp word [rcx + rax*2], 0
jne 0x140022291
mov r8d, eax
lea rdx, [rbp - 0x30]
lea rcx, [rsp + 0x30]
call fcn.140010390
xor r8d, r8d
mov rbx, qword [rsp + 0x30]
mov rdx, rbx
lea rcx, [rbp - 0x68]
call fcn.140104f90
test rax, rax
je 0x140022334
mov qword [rsp + 0x58], r15
lea rax, [rsp + 0x58]
mov qword [rsp + 0x20], rax
lea r9, [0x140322af8]
xor edx, edx
lea r8d, [rdx + 1]
lea rcx, [0x140322b08]
call qword [sym.imp.ole32.dll_CoCreateInstance]
test eax, eax
jns 0x14002230f
mov r9d, eax
lea r8, str.c:userschunyung_source_repos_rtkngui_rtknguidefdevsetting.cpp
mov edx, 0x4c
lea rcx, str._VCpl__RETURN_FALSE_ON_ERROR:_Line___d__File___s__hr__0x_X_n
call fcn.140052e90
jmp 0x140022324
mov rcx, qword [rsp + 0x58]
mov rax, qword [rcx]
mov r8d, 2
mov rdx, rbx
call qword [rax + 0x60]
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x140022334
mov rax, qword [rcx]
call qword [rax + 0x10]
movsxd rdx, dword [rbx - 0xc]
mov rcx, rbx
call fcn.140289b40
test eax, eax
js 0x140022478
cmp eax, dword [rbx - 0xc]
jg 0x140022478
mov dword [rbx - 0x10], eax
cdqe
mov word [rbx + rax*2], r15w
jmp 0x1400221bb
mov word [rbp - 0x30], r15w
lea r8, [rsp + 0x30]
mov edx, 2
lea ecx, [rdx - 1]
call fcn.140053280
mov rbx, qword [rsp + 0x30]
mov rax, rbx
lea rdx, [rbp - 0x30]
sub rdx, rbx
movzx ecx, word [rax]
cmp cx, word [rax + rdx]
jne 0x14002239d
add rax, 2
test cx, cx
jne 0x140022386
mov eax, r15d
jmp 0x1400223a2
sbb eax, eax
or eax, 1
test eax, eax
je 0x140022454
lea rcx, [rbp - 0x30]
mov rax, rsi
inc rax
cmp word [rcx + rax*2], 0
jne 0x1400223b1
mov r8d, eax
lea rdx, [rbp - 0x30]
lea rcx, [rsp + 0x30]
call fcn.140010390
xor r8d, r8d
mov rbx, qword [rsp + 0x30]
mov rdx, rbx
lea rcx, [rbp - 0x68]
call fcn.140104f90
test rax, rax
je 0x140022454
mov qword [rsp + 0x60], r15
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
lea r9, [0x140322af8]
xor edx, edx
lea r8d, [rdx + 1]
lea rcx, [0x140322b08]
call qword [sym.imp.ole32.dll_CoCreateInstance]
test eax, eax
jns 0x14002242f
mov r9d, eax
lea r8, str.c:userschunyung_source_repos_rtkngui_rtknguidefdevsetting.cpp
mov edx, 0x4c
lea rcx, str._VCpl__RETURN_FALSE_ON_ERROR:_Line___d__File___s__hr__0x_X_n
call fcn.140052e90
jmp 0x140022444
mov rcx, qword [rsp + 0x60]
mov rax, qword [rcx]
mov r8d, 2
mov rdx, rbx
call qword [rax + 0x60]
nop
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140022454
mov rax, qword [rcx]
call qword [rax + 0x10]
movsxd rdx, dword [rbx - 0xc]
mov rcx, rbx
call fcn.140289b40
test eax, eax
js 0x140022483
cmp eax, dword [rbx - 0xc]
jg 0x140022483
mov dword [rbx - 0x10], eax
cdqe
mov word [rbx + rax*2], r15w
jmp 0x140021e73
mov ecx, 0x80070057
call fcn.14000dc70
int3
mov ecx, 0x80070057
call fcn.14000dc70
nop
mov ecx, 0x80004005
call fcn.14000dc70
nop
call fcn.1400f5890
int3
mov ecx, 0x80070057
call fcn.14000dc70
int3
mov ecx, 0x80070057
call fcn.14000dc70
int3