device_probe.py: Fix missing pci check

This commit is contained in:
Mykola Grymalyuk
2023-03-13 11:44:05 -06:00
parent d5ffa9a8cf
commit afd1b5d2a7

View File

@@ -52,10 +52,11 @@ class PCIDevice:
if type(ioname) is bytes:
ioname = ioname.strip(b"\0").decode()
vendor_id_unspoofed, device_id_unspoofed = (int(i, 16) for i in ioname[3:].split(","))
if anti_spoof:
vendor_id = vendor_id_unspoofed
device_id = device_id_unspoofed
if ioname.startswith("pci"):
vendor_id_unspoofed, device_id_unspoofed = (int(i, 16) for i in ioname[3:].split(","))
if anti_spoof:
vendor_id = vendor_id_unspoofed
device_id = device_id_unspoofed
if vendor_id is None and device_id is None:
vendor_id, device_id = [int.from_bytes(properties[i][:4], byteorder="little") for i in ["vendor-id", "device-id"]]