Rejig plugins and partially parse the command-line options to set a plugin path early.

This commit is contained in:
Mike Auty
2017-06-01 00:54:07 +01:00
parent 4e08d6e414
commit dd7ea07228
2 changed files with 14 additions and 7 deletions
+12 -6
View File
@@ -48,6 +48,18 @@ class CommandLine(object):
volatility.framework.require_interface_version(0, 0, 0)
parser = argparse.ArgumentParser(prog = 'volatility',
description = "An open-source memory forensics framework")
parser.add_argument("-c", "--config", help = "Load the configuration from a json file", default = None,
type = str)
parser.add_argument("-v", "--verbosity", help = "Increase output verbosity", default = 0, action = "count")
parser.add_argument("-p", "--plugins", help = "Semi-colon separated list of paths to find plugins",
default = "", type = str)
partial_args, _ = parser.parse_known_args()
if partial_args.plugins:
volatility.plugins.__path__ = partial_args.plugins.split(";") + constants.PLUGINS_PATH
# Do the initialization
ctx = contexts.Context() # Construct a blank context
volatility.framework.import_files(volatility.plugins) # Will not log as console's default level is WARNING
@@ -60,12 +72,6 @@ class CommandLine(object):
plugin_name = plugin_name[len("volatility.plugins."):]
plugin_list[plugin_name] = plugin
parser = argparse.ArgumentParser(prog = 'volatility',
description = "An open-source memory forensics framework")
parser.add_argument("-c", "--config", help = "Load the configuration from a json file", default = None,
type = str)
parser.add_argument("-v", "--verbosity", help = "Increase output verbosity", default = 0, action = "count")
seen_automagics = set()
configurables_list = {}
for amagic in automagics:
+2 -1
View File
@@ -5,4 +5,5 @@
"""
from volatility.framework import constants
__path__ = constants.PLUGINS_PATH
if not __path__:
__path__ = constants.PLUGINS_PATH