dissect.target.tools.utils
¶
Module Contents¶
Functions¶
Generate an |
|
Generate an |
|
Generate an |
|
Generate an |
|
Execute function on provided target with provided arguments. |
|
Resolves which plugin function to execute, and creates the argument parser for said plugin. |
|
Catches |
|
Converts argument-style |
|
Escape non-ASCII, unicode characters and bytes to a printable form. |
- dissect.target.tools.utils.configure_generic_arguments(parser: argparse.ArgumentParser) None ¶
- dissect.target.tools.utils.process_generic_arguments(args: argparse.Namespace, rest: list[str]) None ¶
- dissect.target.tools.utils.generate_argparse_for_bound_method(method: Callable, usage_tmpl: str | None = None) argparse.ArgumentParser ¶
Generate an
argparse.ArgumentParser
for a boundPlugin
class method.
- dissect.target.tools.utils.generate_argparse_for_unbound_method(method: Callable, usage_tmpl: str | None = None) argparse.ArgumentParser ¶
Generate an
argparse.ArgumentParser
for an unboundPlugin
class method.
- dissect.target.tools.utils.generate_argparse_for_plugin_class(plugin_cls: type[dissect.target.plugin.Plugin], usage_tmpl: str | None = None) argparse.ArgumentParser ¶
Generate an
argparse.ArgumentParser
for aPlugin
class.
- dissect.target.tools.utils.generate_argparse_for_plugin(plugin_instance: dissect.target.plugin.Plugin, usage_tmpl: str | None = None) argparse.ArgumentParser ¶
Generate an
argparse.ArgumentParser
for aPlugin
instance.
- dissect.target.tools.utils.execute_function_on_target(target: dissect.target.Target, func: dissect.target.plugin.FunctionDescriptor, arguments: list[str] | None = None) tuple[str, Any, list[str]] ¶
Execute function on provided target with provided arguments.
- dissect.target.tools.utils.plugin_function_with_argparser(target_attr: dissect.target.plugin.Plugin | Callable) tuple[Callable | None, argparse.ArgumentParser | None] ¶
Resolves which plugin function to execute, and creates the argument parser for said plugin.
- dissect.target.tools.utils.persist_execution_report(output_dir: pathlib.Path, report_data: dict, timestamp: datetime.datetime) pathlib.Path ¶
- dissect.target.tools.utils.catch_sigpipe(func: Callable) Callable ¶
Catches
KeyboardInterrupt
andBrokenPipeError
(OSError 22
on Windows).
- dissect.target.tools.utils.args_to_uri(targets: list[str], loader_name: str, rest: list[str]) list[str] ¶
Converts argument-style
-L
to URI-style.- Turns:
target-query /evtxs/* -L log --log-hint="evtx" -f evtx
- into:
target-query "log:///evtxs/*?hint=evtx" -f evtx
For loaders providing
@arg()
arguments.
- dissect.target.tools.utils.find_and_filter_plugins(functions: str, target: dissect.target.Target, excluded_func_paths: set[str] | None = None) Iterator[dissect.target.plugin.FunctionDescriptor] ¶
- dissect.target.tools.utils.escape_str(value: str) str ¶
Escape non-ASCII, unicode characters and bytes to a printable form.