Problem:
I try to create a script that allows to fix the ID-Vendor, ID-product, endPoitn (in -out) of any USB device.
SCRIPT:
import sys
import usb.core
import usb.util
dev1 = usb.core.find(find_all=True)
for device in dev1:
for se in device:
se = usb.core.find(idVendor = device.idVendor, idProduct=device.idProduct)
if se._manufacturer is None:
se._manufacturer=usb.util.get_string(se, se.iManufacturer)
if se._manufacturer == 'Kingston':
print(se._manufacturer)
for cfg in device:
print(device.idVendor)
print(device.idProduct)
for intf in cfg:
for ep in intf:
lista =list()
lista.append(hex(ep.bEndpointAddress))
print(lista)
Return the following result:
Kingston
2385
5733
['0x81']
['0x2']
[Finished in 0.4s]
However unless you run the program'libusb-win32' in order to install the .info file corresponding to the usb device, it is not possible to recover the device information.
Is there any way to get the information shown in this script without having to install the'.info 'file with libusb-win32?