diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2023-12-22 13:46:10 -0700 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2024-01-04 11:02:14 -0700 |
| commit | 80b07dfa158bb093cc93e602363655b62ae595f8 (patch) | |
| tree | 4e92af37909c07e64f41cbf73b2ea8e68e875ef0 /rust/src/architecture.rs | |
| parent | 7c98724a614550e37e5a33805e13179c87363b91 (diff) | |
Support function recognizers in Rust architecture plugins
Diffstat (limited to 'rust/src/architecture.rs')
| -rw-r--r-- | rust/src/architecture.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rust/src/architecture.rs b/rust/src/architecture.rs index 2c9843d9..edc16209 100644 --- a/rust/src/architecture.rs +++ b/rust/src/architecture.rs @@ -175,6 +175,7 @@ impl InstructionInfo { } } +use crate::functionrecognizer::FunctionRecognizer; use crate::relocation::{CustomRelocationHandlerHandle, RelocationHandler}; pub use binaryninjacore_sys::BNFlagRole as FlagRole; pub use binaryninjacore_sys::BNImplicitRegisterExtend as ImplicitRegisterExtend; @@ -1646,6 +1647,13 @@ pub trait ArchitectureExt: Architecture { { crate::relocation::register_relocation_handler(self.as_ref(), name, func); } + + fn register_function_recognizer<R>(&self, recognizer: R) + where + R: 'static + FunctionRecognizer + Send + Sync + Sized, + { + crate::functionrecognizer::register_arch_function_recognizer(self.as_ref(), recognizer); + } } impl<T: Architecture> ArchitectureExt for T {} |
