From 8ddf5c5b45dc2e8b3ade4c67cb098fd20ddba35f Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Sun, 11 Oct 2015 18:12:15 +0100 Subject: [PATCH] Remove the plugin __call__ method for properly named run method. Calls methods are handy, but ugly if you create and then call the object immediately ( for example, thing()() ). --- volatility/cli/__init__.py | 6 ++---- volatility/framework/interfaces/plugins.py | 2 +- volatility/plugins/windows/pslist.py | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/volatility/cli/__init__.py b/volatility/cli/__init__.py index 4ac1ba0c8..1e7cf208e 100644 --- a/volatility/cli/__init__.py +++ b/volatility/cli/__init__.py @@ -41,10 +41,8 @@ class CommandLine(object): factory = req_mapping[req] req.value = factory(context) - # Construct the plugin - runner = plugin(context) - # Run the plugin - runner() + # Construct and run the plugin + plugin(context).run() @staticmethod def construct_translation_layer_factory(name, requirement): diff --git a/volatility/framework/interfaces/plugins.py b/volatility/framework/interfaces/plugins.py index 6c8aea8ea..9bdb44f3b 100644 --- a/volatility/framework/interfaces/plugins.py +++ b/volatility/framework/interfaces/plugins.py @@ -52,7 +52,7 @@ class PluginInterface(validity.ValidityRoutines, metaclass = ABCMeta): option.validate_input(self.config.get_value(option.name), self.context) @abstractmethod - def __call__(self): + def run(self): """Executes the functionality of the code @:param diff --git a/volatility/plugins/windows/pslist.py b/volatility/plugins/windows/pslist.py index 6ce1348e6..d8a6206db 100644 --- a/volatility/plugins/windows/pslist.py +++ b/volatility/plugins/windows/pslist.py @@ -31,7 +31,7 @@ class PsList(plugins.PluginInterface): # Get the process from the thread object in kernel space return ethread.owning_process() - def __call__(self): + def run(self): self.validate_inputs() eproc = self.kernel_process_from_physical_process(self.context, 'physical', 'intel', self.config.get_value('offset')) for proc in eproc.ActiveProcessLinks: