Function at 0x140004050
Capabilities:
Query or enumerate registry value

Disassembly:
mov qword [rsp + 0x20], rbx
push rsi
push rdi
push r14
mov eax, 0x2570
call fcn.14000a950
sub rsp, rax
mov rax, qword [0x140039020]
xor rax, rsp
mov qword [rsp + 0x2560], rax
mov rsi, r8
mov rbx, rdx
mov rdi, rcx
mov dword [rsp + 0x40], 0x114
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetVersionExW]
mov rcx, rdi
call fcn.140005570
xor edx, edx
mov rcx, qword [rdi]
call fcn.140006ba0
cmp dword [rsp + 0x50], 1
jne 0x14000427f
xor edx, edx
mov r8d, 0x400
lea rcx, [rsp + 0x160]
call fcn.14000c840
mov qword [rsp + 0x20], 0
mov r9d, 0x400
lea r8, [rsp + 0x160]
mov rdx, rsi
mov rcx, rbx
call qword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInstanceIdW]
test eax, eax
je 0x140004307
lea rdx, [rsp + 0x160]
lea rcx, [rsp + 0x30]
call fcn.1400054a0
nop
lea rcx, [rsp + 0x30]
call fcn.140005e80
mov rdx, rax
mov ebx, 0xffffffff
test rax, rax
je 0x140004159
mov rcx, rax
xor eax, eax
cmp word [rcx], ax
je 0x14000413d
nop word [rax + rax]
lea rcx, [rcx + 2]
inc rax
cmp word [rcx], 0
jne 0x140004130
lea rax, [rdx + rax*2]
cmp rax, rdx
jb 0x140004159
cmp word [rax], 0x5c
je 0x140004274
sub rax, 2
cmp rax, rdx
jae 0x140004146
mov eax, ebx
xor r8d, r8d
test eax, eax
cmovns r8d, eax
inc r8d
mov r9d, 6
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0x30]
call fcn.1400061a0
mov r14, rax
cmp rdi, rax
je 0x1400041dd
mov rdx, qword [rdi]
test rdx, rdx
je 0x1400041cf
mov ecx, ebx
lock xadd dword [rdx], ecx
cmp ecx, 1
jne 0x1400041c8
mov rsi, qword [rdi]
test rsi, rsi
je 0x1400041c8
mov rcx, qword [rsi + 8]
test rcx, rcx
je 0x1400041ad
call fcn.140011314
mov rcx, qword [rsi + 0x10]
test rcx, rcx
je 0x1400041bb
call fcn.140011314
mov edx, 0x28
mov rcx, rsi
call fcn.14000a26c
mov qword [rdi], 0
mov rax, qword [r14]
mov qword [rdi], rax
test rax, rax
je 0x1400041dd
lock inc dword [rax]
mov rax, qword [rsp + 0x38]
test rax, rax
je 0x140004226
mov ecx, ebx
lock xadd dword [rax], ecx
cmp ecx, 1
jne 0x140004226
mov rdi, qword [rsp + 0x38]
test rdi, rdi
je 0x140004226
mov rcx, qword [rdi + 8]
test rcx, rcx
je 0x14000420a
call fcn.140011314
mov rcx, qword [rdi + 0x10]
test rcx, rcx
je 0x140004218
call fcn.140011314
mov edx, 0x28
mov rcx, rdi
call fcn.14000a26c
nop
mov rax, qword [rsp + 0x30]
test rax, rax
je 0x140004307
lock xadd dword [rax], ebx
cmp ebx, 1
jne 0x140004307
mov rbx, qword [rsp + 0x30]
mov rcx, qword [rbx + 8]
test rcx, rcx
je 0x140004254
call fcn.140011314
mov rcx, qword [rbx + 0x10]
test rcx, rcx
je 0x140004262
call fcn.140011314
mov edx, 0x28
mov rcx, rbx
call fcn.14000a26c
jmp 0x140004307
sub rax, rdx
sar rax, 1
jmp 0x14000415b
mov dword [rsp + 0x28], 0xf003f
mov dword [rsp + 0x20], 1
xor r9d, r9d
lea r8d, [r9 + 1]
mov rdx, rsi
mov rcx, rbx
call qword [sym.imp.SETUPAPI.dll_SetupDiOpenDevRegKey]
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x140004307
mov dword [rsp + 0x30], 0x1000
lea rax, [rsp + 0x30]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x560]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
lea rdx, str.PortName
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x1400042fe
cmp dword [rsp + 0x30], 0x1000
ja 0x1400042fe
lea rdx, [rsp + 0x560]
mov rcx, rdi
call fcn.1400059c0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov rcx, qword [rsp + 0x2560]
xor rcx, rsp
call fcn.14000a220
mov rbx, qword [rsp + 0x25a8]
add rsp, 0x2570
pop r14
pop rdi
pop rsi
ret