From a63e9f1699e4042d1372c0873b05f207e2a8a8d4 Mon Sep 17 00:00:00 2001 From: Gustavo Moreira Date: Wed, 2 Oct 2024 13:00:45 +1000 Subject: [PATCH] Add --remote-isf-url argument to be able mutually exclusive to --offline --- volatility3/cli/__init__.py | 11 ++++++++++- volatility3/cli/volshell/__init__.py | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/volatility3/cli/__init__.py b/volatility3/cli/__init__.py index 1209d7cdc..674fb4b4b 100644 --- a/volatility3/cli/__init__.py +++ b/volatility3/cli/__init__.py @@ -235,12 +235,19 @@ class CommandLine: default=constants.CACHE_PATH, type=str, ) - parser.add_argument( + isf_group = parser.add_mutually_exclusive_group() + isf_group.add_argument( "--offline", help="Do not search online for additional JSON files", default=False, action="store_true", ) + isf_group.add_argument( + "--remote-isf-url", + help="Search online for ISF json files", + default=constants.REMOTE_ISF_URL, + type=str, + ) parser.add_argument( "--filters", help="List of filters to apply to the output (in the form of [+-]columname,pattern[!])", @@ -313,6 +320,8 @@ class CommandLine: if partial_args.offline: constants.OFFLINE = partial_args.offline + elif partial_args.remote_isf_url: + constants.REMOTE_ISF_URL = partial_args.remote_isf_url # Do the initialization ctx = contexts.Context() # Construct a blank context diff --git a/volatility3/cli/volshell/__init__.py b/volatility3/cli/volshell/__init__.py index 2bf1958e2..fc2f87bc2 100644 --- a/volatility3/cli/volshell/__init__.py +++ b/volatility3/cli/volshell/__init__.py @@ -159,12 +159,19 @@ class VolShell(cli.CommandLine): default=constants.CACHE_PATH, type=str, ) - parser.add_argument( + isf_group = parser.add_mutually_exclusive_group() + isf_group.add_argument( "--offline", help="Do not search online for additional JSON files", default=False, action="store_true", ) + isf_group.add_argument( + "--remote-isf-url", + help="Search online for ISF json files", + default=constants.REMOTE_ISF_URL, + type=str, + ) # Volshell specific flags os_specific = parser.add_mutually_exclusive_group(required=False) @@ -236,6 +243,8 @@ class VolShell(cli.CommandLine): if partial_args.offline: constants.OFFLINE = partial_args.offline + elif partial_args.remote_isf_url: + constants.REMOTE_ISF_URL = partial_args.remote_isf_url # Do the initialization ctx = contexts.Context() # Construct a blank context