diff --git a/dissect/target/loaders/targetd.py b/dissect/target/loaders/targetd.py index fede3b79b..5c2dc7d53 100644 --- a/dissect/target/loaders/targetd.py +++ b/dissect/target/loaders/targetd.py @@ -186,13 +186,23 @@ def command_runner(link: str, targetd: Client, *args, **kwargs) -> None: if namespace := kwargs.get("namespace", None): obj = getattr(obj, namespace) + caller.has_output = True if targetd.command == "init": - caller.has_output = True + caller.output = True + return + + if targetd.command == "select": + targetd.rpcs.select(*args) + caller.output = True + return + + if targetd.command == "deselect": + targetd.rpcs.deselect() caller.output = True return func = getattr(obj, targetd.command) - caller.has_output = True + result = func(*args, **kwargs) if result is not None: if targetd.command == "get": diff --git a/dissect/target/plugin.py b/dissect/target/plugin.py index 5c7e6b2b7..bf431e98f 100644 --- a/dissect/target/plugin.py +++ b/dissect/target/plugin.py @@ -1038,6 +1038,7 @@ def add_to_result(func: PluginFunction) -> None: invalid_funcs = set() show_hidden = kwargs.get("show_hidden", False) + ignore_load_errors = kwargs.get("ignore_load_errors", False) for pattern in patterns.split(","): # backward compatibility fix for namespace-level plugins (i.e. chrome) @@ -1071,7 +1072,12 @@ def add_to_result(func: PluginFunction) -> None: func = functions[index_name] method_name = index_name.split(".")[-1] - loaded_plugin_object = load(func) + try: + loaded_plugin_object = load(func) + except Exception: + if ignore_load_errors: + continue + raise # Skip plugins that don't want to be found by wildcards if not show_hidden and not loaded_plugin_object.__findable__: @@ -1120,7 +1126,13 @@ def add_to_result(func: PluginFunction) -> None: invalid_funcs.add(pattern) for description in plugin_descriptions: - loaded_plugin_object = load(description) + try: + loaded_plugin_object = load(description) + except Exception: + if ignore_load_errors: + continue + raise + fobject = inspect.getattr_static(loaded_plugin_object, funcname) if compatibility and not loaded_plugin_object(target).is_compatible():