Function at 0x14000159c
Capabilities:
Create thread

Disassembly:
mov rax, rsp
mov qword [rax + 0x18], rbx
mov qword [rax + 0x10], rdx
mov qword [rax + 8], rcx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x90
xor ebx, ebx
lea rcx, [rax - 0x70]
lea rdi, [0x1401403c0]
mov r14d, ebx
mov qword [0x1401403c0], rbx
call sub.HID.DLL_HidD_GetHidGuid
lea r9d, [rbx + 0x12]
lea rcx, [rsp + 0x58]
xor r8d, r8d
xor edx, edx
call qword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsW]
mov rbp, rax
cmp rax, 0xffffffffffffffff
je 0x14000192f
mov r15d, ebx
lea rax, [rsp + 0x68]
lea r8, [rsp + 0x58]
mov r9d, r15d
xor edx, edx
mov rcx, rbp
mov dword [rsp + 0x68], Ordinal_36
mov qword [rsp + 0x20], rax
call qword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
mov esi, eax
mov dword [rsp + 0xd8], eax
cmp eax, ebx
je 0x140001919
lea rax, [rsp + 0xd0]
lea rdx, [rsp + 0x68]
xor r9d, r9d
xor r8d, r8d
mov rcx, rbp
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rax
mov dword [rsp + 0xd0], ebx
call qword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailW]
cmp eax, ebx
jne 0x140001919
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x140001919
mov edx, dword [rsp + 0xd0]
lea ecx, [rax - 0x3a]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov r12, rax
cmp rax, rbx
je 0x140001919
mov dword [rax], 8
mov r9d, dword [rsp + 0xd0]
lea rax, [rsp + 0xd0]
lea rdx, [rsp + 0x68]
mov r8, r12
mov rcx, rbp
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rax
call qword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailW]
cmp eax, ebx
je 0x140001910
xor r9d, r9d
mov qword [rsp + 0x30], rbx
lea rcx, [r12 + 4]
lea r8d, [r9 + 3]
xor edx, edx
mov dword [rsp + 0x28], ebx
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r13, rax
cmp rax, 0xffffffffffffffff
je 0x140001910
lea rdx, [rsp + 0x48]
mov rcx, rax
mov dword [rsp + 0x48], reloc.WLDAP32.dll_Ordinal_12
call sub.HID.DLL_HidD_GetAttributes
cmp al, bl
je 0x140001907
movzx edx, word [rsp + 0x4e]
movzx r8d, word [rsp + 0x4c]
mov ecx, ebx
lea rax, [0x1400e07f2]
cmp word [rax - 2], r8w
jne 0x14000173f
cmp word [rax], dx
je 0x140001896
inc ecx
add rax, 0x10
cmp ecx, 6
jb 0x14000172f
mov rsi, rbx
cmp rsi, rbx
je 0x140001900
test byte [rsi + 4], 2
je 0x140001900
mov edx, 0xa0
lea ecx, [rdx - 0x60]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rdi], rax
cmp rax, rbx
je 0x140001900
lea rdx, [rsp + 0x40]
mov rcx, r13
call sub.HID.DLL_HidD_GetPreparsedData
cmp al, bl
je 0x1400017b8
mov rdx, qword [rdi]
mov rcx, qword [rsp + 0x40]
add rdx, 0x24
call sub.HID.DLL_HidP_GetCaps
cmp eax, ebx
jge 0x1400017ae
lea rcx, str.ERROR_kull_m_busylight_devices_get___HidP_GetCaps___08x__n
mov edx, eax
call fcn.14000c030
mov rcx, qword [rsp + 0x40]
call sub.HID.DLL_HidD_FreePreparsedData
lea rcx, [r12 + 4]
call qword [sym.imp.msvcrt.dll__wcsdup]
lea rdx, [rsp + 0x48]
mov qword [rsp + 0x30], rbx
mov r11, rax
mov rax, qword [rdi]
xor r9d, r9d
mov qword [rax + 0x10], r11
mov eax, dword [rdx]
mov rcx, qword [rdi]
mov dword [rcx + 0x18], eax
mov eax, dword [rdx + 4]
mov dword [rsp + 0x28], ebx
mov dword [rcx + 0x1c], eax
mov eax, dword [rdx + 8]
mov edx, 3
mov dword [rcx + 0x20], eax
mov rax, qword [rdi]
lea rcx, [r12 + 4]
mov qword [rax + 0x68], rsi
mov rax, qword [rdi]
mov r8d, edx
mov byte [rax + 0x70], 4
mov rax, qword [rdi]
mov dword [rsp + 0x20], edx
mov byte [rax + 0x71], 4
mov rax, qword [rdi]
mov byte [rax + 0x72], Ordinal_88
mov rax, qword [rdi]
mov dword [rax + 8], r14d
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r11, rax
mov rax, qword [rdi]
mov qword [rax + 0x78], r11
mov rax, qword [rdi]
cmp qword [rax + 0x78], rbx
je 0x1400018ce
cmp qword [rax + 0x78], 0xffffffffffffffff
je 0x1400018ce
mov dword [rax + 0x80], 0x1388
mov r9, qword [rdi]
lea r8, [0x140001968]
xor edx, edx
xor ecx, ecx
mov qword [rsp + 0x28], rbx
mov dword [rsp + 0x20], ebx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov r11, rax
mov rax, qword [rdi]
mov qword [rax + 0x88], r11
mov rax, qword [rdi]
cmp qword [rax + 0x88], rbx
je 0x1400018ab
mov rdi, rax
inc r14d
jmp 0x140001900
mov esi, ecx
lea rax, [0x1400e07f0]
shl rsi, 4
add rsi, rax
jmp 0x14000174d
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.ERROR_kull_m_busylight_devices_get___CreateThread__hKeepAliveThread___0x_08x__n
mov edx, eax
call fcn.14000c030
mov rcx, qword [rdi]
mov rcx, qword [rcx + 0x78]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1400018e2
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.ERROR_kull_m_busylight_devices_get___CreateFile__hBusy___0x_08x__n
mov edx, eax
call fcn.14000c030
mov r11, qword [rdi]
mov rcx, qword [r11 + 0x10]
cmp rcx, rbx
je 0x1400018f4
call qword [sym.imp.msvcrt.dll_free]
mov rcx, qword [rdi]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov qword [rdi], rax
mov esi, dword [rsp + 0xd8]
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_LocalFree]
inc r15d
cmp esi, ebx
jne 0x1400015fd
mov rcx, rbp
call qword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
jmp 0x140001943
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.ERROR_kull_m_busylight_devices_get___SetupDiGetClassDevs__0x_08x__n
mov edx, eax
call fcn.14000c030
cmp r14d, ebx
seta bl
mov eax, ebx
mov rbx, qword [rsp + 0xe0]
add rsp, 0x90
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret