From 22904d7577d95b850383edb23485b8aea27536ae Mon Sep 17 00:00:00 2001 From: Matthijs Vos Date: Thu, 19 Mar 2026 15:23:50 +0100 Subject: [PATCH 1/2] Add --wait-exit option --- acquire/acquire.py | 18 ++++++++++++++---- acquire/utils.py | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/acquire/acquire.py b/acquire/acquire.py index 3f0392b7..c80967d7 100644 --- a/acquire/acquire.py +++ b/acquire/acquire.py @@ -2334,19 +2334,29 @@ class VolatileProfile: } -def exit_success(default_args: list[str]) -> NoReturn: +def exit_success(args: argparse.Namespace) -> NoReturn: + default_args = args.config.get("arguments") log.info("Acquire finished successful") log.info("Arguments: %s", " ".join(sys.argv[1:])) log.info("Default Arguments: %s", " ".join(default_args)) log.info("Exiting with status code 0 (SUCCESS)") + + if args.wait_exit: + input("Press any key to exit...") + sys.exit(0) -def exit_failure(default_args: list[str]) -> NoReturn: +def exit_failure(args: argparse.Namespace) -> NoReturn: + default_args = args.config.get("arguments") log.error("Acquire FAILED") log.error("Arguments: %s", " ".join(sys.argv[1:])) log.error("Default Arguments: %s", " ".join(default_args)) log.error("Exiting with status code 1 (FAILURE)") + + if args.wait_exit: + input("Press any key to exit...") + sys.exit(1) @@ -2494,9 +2504,9 @@ def main() -> None: log.exception("") if acquire_successful: - exit_success(args.config.get("arguments")) + exit_success(args) else: - exit_failure(args.config.get("arguments")) + exit_failure(args) def load_child(target: Target, child_path: Path) -> None: diff --git a/acquire/utils.py b/acquire/utils.py index 26c3a01e..00b4af22 100644 --- a/acquire/utils.py +++ b/acquire/utils.py @@ -185,6 +185,8 @@ def create_argument_parser(profiles: dict, volatile: dict, modules: dict) -> arg parser.add_argument("-K", "--keychain-file", type=Path, help="keychain file in CSV format") parser.add_argument("-Kv", "--keychain-value", help="passphrase, recovery key or key file path value") + parser.add_argument("--wait-exit", help="wait on exit, needs to press enter before closing", action="store_true") + for module_cls in modules.values(): for args, kwargs in module_cls.__cli_args__: parser.add_argument(*args, **kwargs) From 77c970508fdebad47cae2d4e49712a90404a93ee Mon Sep 17 00:00:00 2001 From: Matthijs Vos Date: Thu, 19 Mar 2026 15:26:33 +0100 Subject: [PATCH 2/2] Fix help text --- acquire/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acquire/utils.py b/acquire/utils.py index 00b4af22..8e833333 100644 --- a/acquire/utils.py +++ b/acquire/utils.py @@ -185,7 +185,7 @@ def create_argument_parser(profiles: dict, volatile: dict, modules: dict) -> arg parser.add_argument("-K", "--keychain-file", type=Path, help="keychain file in CSV format") parser.add_argument("-Kv", "--keychain-value", help="passphrase, recovery key or key file path value") - parser.add_argument("--wait-exit", help="wait on exit, needs to press enter before closing", action="store_true") + parser.add_argument("--wait-exit", help="wait on exit, needs to press a key before closing", action="store_true") for module_cls in modules.values(): for args, kwargs in module_cls.__cli_args__: