diff --git a/volatility/framework/interfaces/objects.py b/volatility/framework/interfaces/objects.py index d3b27e091..6070b9110 100644 --- a/volatility/framework/interfaces/objects.py +++ b/volatility/framework/interfaces/objects.py @@ -273,9 +273,8 @@ class Template: """Stores the keyword arguments for later object creation.""" # Allow the updating of template arguments whilst still in template form super().__init__() - self._arguments = arguments empty_dict = {} # type: Dict[str, Any] - self._vol = collections.ChainMap(empty_dict, self._arguments, {'type_name': type_name}) + self._vol = collections.ChainMap(empty_dict, arguments, {'type_name': type_name}) @property def vol(self) -> ReadOnlyMapping: diff --git a/volatility/framework/objects/templates.py b/volatility/framework/objects/templates.py index acdc459ac..c19bc07e7 100644 --- a/volatility/framework/objects/templates.py +++ b/volatility/framework/objects/templates.py @@ -23,8 +23,8 @@ class ObjectTemplate(interfaces.objects.Template): """ def __init__(self, object_class: Type[interfaces.objects.ObjectInterface], type_name: str, **arguments) -> None: + arguments['object_class'] = object_class super().__init__(type_name = type_name, **arguments) - self._arguments['object_class'] = object_class proxy_cls = self.vol.object_class.VolTemplateProxy for method_name in proxy_cls._methods: @@ -43,7 +43,7 @@ class ObjectTemplate(interfaces.objects.Template): return self.vol.object_class.VolTemplateProxy.children(self) def relative_child_offset(self, child: str) -> int: - """Returns the relative offset of a child of the templated object (see + """Returns the relative offset of a child of the templated object (see :class:`~volatility.framework.interfaces.objects.ObjectInterface.VolTem plateProxy`)""" return self.vol.object_class.VolTemplateProxy.relative_child_offset(self, child)