Skip to content

Commit 7f1069d

Browse files
committed
finally do away with this madness
1 parent b973b2d commit 7f1069d

3 files changed

Lines changed: 11 additions & 22 deletions

File tree

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ coolfindpattern = "0.1.6"
2323
binary-search = "0.1.2"
2424

2525

26-
# Due to a breaking change in the binaryninja crate, you will also need to uncomment the relevant portion of code in the entrypoint.
2726
# Dev
2827
# binaryninja = { git = "https://github.com/Vector35/binaryninja-api", branch = "dev" }
2928
# Stable

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# binja_coolsigmaker
1+
# binja_coolsigmaker (stable channel)
22

3-
(**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.**)
3+
(**The dev branch now contains the version of the plugin for the binja development update channel.**)
4+
5+
(**master/main will target stable.**)
46

57
We all know signature scanning can be extremely useful. Sadly, the two public offerings for Binja are either very slow, or crash extremely often.
68

@@ -37,4 +39,6 @@ This project requires the nightly channel of Rust.
3739

3840
Check the blog post above for a step-by-step.
3941

40-
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.
42+
Checkout the branch of the repository matching the channel of binja you are building for.
43+
44+
You are now one `cargo b` away from greatness.

src/lib.rs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//! along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
//!
2020
21-
#![feature(let_chains, core_intrinsics, iter_array_chunks)]
21+
#![feature(let_chains, iter_array_chunks)]
2222
use std::borrow::Cow;
2323

2424
use std::fmt::Display;
@@ -44,14 +44,12 @@ use iced_x86::{
4444
};
4545
use rayon::prelude::ParallelBridge;
4646
use rayon::prelude::{IntoParallelRefIterator, ParallelIterator};
47-
use strum::{
48-
Display, EnumIter, EnumMessage, EnumString, EnumVariantNames, IntoEnumIterator, VariantNames,
49-
};
47+
use strum::{Display, EnumIter, EnumMessage, EnumString, IntoEnumIterator, VariantNames};
5048

5149
type OwnedPattern = Vec<Option<u8>>;
5250
type Pattern<'a> = &'a [Option<u8>];
5351

54-
#[derive(EnumIter, EnumVariantNames, EnumMessage, EnumString, Display)]
52+
#[derive(EnumIter, VariantNames, EnumMessage, EnumString, Display)]
5553
enum SignatureType {
5654
#[strum(message = "IDA-style signature with one ? wildcard per byte. (E9 ? ? ? ? 90)")]
5755
IDAOne,
@@ -989,19 +987,7 @@ impl Command for SigFinderCommand {
989987

990988
#[no_mangle]
991989
pub extern "C" fn CorePluginInit() -> bool {
992-
993-
// Due to a breaking change in binaryninja-api, you will need to edit this line depending on which version you are building for.
994-
995-
// For dev branch:
996-
// binaryninja::logger::Logger::new("coolsigmaker")
997-
// .with_level(log::LevelFilter::Info)
998-
// .init();
999-
1000-
// For stable branch:
1001-
// binaryninja::logger::init(log::LevelFilter::Info).unwrap();
1002-
1003-
// And uncomment this. Sorry for the inconvenience.
1004-
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.");
990+
binaryninja::logger::init(log::LevelFilter::Info).unwrap();
1005991

1006992
// TODO: (maybe) if signature not found, maybe go back a few instructions and attempt to create a signature with an offset.
1007993
// 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.

0 commit comments

Comments
 (0)