Function at 0x140001c40
Capabilities:
Create thread

Disassembly:
mov dword [rsp + 0x20], r9d
mov dword [rsp + 0x18], r8d
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rsi
push rdi
sub rsp, 0xd8
mov rax, qword [rsp + 0xf0]
mov qword [rsp + 0x40], rax
mov dword [rsp + 0x48], 0
mov rax, qword [rsp + 0x40]
mov qword [rax], 0
lea rcx, [rsp + 0xa0]
call qword [sym.imp.HID.DLL_HidD_GetHidGuid]
mov r9d, 0x12
xor r8d, r8d
xor edx, edx
lea rcx, [rsp + 0xa0]
call qword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsW]
mov qword [rsp + 0x68], rax
cmp qword [rsp + 0x68], 0xffffffffffffffff
je 0x140002160
mov dword [rsp + 0x50], 0
mov dword [rsp + 0x54], 1
jmp 0x140001cd2
mov eax, dword [rsp + 0x50]
inc eax
mov dword [rsp + 0x50], eax
cmp dword [rsp + 0x54], 0
je 0x140002153
mov dword [rsp + 0xb0], Ordinal_41
lea rax, [rsp + 0xb0]
mov qword [rsp + 0x20], rax
mov r9d, dword [rsp + 0x50]
lea r8, [rsp + 0xa0]
xor edx, edx
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
mov dword [rsp + 0x54], eax
cmp dword [rsp + 0x54], 0
je 0x14000214e
mov dword [rsp + 0x4c], 0
mov qword [rsp + 0x28], 0
lea rax, [rsp + 0x4c]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
lea rdx, [rsp + 0xb0]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailW]
test eax, eax
jne 0x14000214e
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x14000214e
mov eax, dword [rsp + 0x4c]
mov edx, eax
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rsp + 0x58], rax
cmp qword [rsp + 0x58], 0
je 0x14000214e
mov rax, qword [rsp + 0x58]
mov dword [rax], 8
mov qword [rsp + 0x28], 0
lea rax, [rsp + 0x4c]
mov qword [rsp + 0x20], rax
mov r9d, dword [rsp + 0x4c]
mov r8, qword [rsp + 0x58]
lea rdx, [rsp + 0xb0]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailW]
test eax, eax
je 0x140002143
mov rax, qword [rsp + 0x58]
add rax, 4
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 3
xor r9d, r9d
mov r8d, 3
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsp + 0x70], rax
cmp qword [rsp + 0x70], 0xffffffffffffffff
je 0x140002143
mov dword [rsp + 0x90], reloc.WLDAP32.dll_Ordinal_12
lea rdx, [rsp + 0x90]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.HID.DLL_HidD_GetAttributes]
movzx eax, al
test eax, eax
je 0x140002138
lea rcx, [rsp + 0x90]
call fcn.140001bb0
mov qword [rsp + 0x78], rax
cmp qword [rsp + 0x78], 0
je 0x140002138
mov rax, qword [rsp + 0x78]
movzx eax, byte [rax + 4]
and eax, dword [rsp + 0x100]
cmp eax, dword [rsp + 0x100]
jne 0x140002138
mov edx, 0xa0
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rcx, qword [rsp + 0x40]
mov qword [rcx], rax
mov rax, qword [rsp + 0x40]
cmp qword [rax], 0
je 0x140002138
lea rdx, [rsp + 0x80]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.HID.DLL_HidD_GetPreparsedData]
movzx eax, al
test eax, eax
je 0x140001f00
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
add rax, 0x24
mov rdx, rax
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.HID.DLL_HidP_GetCaps]
mov dword [rsp + 0x60], eax
cmp dword [rsp + 0x60], 0
jge 0x140001ef2
mov edx, dword [rsp + 0x60]
lea rcx, str.ERROR_kull_m_busylight_devices_get___HidP_GetCaps___08x__n
call fcn.140013fd0
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.HID.DLL_HidD_FreePreparsedData]
mov rax, qword [rsp + 0x58]
add rax, 4
mov rcx, rax
call fcn.140145740
mov rcx, qword [rsp + 0x40]
mov rcx, qword [rcx]
mov qword [rcx + 0x10], rax
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
lea rcx, [rsp + 0x90]
lea rdi, [rax + 0x18]
mov rsi, rcx
mov ecx, reloc.WLDAP32.dll_Ordinal_12
rep movsb byte [rdi], byte [rsi]
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
mov rcx, qword [rsp + 0x78]
mov qword [rax + 0x68], rcx
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
mov byte [rax + 0x70], 4
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
mov byte [rax + 0x71], 4
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
mov byte [rax + 0x72], Ordinal_88
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
mov ecx, dword [rsp + 0x48]
mov dword [rax + 8], ecx
mov rax, qword [rsp + 0x58]
add rax, 4
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 3
xor r9d, r9d
mov r8d, 3
mov edx, 3
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rcx, qword [rsp + 0x40]
mov rcx, qword [rcx]
mov qword [rcx + 0x78], rax
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
cmp qword [rax + 0x78], 0
je 0x1400020ee
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
cmp qword [rax + 0x78], 0xffffffffffffffff
je 0x1400020ee
cmp dword [rsp + 0x108], 0
je 0x1400020d5
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
mov dword [rax + 0x80], 0x1388
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
mov rax, qword [rsp + 0x40]
mov r9, qword [rax]
lea r8, [0x1400028a0]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov qword [rsp + 0x88], rax
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
mov rcx, qword [rsp + 0x88]
mov qword [rax + 0x88], rcx
cmp qword [rsp + 0x88], 0
je 0x140002077
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
mov qword [rsp + 0x40], rax
mov eax, dword [rsp + 0x48]
inc eax
mov dword [rsp + 0x48], eax
jmp 0x1400020d3
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_kull_m_busylight_devices_get___CreateThread__hKeepAliveThread___0x_08x__n
call fcn.140013fd0
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
mov rcx, qword [rax + 0x78]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
cmp qword [rax + 0x10], 0
je 0x1400020bd
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
mov rcx, qword [rax + 0x10]
call fcn.1401457c4
mov rax, qword [rsp + 0x40]
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x40]
mov qword [rcx], rax
jmp 0x1400020ec
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
mov qword [rsp + 0x40], rax
mov eax, dword [rsp + 0x48]
inc eax
mov dword [rsp + 0x48], eax
jmp 0x140002138
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_kull_m_busylight_devices_get___CreateFile__hBusy___0x_08x__n
call fcn.140013fd0
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
cmp qword [rax + 0x10], 0
je 0x140002122
mov rax, qword [rsp + 0x40]
mov rax, qword [rax]
mov rcx, qword [rax + 0x10]
call fcn.1401457c4
mov rax, qword [rsp + 0x40]
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x40]
mov qword [rcx], rax
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x140001cc8
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
jmp 0x140002174
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_kull_m_busylight_devices_get___SetupDiGetClassDevs__0x_08x__n
call fcn.140013fd0
cmp qword [rsp + 0xf8], 0
je 0x14000218d
mov rax, qword [rsp + 0xf8]
mov ecx, dword [rsp + 0x48]
mov dword [rax], ecx
cmp dword [rsp + 0x48], 0
jbe 0x14000219e
mov dword [rsp + 0x64], 1
jmp 0x1400021a6
mov dword [rsp + 0x64], 0
mov eax, dword [rsp + 0x64]
add rsp, 0xd8
pop rdi
pop rsi
ret