mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-08-22 06:22:23 +02:00
Add a todo to validate factory requirements as well as just plugin requirements.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user