From e40adbb7f9f24d3a06e6a6d44e21104e0c1cc007 Mon Sep 17 00:00:00 2001 From: David McDonald Date: Mon, 21 Apr 2025 10:21:42 -0500 Subject: [PATCH] Linux Utilities: Yield directly from iterator Instead of constructing a dict and yielding from `.values()` directly, yields values as they are yielded from the underlying call to `get_kset_modules`. --- volatility3/framework/symbols/linux/utilities/modules.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/volatility3/framework/symbols/linux/utilities/modules.py b/volatility3/framework/symbols/linux/utilities/modules.py index d0b3ba013..3dc241a4e 100644 --- a/volatility3/framework/symbols/linux/utilities/modules.py +++ b/volatility3/framework/symbols/linux/utilities/modules.py @@ -53,7 +53,7 @@ class ModuleGathererInterface( framework.require_interface_version(*_required_framework_version) - gatherer_return_type = Generator[Union[ModuleInfo, "extensions.module"], None, None] + gatherer_return_type = Iterator[Union[ModuleInfo, "extensions.module"]] # Must be set to a unique, descriptive name of the gathering technique or data structure source name = None @@ -817,11 +817,7 @@ class ModuleGathererSysFs(ModuleGathererInterface): ) -> ModuleGathererInterface.gatherer_return_type: kernel = context.modules[kernel_module_name] - sysfs_modules: Dict[str, extensions.module] = dict( - Modules.get_kset_modules(context, kernel_module_name) - ) - - for m_offset in sysfs_modules.values(): + for _, m_offset in Modules.get_kset_modules(context, kernel_module_name): yield kernel.object(object_type="module", offset=m_offset, absolute=True)