From 07f7a2e2be24e6e82c232228f4899c052fbb741f Mon Sep 17 00:00:00 2001 From: ikelos Date: Sat, 29 Mar 2025 12:48:47 +0000 Subject: [PATCH] Revert "Feature/use less memory" --- volatility3/framework/interfaces/objects.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/volatility3/framework/interfaces/objects.py b/volatility3/framework/interfaces/objects.py index 1bca7a045..62c31481b 100644 --- a/volatility3/framework/interfaces/objects.py +++ b/volatility3/framework/interfaces/objects.py @@ -8,7 +8,7 @@ import collections import collections.abc import contextlib import logging -from typing import Any, List, Mapping, Optional +from typing import Any, Dict, List, Mapping, Optional from volatility3.framework import constants, interfaces @@ -127,11 +127,8 @@ class ObjectInterface(metaclass=abc.ABCMeta): mask = context.layers[object_info.layer_name].address_mask normalized_offset = object_info.offset & mask - vol = kwargs vol_info_dict = {"type_name": type_name, "offset": normalized_offset} - vol.update(object_info) - vol.update(vol_info_dict) - self._vol = collections.ChainMap({}, vol) + self._vol = collections.ChainMap({}, vol_info_dict, object_info, kwargs) self._context = context def __getattr__(self, attr: str) -> Any: @@ -312,9 +309,10 @@ class Template: """Stores the keyword arguments for later object creation.""" # Allow the updating of template arguments whilst still in template form super().__init__() - vol = {"type_name": type_name} - vol.update(arguments) - self._vol = collections.ChainMap({}, vol) + empty_dict: Dict[str, Any] = {} + self._vol = collections.ChainMap( + empty_dict, arguments, {"type_name": type_name} + ) @property def vol(self) -> ReadOnlyMapping: