From 963b448d367f117dff66c65107b590dac96b5f0e Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Fri, 5 Mar 2021 01:13:34 +0000 Subject: [PATCH] Objects: Revert setting attributes to write data --- volatility3/framework/objects/__init__.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/volatility3/framework/objects/__init__.py b/volatility3/framework/objects/__init__.py index 6eb8e12fb..05679af7f 100644 --- a/volatility3/framework/objects/__init__.py +++ b/volatility3/framework/objects/__init__.py @@ -752,12 +752,16 @@ class AggregateType(interfaces.objects.ObjectInterface): agg_name = agg_type.__name__ raise AttributeError("{} has no attribute: {}.{}".format(agg_name, self.vol.type_name, attr)) - def __setattr__(self, name, value): - """Method for writing specific members of a structure""" - if name in ['_concrete_members', 'vol', '_vol'] or not self.has_member(name): - return super().__setattr__(name, value) - attr = self.__getattr__(name) - return attr.write(value) + # Disable messing around with setattr until the consequences have been considered properly + # For example pdbutil constructs objects and then sets values for them + # Some don't always match the type (for example, the data read is encoded and interpretted) + # + # def __setattr__(self, name, value): + # """Method for writing specific members of a structure""" + # if name in ['_concrete_members', 'vol', '_vol'] or not self.has_member(name): + # return super().__setattr__(name, value) + # attr = self.__getattr__(name) + # return attr.write(value) def __dir__(self) -> Iterable[str]: """Returns a complete list of members when dir is called."""