Function at 0x14000e540
Capabilities:
Query or enumerate registry value

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0xb8]
sub rsp, 0x1b8
mov rax, qword [0x1400d9180]
xor rax, rsp
mov qword [rbp + 0xa0], rax
mov rsi, qword [rbp + 0x120]
mov rbx, rcx
lea rcx, str.BTLINKIF:_getPortNumber
mov r13, r9
mov r14, r8
mov rdi, rdx
call fcn.14000d630
movzx edx, byte [rbx + 3]
movzx r8d, byte [rbx + 2]
movzx ecx, byte [rbx + 1]
movzx r11d, byte [rbx + 5]
movzx eax, byte [rbx + 4]
movzx r9d, byte [rbx]
mov dword [rsp + 0x40], r11d
mov dword [rsp + 0x38], eax
mov dword [rsp + 0x30], edx
mov dword [rsp + 0x28], r8d
mov dword [rsp + 0x20], ecx
lea rcx, [rbp - 0x80]
lea r8, str._02X_02X_02X_02X_02X_02X
mov edx, ntohl
call fcn.14005d88c
mov rcx, r14
call fcn.14005bc90
xor edx, edx
lea rcx, [rsp + 0x64]
lea r8d, [rdx + 0x1c]
mov r15, rax
mov dword [rsp + 0x60], 0x20
call fcn.14005bab0
and dword [rsp + 0x50], 0
xor r12d, r12d
lea r9d, [r12 + 2]
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call qword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
je 0x14000e7fb
cmp dword [rsp + 0x50], r12d
jne 0x14000e7f2
lea r8, [rsp + 0x60]
mov edx, r12d
mov rcx, rdi
call qword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
inc r12d
test eax, eax
je 0x14000e7f2
lea rax, [rsp + 0x54]
lea r8, [rbp - 0x70]
lea rdx, [rsp + 0x60]
mov r9d, 0x104
mov rcx, rdi
mov qword [rsp + 0x20], rax
call qword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInstanceIdA]
test eax, eax
je 0x14000e7e7
lea rcx, [rbp - 0x70]
mov edx, 0x104
call fcn.14005d740
movsxd rbx, r15d
lea rcx, [rbp - 0x70]
mov r8, rbx
mov rdx, r14
call fcn.14005d410
test eax, eax
jne 0x14000e7e7
lea rcx, [rbp + rbx - 0x6f]
lea rdx, [rbp - 0x80]
call fcn.14005c79c
test rax, rax
je 0x14000e7e7
lea rax, [rsp + 0x54]
lea r9, [rsp + 0x58]
lea rdx, [rsp + 0x60]
mov qword [rsp + 0x30], rax
lea rax, [rbp - 0x70]
mov r8d, ntohl
mov rcx, rdi
mov dword [rsp + 0x28], 0x104
mov qword [rsp + 0x20], rax
call qword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceRegistryPropertyA]
test eax, eax
je 0x14000e7e7
test r13, r13
je 0x14000e72a
test rsi, rsi
je 0x14000e72a
cmp dword [rsi], 0
jbe 0x14000e72a
mov ebx, dword [rsi]
lea rcx, [rbp - 0x70]
call fcn.14005bc90
cmp rax, rbx
jae 0x14000e715
lea rcx, [rbp - 0x70]
call fcn.14005bc90
mov rbx, rax
jmp 0x14000e717
dec ebx
mov edx, dword [rsi]
lea r8, [rbp - 0x70]
movsxd r9, ebx
mov rcx, r13
call fcn.14005c124
mov dword [rsi], ebx
mov eax, 1
lea rdx, [rsp + 0x60]
xor r9d, r9d
mov rcx, rdi
mov r8d, eax
mov dword [rsp + 0x28], 0x20019
mov dword [rsp + 0x20], eax
call qword [sym.imp.SETUPAPI.dll_SetupDiOpenDevRegKey]
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x14000e7e7
lea rax, [rsp + 0x54]
lea r9, [rsp + 0x58]
lea rdx, str.PortName
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x70]
xor r8d, r8d
mov rcx, rbx
mov dword [rsp + 0x54], 0x104
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x14000e7d2
lea r8, [rsp + 0x50]
lea rdx, [0x140094fe8]
lea rcx, [rbp - 0x70]
call fcn.14005d394
cmp eax, 1
je 0x14000e7c0
lea rcx, str.could_not_find_portNum_n
call fcn.14000d630
and dword [rsp + 0x50], 0
jmp 0x14000e7de
mov edx, dword [rsp + 0x50]
lea rcx, str.found_portNum:__d_n
call fcn.14000d630
jmp 0x14000e7de
lea rcx, str.could_not_read_port_name_from_device_registry_n
call fcn.14000d630
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [rsp + 0x50], 0
je 0x14000e627
mov rcx, rdi
call qword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
mov eax, dword [rsp + 0x50]
mov rcx, qword [rbp + 0xa0]
xor rcx, rsp
call fcn.14005ba20
add rsp, 0x1b8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret