mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-11 12:17:38 +02:00
Merge pull request #1318 from Abyss-W4tcher/use_volshell_additional_locals
Allow to import external locals in volshell environment
This commit is contained in:
@@ -58,7 +58,7 @@ class Volshell(interfaces.plugins.PluginInterface):
|
||||
]
|
||||
|
||||
def run(
|
||||
self, additional_locals: Dict[str, Any] = None
|
||||
self, additional_locals: Dict[str, Any] = {}
|
||||
) -> interfaces.renderers.TreeGrid:
|
||||
"""Runs the interactive volshell plugin.
|
||||
|
||||
@@ -94,7 +94,10 @@ class Volshell(interfaces.plugins.PluginInterface):
|
||||
"""
|
||||
|
||||
sys.ps1 = f"({self.current_layer}) >>> "
|
||||
self.__console = code.InteractiveConsole(locals=self._construct_locals_dict())
|
||||
# Dict self._construct_locals_dict() will have priority on keys
|
||||
combined_locals = additional_locals.copy()
|
||||
combined_locals.update(self._construct_locals_dict())
|
||||
self.__console = code.InteractiveConsole(locals=combined_locals)
|
||||
# Since we have to do work to add the option only once for all different modes of volshell, we can't
|
||||
# rely on the default having been set
|
||||
if self.config.get("script", None) is not None:
|
||||
|
||||
Reference in New Issue
Block a user