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

Add PluginCommand to Rust API #6362

Open
emesare opened this issue Jan 25, 2025 · 0 comments
Open

Add PluginCommand to Rust API #6362

emesare opened this issue Jan 25, 2025 · 0 comments
Labels
Component: Rust API Issue needs changes to the Rust API Effort: Trivial Issue should take < 1 day

Comments

@emesare
Copy link
Member

emesare commented Jan 25, 2025

This would allow us to handle interactions programmatically call plugin commands from rust, a use case can be found here:

#6309 (comment)

I know this is most likely an inappropriate place to ask, but I'm trying to understand how to run a plugin via the Rust API (BinExport) specifically. Are there any examples anywhere on how to do this? I can also ask on Slack if that's a better place?

C++ API class:

binaryninja-api/binaryninjaapi.h

Lines 14146 to 14168 in 8767400

/*!
The PluginCommand class is used for registering "commands" for Plugins, corresponding to code in those plugins
to be executed.
\ingroup plugin
The proper way to use this class is via one of the \c "Register*" static methods.
*/
class PluginCommand
{
BNPluginCommand m_command;
struct RegisteredDefaultCommand
{
std::function<void(BinaryView*)> action;
std::function<bool(BinaryView*)> isValid;
};
struct RegisteredAddressCommand
{
std::function<void(BinaryView*, uint64_t)> action;
std::function<bool(BinaryView*, uint64_t)> isValid;
};

@emesare emesare added Component: Rust API Issue needs changes to the Rust API Effort: Trivial Issue should take < 1 day labels Jan 25, 2025
@emesare emesare changed the title Add PluginCommand to rust API Add PluginCommand to Rust API Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Rust API Issue needs changes to the Rust API Effort: Trivial Issue should take < 1 day
Projects
None yet
Development

No branches or pull requests

1 participant