:py:mod:`acquire.acquire.utils` =============================== .. py:module:: acquire.acquire.utils Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: acquire.acquire.utils.StrEnum Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: acquire.acquire.utils.create_argument_parser acquire.acquire.utils.parse_acquire_args acquire.acquire.utils.check_and_set_log_args acquire.acquire.utils.check_and_set_acquire_args acquire.acquire.utils.get_user_name acquire.acquire.utils.is_user_admin acquire.acquire.utils.get_utc_now acquire.acquire.utils.get_utc_now_str acquire.acquire.utils.get_formatted_exception acquire.acquire.utils.format_output_name acquire.acquire.utils.persist_execution_report acquire.acquire.utils.normalize_path Attributes ~~~~~~~~~~ .. autoapisummary:: acquire.acquire.utils.DEVICE_SUBST acquire.acquire.utils.SYSVOL_SUBST acquire.acquire.utils.SYSVOL_UPPER_SUBST acquire.acquire.utils.DRIVE_LOWER_SUBST .. py:class:: StrEnum Bases: :py:obj:`str`, :py:obj:`enum.Enum` Sortable and serializible string-based enum .. py:function:: create_argument_parser(profiles: dict, volatile: dict, modules: dict) -> argparse.ArgumentParser .. py:function:: parse_acquire_args(parser: argparse.ArgumentParser, config: dict[str, Any]) -> tuple[argparse.Namespace, list[str]] Parse and set the acquire command line arguments. The arguments are set to values supplied in ``config[arguments]``, when not changed from the default values specified in ``parser``. The ``config`` dict is added to the parsed command line arguments for convenience of later use. :param parser: A parser for acquire command line arguments. :param config: A dict of global configuration values. :returns: A command line arguments namespace .. py:function:: check_and_set_log_args(args: argparse.Namespace) Check command line arguments which are related to logging. Also some arguments derived from the user supplied ones are set in the ``args`` namespace for convenience. This function is separate from ``check_and_set_acquire_args()`` as logging needs to be setup as soon as possible when running acquire. :param args: The namespace containing the command line arguments. :raises ValueError: When an invalid combination of arguments is found. .. py:function:: check_and_set_acquire_args(args: argparse.Namespace, upload_plugins: acquire.uploaders.plugin_registry.UploaderRegistry) Check the command line arguments and set some derived arguments. This function is separate from ``check_and_set_log_args()`` as logging needs to be setup as soon as possible when running acquire. :param args: The namespace containing the command line arguments. :param upload_plugins: The registry of available upload plugins. :raises ValueError: When an invalid combination of arguments is found. .. py:function:: get_user_name() -> str .. py:function:: is_user_admin() -> bool .. py:function:: get_utc_now() -> datetime.datetime .. py:function:: get_utc_now_str() -> str .. py:function:: get_formatted_exception() -> str .. py:function:: format_output_name(prefix: str, postfix: Optional[str] = None, ext: Optional[str] = None) -> str .. py:function:: persist_execution_report(path: pathlib.Path, report_data: dict) -> pathlib.Path .. py:data:: DEVICE_SUBST .. py:data:: SYSVOL_SUBST .. py:data:: SYSVOL_UPPER_SUBST .. py:data:: DRIVE_LOWER_SUBST .. py:function:: normalize_path(target: dissect.target.Target, path: str | pathlib.Path, resolve_parents: bool = False, preserve_case: bool = True) -> str