diff --git a/volatility3/framework/symbols/linux/utilities/modules.py b/volatility3/framework/symbols/linux/utilities/modules.py index a930bef20..ee48ebc28 100644 --- a/volatility3/framework/symbols/linux/utilities/modules.py +++ b/volatility3/framework/symbols/linux/utilities/modules.py @@ -225,23 +225,6 @@ class Modules(interfaces.configuration.VersionableInterface): return ModuleInfo(module.vol.offset, mod_name, start, end) - @classmethod - def _validate_gatherers(cls, caller_wanted_gatherers) -> List[str]: - """ - Called by `run_modules_scanners` to validate the caller supplied gatherers list - An exception is thrown if an empty gatherers list is given or a list containing an invalid source - """ - if not caller_wanted_gatherers: - raise ValueError( - "`caller_wanted_gatherers` must have at least one gatherer." - ) - - for gatherer in caller_wanted_gatherers: - if gatherer not in ModuleGatherers.all_gatherers_identifier: - raise ValueError( - f"Invalid gatherer sent through `caller_wanted_gatherers`: {gatherer}" - ) - @classmethod def run_modules_scanners( cls, @@ -268,8 +251,20 @@ class Modules(interfaces.configuration.VersionableInterface): Returns: Dictionary mapping each plugin to its corresponding result """ - # Throws ValueError if invalid gatherers sent in - Modules._validate_gatherers(caller_wanted_gatherers) + if not caller_wanted_gatherers: + raise ValueError( + "`caller_wanted_gatherers` must have at least one gatherer." + ) + + if not isinstance(caller_wanted_gatherers, Iterable): + raise ValueError("`caller_wanted_gatherers` must be iterable") + + for gatherer in caller_wanted_gatherers: + if not issubclass(gatherer, ModuleGathererInterface): + raise ValueError( + f"Invalid gatherer sent through `caller_wanted_gatherers`: {gatherer}" + ) + kernel = context.modules[kernel_module_name]