mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-10 03:37:39 +02:00
Rename ContextModifier.__call__ to ContextModifier.modify_context.
This commit is contained in:
+1
-1
@@ -36,7 +36,7 @@ def utils_load_as():
|
||||
factory = c.LayerFactory("name", "", [c.physical.PhysicalContextModifier,
|
||||
c.intel.IntelContextModifier,
|
||||
c.windows.WindowsContextModifier])
|
||||
return factory()
|
||||
return factory(c.Context())
|
||||
|
||||
|
||||
def test_memory():
|
||||
|
||||
@@ -51,8 +51,8 @@ class LayerFactory(validity.ValidityRoutines, list):
|
||||
Returns a new context with all appropriate modifications (symbols, layers, etc)
|
||||
"""
|
||||
for index in range(len(self)):
|
||||
modifier = self[index](interfaces.configuration.namespace_join([self.name, self[index].__name__ + str(index)]))
|
||||
modifier(context = context)
|
||||
namespace = interfaces.configuration.namespace_join([self.name, self[index].__name__ + str(index)])
|
||||
self[index](namespace).modify_context(context = context)
|
||||
return context
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class IntelContextModifier(interfaces.context.ContextModifierInterface):
|
||||
description = "Layer name for the swap layer",
|
||||
optional = True)]
|
||||
|
||||
def __call__(self, context):
|
||||
def modify_context(self, context):
|
||||
# TODO: Attempt to determine whether the image is 32, PAE or x64 (although the context must already know whether it is x64)
|
||||
config = self.config_get(context)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class PhysicalContextModifier(interfaces.context.ContextModifierInterface):
|
||||
description = 'Layer name for the physical space',
|
||||
default = 'physical')]
|
||||
|
||||
def __call__(self, context):
|
||||
def modify_context(self, context):
|
||||
# Ideally allow for the plugin to specify the layering, but if not then guess at the best one
|
||||
modconfig = self.config_get(context)
|
||||
base = layers.physical.FileLayer(context,
|
||||
|
||||
@@ -15,7 +15,7 @@ class WindowsContextModifier(interfaces.context.ContextModifierInterface):
|
||||
def requirements(cls):
|
||||
return []
|
||||
|
||||
def __call__(self, context):
|
||||
def modify_context(self, context):
|
||||
virtual_types = self._virtual_types
|
||||
ntkrnlmp = vtypes.VTypeSymbolTable('ntkrnlmp', virtual_types, context.symbol_space.natives)
|
||||
ntkrnlmp.set_structure_class('_ETHREAD', windows._ETHREAD)
|
||||
|
||||
@@ -70,5 +70,5 @@ class ContextModifierInterface(validity.ValidityRoutines, metaclass = ABCMeta):
|
||||
return []
|
||||
|
||||
@abstractmethod
|
||||
def __call__(self, context):
|
||||
def modify_context(self, context):
|
||||
"""Modifies the context in place"""
|
||||
|
||||
Reference in New Issue
Block a user