Function at 0x140047f50
Capabilities:
Query or enumerate registry value

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rsi
push rbp
push rdi
push r12
lea rbp, [rsp - 0x70]
sub rsp, 0x170
mov rax, qword [0x1400d9180]
xor rax, rsp
mov qword [rbp + 0x60], rax
movzx ebx, dl
xor edx, edx
mov r12, rcx
lea rcx, [rsp + 0x3c]
lea r8d, [rdx + 0x1c]
mov dword [rsp + 0x38], 0x20
call fcn.14005bab0
lea rcx, str.CWaitWakeEnabledHidDevs::enumHIDs:_bKeyboards_d_n
mov edx, ebx
call fcn.1400300fc
lea rax, [0x14009e6b0]
lea rcx, [0x14009e710]
test bl, bl
cmovne rcx, rax
xor r9d, r9d
xor r8d, r8d
xor edx, edx
call qword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsW]
mov rsi, rax
test rax, rax
jne 0x140047fe7
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str._CWaitWakeEnabledHidDevs::enumHIDs:_SetupDiGetClassDevs_failed._err_d_n
mov edx, eax
call fcn.1400300fc
jmp 0x1400481c6
xor ebx, ebx
lea r8, [rsp + 0x38]
mov edx, ebx
mov rcx, rsi
call qword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
test eax, eax
je 0x14004819c
and qword [rsp + 0x20], 0
lea r8, [rsp + 0x60]
lea rdx, [rsp + 0x38]
mov r9d, 0x100
mov rcx, rsi
mov dword [rsp + 0x34], 0x100
call qword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInstanceIdA]
test eax, eax
jne 0x140048045
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str._CWaitWakeEnabledHidDevs::enumHIDs:_SetupDiGetDeviceInstanceId_failed._err_d_n
mov edx, eax
call fcn.1400300fc
jmp 0x14004818c
lea rcx, [rsp + 0x60]
mov edx, 0x100
call fcn.14005d740
lea rdx, str.HID00001124_0000_1000_8000_00805F9B34FB
lea rcx, [rsp + 0x60]
call fcn.14005c79c
test rax, rax
jne 0x140048080
lea rdx, [rsp + 0x60]
lea rcx, str.CWaitWakeEnabledHidDevs::enumHIDs:_ignore_non_BT_HID__hs_n
call fcn.1400300fc
jmp 0x14004818c
xor r9d, r9d
lea rdx, [rsp + 0x38]
mov rcx, rsi
lea r8d, [r9 + 1]
mov dword [rsp + 0x28], 0x20019
mov dword [rsp + 0x20], 1
call qword [sym.imp.SETUPAPI.dll_SetupDiOpenDevRegKey]
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x1400480c0
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str._CWaitWakeEnabledHidDevs::enumHIDs:_SetupDiOpenDevRegKey_failed._err_d_n
jmp 0x140048039
lea rax, [rsp + 0x34]
lea rdx, str.WaitWakeEnabled
xor r9d, r9d
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x30]
xor r8d, r8d
mov rcx, rdi
mov dword [rsp + 0x34], 4
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x14004810c
lea rcx, str.CWaitWakeEnabledHidDevs::enumHIDs:_no_value_WaitWakeEnabled._RegQueryValueEx_returned__d_n
mov edx, eax
call fcn.1400300fc
mov dword [rsp + 0x30], 1
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [rsp + 0x30], 0
lea rdx, [rsp + 0x60]
mov rcx, r12
jne 0x140048159
call fcn.140047e30
lea rdx, [rsp + 0x60]
test al, al
jne 0x14004813e
lea rcx, str.CWaitWakeEnabledHidDevs::enumHIDs:_do_not_remember_non_WaitWakeEnabled__hs_n
jmp 0x140048076
lea rcx, str.CWaitWakeEnabledHidDevs::enumHIDs:_remove_non_WaitWakeEnabled__hs_n
call fcn.1400300fc
lea rdx, [rsp + 0x60]
mov rcx, r12
call fcn.140047e90
jmp 0x14004818c
call fcn.140047e30
lea rdx, [rsp + 0x60]
test al, al
je 0x140048173
lea rcx, str.CWaitWakeEnabledHidDevs::enumHIDs:_remembered_already_WaitWakeEnabled__hs_n
jmp 0x140048076
lea rcx, str.CWaitWakeEnabledHidDevs::enumHIDs:_remember_WaitWakeEnabled__hs_n
call fcn.1400300fc
lea rdx, [rsp + 0x60]
mov rcx, r12
call fcn.140047d90
inc ebx
cmp ebx, 0x3e8
jb 0x140047fe9
jmp 0x1400481bd
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x103
je 0x1400481bd
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str._CWaitWakeEnabledHidDevs::enumHIDs:_SetupDiEnumDeviceInfo_failed._err_d_n
mov edx, eax
call fcn.1400300fc
mov rcx, rsi
call qword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
lea rcx, str.CWaitWakeEnabledHidDevs::enumHIDs:_exits_n
call fcn.1400300fc
mov rcx, qword [rbp + 0x60]
xor rcx, rsp
call fcn.14005ba20
lea r11, [rsp + 0x170]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r12
pop rdi
pop rbp
ret