Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to import external locals in volshell environment #1318

Conversation

Abyss-W4tcher
Copy link
Contributor

@Abyss-W4tcher Abyss-W4tcher commented Oct 23, 2024

Hi,

this PR adds the possibility to import external locals in a volshell environment. It was needed to import Volshell in the current context, when developing and debugging a plugin.

By the way, this is a cool feature that allows to setup an environment and then analyze created objects efficiently (without pasting and declaring functions directly in volshell). To use it, add the following to your plugin (temporarily of course) :

# Imports
from volatility3.cli.volshell import generic 

# Plugin requirements 
            requirements.PluginRequirement(
                name="volshell", plugin=generic.Volshell, version=(0, 0, 0)
            ),

# Wherever needed
self.context.config[self.config_path + "." + "primary"] = kernel.layer_name
generic.Volshell(self.context, self.config_path).run(additional_locals=locals()) # or even {**locals(), **globals()} if needed
# Then, an interactive session will start :)

@ikelos
Copy link
Member

ikelos commented Oct 23, 2024

Happy to merge this in, but please also consider the snippets facility of volshell which should allow similar (although not identical) results...

@ikelos ikelos merged commit 62aa9c1 into volatilityfoundation:develop Oct 23, 2024
12 checks passed
@Abyss-W4tcher Abyss-W4tcher deleted the use_volshell_additional_locals branch October 25, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants