Add a todo to validate factory requirements as well as just plugin requirements.

This commit is contained in:
Mike Auty
2015-04-13 14:18:33 -05:00
parent f4d07c01b7
commit ddef7e76b3
3 changed files with 11 additions and 6 deletions
+6 -3
View File
@@ -28,7 +28,10 @@ class CommandLine(object):
plugin = volatility.plugins.windows.pslist.PsList
context = self.handle_plugin_requirements(plugin)
plugin(context)
# Construct the plugin
runner = plugin(context)
# Run the plugin
runner()
def construct_layer_factory(self, name):
"""Turns a configuration from a plugin into a """
@@ -51,9 +54,9 @@ class CommandLine(object):
facreqs = factory.requirements()
for facreq in facreqs:
context.config.add_item(facreq, namespace = namespace)
#TODO: Do something clever with the facreqs
#TODO: Validate factory requirements
context = factory(context)
context.config.get(config.namespace_join([plugin.__name__, req.name])).value = 'primary'
context.config.get(config.namespace_join([plugin.__name__, req.name])).value = 'intel'
return context
+4 -2
View File
@@ -37,7 +37,7 @@ class PluginInterface(validity.ValidityRoutines, metaclass = ABCMeta):
@abstractmethod
def requirements(cls):
"""Returns a list of requirements options"""
return
return []
@property
def config(self, core = False):
@@ -47,7 +47,9 @@ class PluginInterface(validity.ValidityRoutines, metaclass = ABCMeta):
def validate_inputs(self):
for option in self.requirements():
option.validate_input(self.config.get_value(option.name), self.context)
if not option.optional:
print("Validate", option.name)
option.validate_input(self.config.get_value(option.name), self.context)
@abstractmethod
def __call__(self):
+1 -1
View File
@@ -33,6 +33,6 @@ class PsList(plugins.PluginInterface):
def __call__(self):
self.validate_inputs()
eproc = self.kernel_process_from_physical_process(self.context, 'physical', 'primary', self.config.get_value('offset'))
eproc = self.kernel_process_from_physical_process(self.context, 'physical', 'intel', self.config.get_value('offset'))
for proc in eproc.ActiveProcessLinks:
print(proc.UniqueProcessId)