Function binaryninja::command::register_for_address
source · pub fn register_for_address<S, C>(name: S, desc: S, command: C)where
S: BnStrCompatible,
C: AddressCommand,
Expand description
The function call required for generic commands; commands added in this way will be in the Plugins
submenu of the menu bar.
§Example
struct MyCommand;
impl AddressCommand for MyCommand {
fn action(&self, view: &BinaryView, addr: u64) {
// Your code here
}
fn valid(&self, view: &BinaryView, addr: u64) -> bool {
// Your code here
true
}
}
#[no_mangle]
pub extern "C" fn CorePluginInit() -> bool {
register_for_address(
"My Plugin Command",
"A description of my command",
MyCommand {},
);
true
}