summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknowntrojan <14975032+unknowntrojan@users.noreply.github.com>2023-09-19 08:28:03 +0200
committerunknowntrojan <14975032+unknowntrojan@users.noreply.github.com>2023-09-19 08:28:03 +0200
commite605cc25877c3b38b4a314b897b0d98dd7c1b5d6 (patch)
tree13454eb244ad19e455cbf7f9788c87f2624c59c0
parent4a1f71a5fe140ddc389a553ab24637d2472116ac (diff)
fix crash related to segment edge case
-rw-r--r--Cargo.toml18
-rw-r--r--src/lib.rs4
2 files changed, 11 insertions, 11 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 4172421..4a0d791 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
-name = "binja_coolsigmaker"
-version = "0.1.2"
+name = "binja_coolsigmaker"
+version = "0.1.3"
authors = ["unknowntrojan"]
edition = "2021"
@@ -8,7 +8,7 @@ edition = "2021"
crate-type = ["cdylib"]
[dependencies]
-log = "0.4.17"
+log = "0.4.17"
clipboard = "0.5.0"
# Local
# binaryninja = { path = "../binaryninja-api/rust" }
@@ -16,10 +16,10 @@ clipboard = "0.5.0"
binaryninja = { git = "https://github.com/Vector35/binaryninja-api.git", branch = "dev" }
# Stable
# binaryninja = { git = "https://github.com/Vector35/binaryninja-api.git", tag = "v3.4.4271-stable" }
-rayon = "1.7.0"
-iced-x86 = "1.17.0"
-strum = { version = "0.25.0", features = ["derive"] }
-serde = { version = "1.0.152", features = ["std"] }
-serde_json = "1.0.93"
-thiserror = "1.0.43"
+rayon = "1.7.0"
+iced-x86 = "1.17.0"
+strum = { version = "0.25.0", features = ["derive"] }
+serde = { version = "1.0.152", features = ["std"] }
+serde_json = "1.0.93"
+thiserror = "1.0.43"
coolfindpattern = "0.1.3"
diff --git a/src/lib.rs b/src/lib.rs
index 8fbfcbe..5e3252d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -519,7 +519,7 @@ fn create_pattern_internal(
Err(SignatureError::OutOfBounds)?
}
- current_buffer.copy_from_slice(
+ current_buffer[..instr_len as _].copy_from_slice(
&data
.iter()
.find(|segment| segment.0 == start_segment.address_range().start).ok_or(SignatureError::InvalidSegment)?
@@ -823,7 +823,7 @@ pub extern "C" fn CorePluginInit() -> bool {
);
// #[cfg(debug_assertions)]
- let _ = std::fs::write("C:\\log.txt", &string);
+ let _ = std::fs::write("E:\\log.txt", &string);
log::info!("{}", &string);
}));