Merge pull request #443 from volatilityfoundation/feature/cache-path-override

Feature/cache path override
This commit is contained in:
ikelos
2021-02-05 01:06:42 +00:00
committed by GitHub
2 changed files with 14 additions and 0 deletions
+7
View File
@@ -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)
+7
View File
@@ -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__))