mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-08-31 04:09:40 +02:00
Windows: Protect the SERICE_RECORD is_valid function a little more
The request to .Order could fail depending on where the structure lies in memory.
This commit is contained in:
@@ -14,13 +14,16 @@ class SERVICE_RECORD(objects.StructType):
|
||||
|
||||
def is_valid(self) -> bool:
|
||||
"""Determine if the structure is valid."""
|
||||
if self.Order < 0 or self.Order > 0xFFFF:
|
||||
return False
|
||||
|
||||
try:
|
||||
_ = self.State.description
|
||||
_ = self.Start.description
|
||||
except ValueError:
|
||||
if self.Order < 0 or self.Order > 0xFFFF:
|
||||
return False
|
||||
|
||||
try:
|
||||
_ = self.State.description
|
||||
_ = self.Start.description
|
||||
except ValueError:
|
||||
return False
|
||||
except exceptions.InvalidAddressException:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user