mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-07 18:27:39 +02:00
Merge pull request #443 from volatilityfoundation/feature/cache-path-override
Feature/cache path override
This commit is contained in:
@@ -160,6 +160,10 @@ class CommandLine:
|
||||
help = "Clears out all short-term cached items",
|
||||
default = False,
|
||||
action = 'store_true')
|
||||
parser.add_argument("--cache-path",
|
||||
help = "Change the default path ({}) used to store the cache".format(constants.CACHE_PATH),
|
||||
default = constants.CACHE_PATH,
|
||||
type = str)
|
||||
|
||||
# We have to filter out help, otherwise parse_known_args will trigger the help message before having
|
||||
# processed the plugin choice or had the plugin subparser added.
|
||||
@@ -179,6 +183,9 @@ class CommandLine:
|
||||
volatility3.symbols.__path__ = [os.path.abspath(p)
|
||||
for p in partial_args.symbol_dirs.split(";")] + constants.SYMBOL_BASEPATHS
|
||||
|
||||
if partial_args.cache_path:
|
||||
constants.CACHE_PATH = partial_args.cache_path
|
||||
|
||||
if partial_args.log:
|
||||
file_logger = logging.FileHandler(partial_args.log)
|
||||
file_logger.setLevel(1)
|
||||
|
||||
@@ -90,6 +90,10 @@ class VolShell(cli.CommandLine):
|
||||
help = "Clears out all short-term cached items",
|
||||
default = False,
|
||||
action = 'store_true')
|
||||
parser.add_argument("--cache-path",
|
||||
help = "Change the default path ({}) used to store the cache".format(constants.CACHE_PATH),
|
||||
default = constants.CACHE_PATH,
|
||||
type = str)
|
||||
|
||||
# Volshell specific flags
|
||||
os_specific = parser.add_mutually_exclusive_group(required = False)
|
||||
@@ -113,6 +117,9 @@ class VolShell(cli.CommandLine):
|
||||
volatility3.symbols.__path__ = [os.path.abspath(p)
|
||||
for p in partial_args.symbol_dirs.split(";")] + constants.SYMBOL_BASEPATHS
|
||||
|
||||
if partial_args.cache_path:
|
||||
constants.CACHE_PATH = partial_args.cache_path
|
||||
|
||||
vollog.info("Volatility plugins path: {}".format(volatility3.plugins.__path__))
|
||||
vollog.info("Volatility symbols path: {}".format(volatility3.symbols.__path__))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user