Function at 0x401553
Capabilities:
Create thread

Disassembly:
sub esp, 0x5c
push ebx
push ebp
lea eax, [esp + 0x38]
xor ebp, ebp
push eax
mov ebx, 0x4fdfc4
mov dword [esp + 0x14], ebp
mov dword [0x4fdfc4], ebp
call sub.HID.DLL_HidD_GetHidGuid
push 0x12
push ebp
push ebp
lea eax, [esp + 0x44]
push eax
call dword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsW]
mov dword [esp + 0xc], eax
cmp eax, 0xffffffff
je 0x4017ed
push esi
mov dword [esp + 0x1c], ebp
push edi
lea eax, [esp + 0x50]
push eax
push dword [esp + 0x24]
lea eax, [esp + 0x48]
push eax
push ebp
push dword [esp + 0x24]
mov dword [esp + 0x64], 0x1c
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
mov dword [esp + 0x30], eax
cmp eax, ebp
je 0x4017d1
mov edi, dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailW]
push ebp
lea eax, [esp + 0x14]
push eax
push ebp
push ebp
lea eax, [esp + 0x60]
push eax
push dword [esp + 0x28]
mov dword [esp + 0x28], ebp
call edi
test eax, eax
jne 0x4017d1
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x4017d1
push dword [esp + 0x10]
mov esi, dword [sym.imp.KERNEL32.dll_LocalAlloc]
push 0x40
call esi
mov dword [esp + 0x1c], eax
cmp eax, ebp
je 0x4017d1
push ebp
lea ecx, [esp + 0x14]
push ecx
mov dword [eax], 6
push dword [esp + 0x18]
push eax
lea eax, [esp + 0x60]
push eax
push dword [esp + 0x28]
call edi
test eax, eax
je 0x4017c7
mov edi, dword [esp + 0x1c]
push ebp
push ebp
push 3
push ebp
push 3
push ebp
add edi, 4
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x28], eax
cmp eax, 0xffffffff
je 0x4017c7
lea ecx, [esp + 0x34]
push ecx
push eax
mov dword [esp + 0x3c], 0xc
call sub.HID.DLL_HidD_GetAttributes
test al, al
je 0x4017bd
lea edx, [esp + 0x34]
call fcn.00401517
mov dword [esp + 0x2c], eax
cmp eax, ebp
je 0x4017bd
test byte [eax + 4], 2
je 0x4017bd
push 0x74
push 0x40
call esi
mov dword [ebx], eax
cmp eax, ebp
je 0x4017bd
lea eax, [esp + 0x24]
push eax
push dword [esp + 0x2c]
call sub.HID.DLL_HidD_GetPreparsedData
test al, al
je 0x4016dc
mov eax, dword [ebx]
add eax, 0x18
push eax
push dword [esp + 0x28]
call sub.HID.DLL_HidP_GetCaps
cmp eax, ebp
jge 0x4016d3
push eax
push str.ERROR_kull_m_busylight_devices_get___HidP_GetCaps___08x__n
call fcn.00409709
pop ecx
pop ecx
push dword [esp + 0x24]
call sub.HID.DLL_HidD_FreePreparsedData
push edi
call dword [sym.imp.msvcrt.dll__wcsdup]
pop ecx
mov ecx, dword [ebx]
mov dword [ecx + 8], eax
mov edi, dword [ebx]
mov ecx, dword [esp + 0x2c]
add edi, 0xc
lea esi, [esp + 0x34]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov eax, dword [ebx]
mov dword [eax + 0x58], ecx
mov eax, dword [ebx]
mov ecx, dword [esp + 0x18]
mov byte [eax + 0x5c], 4
mov eax, dword [ebx]
push ebp
mov byte [eax + 0x5d], 4
mov eax, dword [ebx]
push ebp
mov byte [eax + 0x5e], 0x55
mov eax, dword [ebx]
push 3
push ebp
mov dword [eax + 4], ecx
mov eax, dword [esp + 0x2c]
push 3
push 3
add eax, 4
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [ebx]
mov dword [ecx + 0x60], eax
mov eax, dword [ebx]
mov ecx, dword [eax + 0x60]
cmp ecx, ebp
je 0x40178f
cmp ecx, 0xffffffff
je 0x40178f
push ebp
push ebp
mov dword [eax + 0x64], 0x1388
push dword [ebx]
push 0x401aad
push ebp
push ebp
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov ecx, dword [ebx]
mov dword [ecx + 0x68], eax
mov eax, dword [ebx]
cmp dword [eax + 0x68], ebp
je 0x40176f
inc dword [esp + 0x18]
mov ebx, eax
jmp 0x4017bd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_busylight_devices_get___CreateThread__hKeepAliveThread___0x_08x__n
call fcn.00409709
mov eax, dword [ebx]
pop ecx
pop ecx
push dword [eax + 0x60]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4017a2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_busylight_devices_get___CreateFile__hBusy___0x_08x__n
call fcn.00409709
pop ecx
pop ecx
mov eax, dword [ebx]
mov eax, dword [eax + 8]
cmp eax, ebp
je 0x4017b3
push eax
call dword [sym.imp.msvcrt.dll_free]
pop ecx
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebx], eax
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_LocalFree]
inc dword [esp + 0x20]
cmp dword [esp + 0x30], ebp
jne 0x401595
push dword [esp + 0x14]
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
pop edi
pop esi
jmp 0x401800
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_busylight_devices_get___SetupDiGetClassDevs__0x_08x__n
call fcn.00409709
pop ecx
pop ecx
xor eax, eax
cmp eax, dword [esp + 0x10]
pop ebp
sbb eax, eax
neg eax
pop ebx
add esp, 0x5c
ret