Skip to content

Commit 6c5b838

Browse files
authored
Merge pull request #1258 from gcmoreira/timeliner_plugin_improvements
Timeliner plugin `plugin-filter` improvements
2 parents e76d512 + a7dcd6d commit 6c5b838

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

volatility3/framework/plugins/timeliner.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class Timeliner(interfaces.plugins.PluginInterface):
4545
orders the results by time."""
4646

4747
_required_framework_version = (2, 0, 0)
48+
_version = (1, 1, 0)
4849

4950
def __init__(self, *args, **kwargs):
5051
super().__init__(*args, **kwargs)
@@ -198,9 +199,10 @@ def _generator(
198199
),
199200
)
200201
)
201-
except Exception:
202+
except Exception as e:
202203
vollog.log(
203-
logging.INFO, f"Exception occurred running plugin: {plugin_name}"
204+
logging.INFO,
205+
f"Exception occurred running plugin: {plugin_name}: {e}",
204206
)
205207
vollog.log(logging.DEBUG, traceback.format_exc())
206208

@@ -245,6 +247,18 @@ def run(self):
245247
filter_list = self.config["plugin-filter"]
246248
# Identify plugins that we can run which output datetimes
247249
for plugin_class in self.usable_plugins:
250+
if not issubclass(plugin_class, TimeLinerInterface):
251+
# get_usable_plugins() should filter this, but adding a safeguard just in case
252+
continue
253+
254+
if filter_list and not any(
255+
[
256+
filter in plugin_class.__module__ + "." + plugin_class.__name__
257+
for filter in filter_list
258+
]
259+
):
260+
continue
261+
248262
try:
249263
automagics = automagic.choose_automagic(self.automagics, plugin_class)
250264

@@ -276,15 +290,8 @@ def run(self):
276290
config_value,
277291
)
278292

279-
if isinstance(plugin, TimeLinerInterface):
280-
if not len(filter_list) or any(
281-
[
282-
filter
283-
in plugin.__module__ + "." + plugin.__class__.__name__
284-
for filter in filter_list
285-
]
286-
):
287-
plugins_to_run.append(plugin)
293+
plugins_to_run.append(plugin)
294+
288295
except exceptions.UnsatisfiedException as excp:
289296
# Remove the failed plugin from the list and continue
290297
vollog.debug(

0 commit comments

Comments
 (0)