Function at 0x40110f
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5c
push ebx
push edi
lea eax, [ebp - 0x40]
xor edi, edi
push eax
mov ebx, 0x48718c
mov dword [ebp - 0xc], edi
mov dword [0x48718c], edi
call sub.HID.DLL_HidD_GetHidGuid
push 0x12
push edi
push edi
lea eax, [ebp - 0x40]
push eax
call dword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsW]
mov dword [ebp - 8], eax
cmp eax, 0xffffffff
je 0x401389
mov dword [ebp - 0x14], edi
push esi
lea eax, [ebp - 0x5c]
push eax
push dword [ebp - 0x14]
lea eax, [ebp - 0x40]
push eax
push edi
push dword [ebp - 8]
mov dword [ebp - 0x5c], 0x1c
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
mov dword [ebp - 0x24], eax
cmp eax, edi
je 0x401371
mov esi, dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailW]
push edi
lea eax, [ebp - 4]
push eax
push edi
push edi
lea eax, [ebp - 0x5c]
push eax
push dword [ebp - 8]
mov dword [ebp - 4], edi
call esi
test eax, eax
jne 0x401371
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x401371
push dword [ebp - 4]
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x10], eax
cmp eax, edi
je 0x401371
push edi
lea ecx, [ebp - 4]
push ecx
mov dword [eax], 6
push dword [ebp - 4]
push eax
lea eax, [ebp - 0x5c]
push eax
push dword [ebp - 8]
call esi
test eax, eax
je 0x401368
mov esi, dword [ebp - 0x10]
push edi
push edi
push 3
push edi
push 3
push edi
add esi, 4
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x1c], eax
cmp eax, 0xffffffff
je 0x401355
lea ecx, [ebp - 0x30]
push ecx
push eax
mov dword [ebp - 0x30], 0xc
call sub.HID.DLL_HidD_GetAttributes
test al, al
je 0x40134a
lea edx, [ebp - 0x30]
call fcn.004010d3
mov dword [ebp - 0x20], eax
cmp eax, edi
je 0x40134a
test byte [eax + 4], 2
je 0x40134a
push 0x74
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebx], eax
cmp eax, edi
je 0x40134a
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x1c]
call sub.HID.DLL_HidD_GetPreparsedData
test al, al
je 0x40127d
mov eax, dword [ebx]
add eax, 0x18
push eax
push dword [ebp - 0x18]
call sub.HID.DLL_HidP_GetCaps
cmp eax, edi
jge 0x401275
push eax
push 0x45cc28
call fcn.00407017
pop ecx
pop ecx
push dword [ebp - 0x18]
call sub.HID.DLL_HidD_FreePreparsedData
push esi
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 [ebp - 0x20]
add edi, 0xc
lea esi, [ebp - 0x30]
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 [ebp - 0xc]
mov byte [eax + 0x5c], 4
mov eax, dword [ebx]
mov byte [eax + 0x5d], 4
mov eax, dword [ebx]
xor esi, esi
push esi
push esi
mov byte [eax + 0x5e], 0x55
mov eax, dword [ebx]
push 3
push esi
mov dword [eax + 4], ecx
mov eax, dword [ebp - 0x10]
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, esi
je 0x40132d
cmp ecx, 0xffffffff
je 0x40132d
push esi
push esi
mov dword [eax + 0x64], 0x1388
push dword [ebx]
push 0x401646
push esi
push esi
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov ecx, dword [ebx]
mov dword [ecx + 0x68], eax
mov eax, dword [ebx]
cmp dword [eax + 0x68], esi
je 0x40130d
inc dword [ebp - 0xc]
mov ebx, eax
jmp 0x401348
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_busylight_devices_get___CreateThread__hKeepAliveThread___0x_08x__n
call fcn.00407017
mov eax, dword [ebx]
pop ecx
pop ecx
push dword [eax + 0x60]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x401340
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_busylight_devices_get___CreateFile__hBusy___0x_08x__n
call fcn.00407017
pop ecx
pop ecx
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor edi, edi
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x401368
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_busylight_devices_get___CreateFile__deviceHandle___0x_08x__n
call fcn.00407017
pop ecx
pop ecx
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_LocalFree]
inc dword [ebp - 0x14]
cmp dword [ebp - 0x24], edi
jne 0x40114e
push dword [ebp - 8]
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
pop esi
jmp 0x40139c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_busylight_devices_get___SetupDiGetClassDevs__0x_08x__n
call fcn.00407017
pop ecx
pop ecx
xor eax, eax
cmp eax, dword [ebp - 0xc]
pop edi
sbb eax, eax
neg eax
pop ebx
leave
ret