From 7f1069d62c50412f97047f5082f7caa50e0bc104 Mon Sep 17 00:00:00 2001 From: unknowntrojan <14975032+unknowntrojan@users.noreply.github.com> Date: Fri, 14 Feb 2025 02:46:25 +0100 Subject: finally do away with this madness --- Cargo.toml | 1 - README.md | 10 +++++++--- src/lib.rs | 22 ++++------------------ 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 74cf3f4..c191446 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,6 @@ coolfindpattern = "0.1.6" binary-search = "0.1.2" -# Due to a breaking change in the binaryninja crate, you will also need to uncomment the relevant portion of code in the entrypoint. # Dev # binaryninja = { git = "https://github.com/Vector35/binaryninja-api", branch = "dev" } # Stable diff --git a/README.md b/README.md index 1803029..4c9cee2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -# binja_coolsigmaker +# binja_coolsigmaker (stable channel) -(**I apologize for the inconvenience, but due to a breaking change in the binaryninja crate, you will need to make a change to the entry point depending on which branch you build for.**) +(**The dev branch now contains the version of the plugin for the binja development update channel.**) + +(**master/main will target stable.**) We all know signature scanning can be extremely useful. Sadly, the two public offerings for Binja are either very slow, or crash extremely often. @@ -37,4 +39,6 @@ This project requires the nightly channel of Rust. Check the blog post above for a step-by-step. -Check the Cargo.toml file and adjust the `binaryninja` dependency so it points to whatever Binja update channel you want to compile for. __!MAKE SURE!__ Cargo caught your change of branch. It sometimes doesn't realize you changed it. Delete `Cargo.lock` to make Cargo realize you did. Otherwise, it'll keep using whatever version was selected when you built or rust-analyzer ran. +Checkout the branch of the repository matching the channel of binja you are building for. + +You are now one `cargo b` away from greatness. diff --git a/src/lib.rs b/src/lib.rs index aec6e15..7b6d2f8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,7 +18,7 @@ //! along with this program. If not, see . //! -#![feature(let_chains, core_intrinsics, iter_array_chunks)] +#![feature(let_chains, iter_array_chunks)] use std::borrow::Cow; use std::fmt::Display; @@ -44,14 +44,12 @@ use iced_x86::{ }; use rayon::prelude::ParallelBridge; use rayon::prelude::{IntoParallelRefIterator, ParallelIterator}; -use strum::{ - Display, EnumIter, EnumMessage, EnumString, EnumVariantNames, IntoEnumIterator, VariantNames, -}; +use strum::{Display, EnumIter, EnumMessage, EnumString, IntoEnumIterator, VariantNames}; type OwnedPattern = Vec>; type Pattern<'a> = &'a [Option]; -#[derive(EnumIter, EnumVariantNames, EnumMessage, EnumString, Display)] +#[derive(EnumIter, VariantNames, EnumMessage, EnumString, Display)] enum SignatureType { #[strum(message = "IDA-style signature with one ? wildcard per byte. (E9 ? ? ? ? 90)")] IDAOne, @@ -989,19 +987,7 @@ impl Command for SigFinderCommand { #[no_mangle] pub extern "C" fn CorePluginInit() -> bool { - - // Due to a breaking change in binaryninja-api, you will need to edit this line depending on which version you are building for. - - // For dev branch: - // binaryninja::logger::Logger::new("coolsigmaker") - // .with_level(log::LevelFilter::Info) - // .init(); - - // For stable branch: - // binaryninja::logger::init(log::LevelFilter::Info).unwrap(); - - // And uncomment this. Sorry for the inconvenience. - compile_error!("sadly, due to a breaking change in the api crate, you will need to make a change to the code above this error."); + binaryninja::logger::init(log::LevelFilter::Info).unwrap(); // TODO: (maybe) if signature not found, maybe go back a few instructions and attempt to create a signature with an offset. // TODO: introduce a setting for "dumb" searches, where we also search non-executable segments for uniqueness, incase the user doesn't want to check the segments before scanning them. -- cgit v1.3.1