Skip to content

Add PluginCommand to Rust API #6362

Open
@emesare

Description

@emesare

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;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: Rust APIIssue needs changes to the Rust APIEffort: TrivialIssue should take < 1 dayImpact: LowIssue is a papercut or has a good, supported workaround

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions