From 57b2de3166d957c2aa8e33c6ef7deb14ede95da4 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Thu, 7 Oct 2021 00:41:26 +0100 Subject: [PATCH] Modules: Ensure created modules have distinct config paths --- volatility3/framework/contexts/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/volatility3/framework/contexts/__init__.py b/volatility3/framework/contexts/__init__.py index 3b15c5d0e..f7532cc5d 100644 --- a/volatility3/framework/contexts/__init__.py +++ b/volatility3/framework/contexts/__init__.py @@ -188,9 +188,10 @@ class Module(interfaces.context.ModuleInterface): **kwargs) -> 'Module': pathjoin = interfaces.configuration.path_join # Check if config_path is None + free_module_name = context.modules.free_module_name(module_name) config_path = kwargs.get('config_path', None) if config_path is None: - config_path = pathjoin('temporary', 'modules') + config_path = pathjoin('temporary', 'modules', free_module_name) # Populate the configuration context.config[pathjoin(config_path, 'layer_name')] = layer_name context.config[pathjoin(config_path, 'offset')] = offset @@ -200,7 +201,7 @@ class Module(interfaces.context.ModuleInterface): for arg in kwargs: context.config[pathjoin(config_path, arg)] = kwargs.get(arg, None) # Construct the object - return_val = cls(context, config_path, context.modules.free_module_name(module_name)) + return_val = cls(context, config_path, free_module_name) context.add_module(return_val) context.config[config_path] = return_val.name # Add the module to the context modules collection