mirror of
https://github.com/chipsec/chipsec
synced 2026-06-08 13:31:00 +00:00
Check the VID is present in the chipset dictionary
On some platforms (e.g. VirtualBox) where there is no PCI device at `00:00.0`, VID/DID reads for platform detection return `0xFFFF`.
This commit is contained in:
+2
-2
@@ -234,7 +234,7 @@ class Chipset:
|
||||
|
||||
if platform_code is None:
|
||||
#platform code was not passed in try to determine based upon cpu id
|
||||
if did in self.chipset_dictionary[vid] and len(self.chipset_dictionary[vid][did]) > 1 and cpuid in self.detection_dictionary.keys():
|
||||
if vid in self.chipset_dictionary and did in self.chipset_dictionary[vid] and len(self.chipset_dictionary[vid][did]) > 1 and cpuid in self.detection_dictionary.keys():
|
||||
for item in self.chipset_dictionary[vid][did]:
|
||||
if self.detection_dictionary[cpuid] == item['code']:
|
||||
#matched processor with detection value
|
||||
@@ -246,7 +246,7 @@ class Chipset:
|
||||
self.did = did
|
||||
self.rid = rid
|
||||
break
|
||||
elif did in self.chipset_dictionary[vid]:
|
||||
elif vid in self.chipset_dictionary and did in self.chipset_dictionary[vid]:
|
||||
_unknown_platform = False
|
||||
data_dict = self.chipset_dictionary[vid][ did ][0]
|
||||
self.code = data_dict['code'].upper()
|
||||
|
||||
Reference in New Issue
Block a user