in UefiTestingPkg/AuditTests/PagingAudit/Windows/MemoryRangeObjects.py [0:0]
def __init__(self, record_type, *args, **kwargs):
self.RecordType = record_type
self.MemoryType = None
self.SystemMemoryType = None
self.MustBe1 = None
self.UserPrivilege = None
self.ImageName = None
self.NumberOfEntries = 1
self.Found = False
self.Attribute = 0
self.AddressBitwidth = None
self.PageSplit = False
# Check to see whether we're a type that we recognize.
if self.RecordType not in ("TSEG", "MemoryMap", "LoadedImage", "SmmLoadedImage", "PDE", "GDT", "IDT", "PTEntry", "MAT", "GuardPage", "Bitwidth"):
raise RuntimeError("Unknown type '%s' found!" % self.RecordType)
# Continue processing according to the data type.
if self.RecordType in ("LoadedImage", "SmmLoadedImage"):
self.LoadedImageEntryInit(int(args[0], 16), int(args[1], 16), args[2])
elif self.RecordType in ("MemoryMap", "TSEG", "MAT"):
self.MemoryMapEntryInit(*(int(arg, 16) for arg in args))
elif self.RecordType in ("PDE", "GDT", "IDT"):
self.LoadedImageEntryInit(int(args[0], 16), int(args[1], 16), self.RecordType)
elif self.RecordType in ("PTEntry"):
self.PteInit(*args)
elif self.RecordType in ("GuardPage"):
self.GuardPageInit(*args)
elif self.RecordType in ("Bitwidth"):
self.BitwidthInit(int(args[0], 16))
self.CalculateEnd()