From 6523364c90cee706e5912f5938b92185d7a1f493 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Fri, 22 Sep 2017 09:57:01 +0100 Subject: [PATCH] Add a validate method to all objects to allow for (optional) validation of data on construction. --- volatility/framework/interfaces/objects.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/volatility/framework/interfaces/objects.py b/volatility/framework/interfaces/objects.py index f21ac863d..b6f41b57e 100644 --- a/volatility/framework/interfaces/objects.py +++ b/volatility/framework/interfaces/objects.py @@ -92,6 +92,12 @@ class ObjectInterface(validity.ValidityRoutines, metaclass = ABCMeta): def write(self, value): """Writes the new value into the format at the offset the object currently resides at""" + def validate(self): + """A method that can be overridden to validate this object. It does not return and its return value should not be used. + + Raises InvalidDataException on failure to validate the data correctly. + """ + def cast(self, new_type_name, **additional): """Returns a new object at the offset and from the layer that the current object inhabits