From c012842bd62bcacdc20f132f4e5ec88dc77911f2 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Thu, 21 Jun 2018 00:27:38 +0100 Subject: [PATCH] Refactor the name to be more accurate. --- volatility/framework/contexts/__init__.py | 10 +++++----- volatility/framework/interfaces/context.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/volatility/framework/contexts/__init__.py b/volatility/framework/contexts/__init__.py index 0cdd5de9b..4f2ff6053 100644 --- a/volatility/framework/contexts/__init__.py +++ b/volatility/framework/contexts/__init__.py @@ -104,7 +104,7 @@ class Context(interfaces.context.ContextInterface): def get_module_wrapper(method: str) -> typing.Callable: - """Returns a symbol using the symbol_table of the Module""" + """Returns a symbol using the symbol_table_name of the Module""" def wrapper(self, name: str) -> typing.Callable: self._check_type(name, str) @@ -121,7 +121,7 @@ class Module(interfaces.context.Module): type_name: typing.Optional[str] = None, offset: typing.Optional[int] = None, **kwargs) -> interfaces.objects.ObjectInterface: - """Returns an object created using the symbol_table and layer_name of the Module + """Returns an object created using the symbol_table_name and layer_name of the Module @param symbol_name: Name of the symbol (within the module) to construct, type_name and offset must not be specified @type symbol_name: str @@ -135,7 +135,7 @@ class Module(interfaces.context.Module): self._check_type(symbol_name, str) if constants.BANG in symbol_name: raise ValueError("Symbol_name cannot reference another module") - symbol = self._context.symbol_space.get_symbol(self.symbol_table + constants.BANG + symbol_name) + symbol = self._context.symbol_space.get_symbol(self.symbol_table_name + constants.BANG + symbol_name) if symbol.type is None: raise ValueError("Symbol {} has no associated type information".format(symbol.name)) type_arg = symbol.type @@ -145,7 +145,7 @@ class Module(interfaces.context.Module): self._check_type(offset, int) if constants.BANG in type_name: raise ValueError("Type_name cannot reference another module") - type_arg = self.symbol_table + constants.BANG + type_name + type_arg = self.symbol_table_name + constants.BANG + type_name else: raise ValueError("One of symbol_name, or type_name & offset, must be specified to construct a module") # Ensure we don't use a layer_name other than the module's, why would anyone do that? @@ -163,7 +163,7 @@ class Module(interfaces.context.Module): def get_symbols_by_absolute_location(self, offset: int): """Returns the symbols at a specified absolute location """ return self._context.symbol_space.get_symbols_by_location(offset = offset - self._offset, - table_name = self.symbol_table) + table_name = self.symbol_table_name) class ModuleCollection(validity.ValidityRoutines): diff --git a/volatility/framework/interfaces/context.py b/volatility/framework/interfaces/context.py index 512086dfc..26a66b9ea 100644 --- a/volatility/framework/interfaces/context.py +++ b/volatility/framework/interfaces/context.py @@ -92,12 +92,12 @@ class Module(validity.ValidityRoutines, metaclass = ABCMeta): module_name: str, layer_name: str, offset: int, - symbol_table: typing.Optional[str] = None) -> None: + symbol_table_name: typing.Optional[str] = None) -> None: self._context = self._check_type(context, ContextInterface) self._module_name = self._check_type(module_name, str) self._layer_name = self._check_type(layer_name, str) self._offset = self._check_type(offset, int) - self.symbol_table = symbol_table or self._module_name + self.symbol_table_name = symbol_table_name or self._module_name super().__init__() @property @@ -110,7 +110,7 @@ class Module(validity.ValidityRoutines, metaclass = ABCMeta): type_name: str = None, offset: int = None, **kwargs) -> 'interfaces.objects.ObjectInterface': - """Returns an object created using the symbol_table and layer_name of the Module""" + """Returns an object created using the symbol_table_name and layer_name of the Module""" def get_type(self, name: str) -> 'interfaces.objects.Template': """Returns a type from the module"""