Add in plugin function capability (and make plugin validation centralized on plugin construction).

This commit is contained in:
Mike Auty
2017-01-04 22:58:54 +00:00
parent b4c36bcd15
commit 3a2cc24e2a
3 changed files with 35 additions and 6 deletions
+13
View File
@@ -0,0 +1,13 @@
from volatility.framework import interfaces
def plugin_function(plugin, context, config_path, **kwargs):
"""Run the plugin as a function"""
if not isinstance(plugin, interfaces.plugins.PluginInterface):
raise TypeError("Plugin must be a PluginInterface derived object")
if not isinstance(context, interfaces.context.ContextInterface):
raise TypeError("Context must be a ContextInterface derived object")
if not isinstance(config_path, str):
raise TypeError("Config_path must a be string")
constructed = plugin(context, config_path)
return constructed(**kwargs)