From a5df5372f52d26c3971a208f0097eac0678b270c Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Wed, 23 May 2018 22:23:32 +0100 Subject: [PATCH] Add in table_mapping through the ISF classes. --- volatility/framework/interfaces/symbols.py | 5 +++-- volatility/framework/symbols/intermed.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/volatility/framework/interfaces/symbols.py b/volatility/framework/interfaces/symbols.py index b16c6f64a..c4b61cddd 100644 --- a/volatility/framework/interfaces/symbols.py +++ b/volatility/framework/interfaces/symbols.py @@ -222,9 +222,10 @@ class SymbolTableInterface(BaseSymbolTableInterface, configuration.ConfigurableI context: 'interfaces_context.ContextInterface', config_path: str, name: str, - native_types: 'NativeTableInterface' = None) -> None: + native_types: 'NativeTableInterface' = None, + table_mapping: typing.Optional[typing.Dict[str, str]] = None) -> None: configuration.ConfigurableInterface.__init__(self, context, config_path) - BaseSymbolTableInterface.__init__(self, name, native_types) + BaseSymbolTableInterface.__init__(self, name, native_types, table_mapping) def build_configuration(self) -> 'configuration.HierarchicalDict': config = super().build_configuration() diff --git a/volatility/framework/symbols/intermed.py b/volatility/framework/symbols/intermed.py index ded5a90a2..78a726e99 100644 --- a/volatility/framework/symbols/intermed.py +++ b/volatility/framework/symbols/intermed.py @@ -57,6 +57,7 @@ class IntermediateSymbolTable(interfaces.symbols.SymbolTableInterface): config_path: str, name: str, isf_url: str, + table_mapping: typing.Optional[typing.Dict[str, str]] = None, native_types: interfaces.symbols.NativeTableInterface = None, validate: bool = True) -> None: """Instantiates an SymbolTable based on an IntermediateSymbolFormat JSON file. This is validated against the @@ -89,10 +90,12 @@ class IntermediateSymbolTable(interfaces.symbols.SymbolTableInterface): config_path, name, json_object, - native_types) + native_types, + table_mapping) # Inherit - super().__init__(context, config_path, name, native_types or self._delegate.natives) + super().__init__(context, config_path, name, native_types or self._delegate.natives, + table_mapping = table_mapping) def _closest_version(self, version: str, @@ -183,12 +186,13 @@ class ISFormatTable(interfaces.symbols.SymbolTableInterface, metaclass = ABCMeta config_path: str, name: str, json_object: typing.Any, - native_types: interfaces.symbols.NativeTableInterface = None) -> None: + native_types: interfaces.symbols.NativeTableInterface = None, + table_mapping: typing.Optional[typing.Dict[str, str]] = None) -> None: self._json_object = json_object self._validate_json() nt = native_types or self._get_natives() nt.name = name + "_natives" - super().__init__(context, config_path, name, nt) + super().__init__(context, config_path, name, nt, table_mapping = table_mapping) self._overrides = {} # type: typing.Dict[str, typing.Type[interfaces.objects.ObjectInterface]] self._symbol_cache = {} # type: typing.Dict[str, interfaces.symbols.Symbol]