Rename ContextModifier.__call__ to ContextModifier.modify_context.

This commit is contained in:
Mike Auty
2015-10-11 18:19:45 +01:00
parent 8ddf5c5b45
commit 9e801c428b
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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():
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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"""