Skip to content

How to implement custom Architecture as a Rust plugin #3203

Discussion options

You must be logged in to vote

Hi there! I was just testing things out and figured it out!

Your custom Architecture needs to implement binaryninja::architecture::Architecture, of course, but you need to set type Handle = CustomArchitectureHandle<YourArch>, and do a few other things as well.

Here's a template of the code required to create and register an Architecture:

use binaryninja::{
    architecture::{
        register_architecture, Architecture, CoreArchitecture, CustomArchitectureHandle,
    },
    logger,
};

pub struct MyArch(CustomArchitectureHandle<Self>, CoreArchitecture);

impl MyArch {
    pub fn new(handle: CustomArchitectureHandle<Self>, core_arch: CoreArchitecture) -> Self {
        Self(handle, core_arch)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ElykDeer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants