diff options
| author | Mason Reed <mason@vector35.com> | 2024-10-28 21:20:03 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2024-10-28 21:21:55 -0400 |
| commit | a38d13f32326b72e59503a8280f610c52e018366 (patch) | |
| tree | 44ea154e651489cc3d3e5a5fb5d17f894ace784d /plugins/warp/src/plugin/create.rs | |
| parent | 08f1c49f0cb7f74d0f50dcf60289e974ae9d5c3a (diff) | |
Refactor WARP to use a module workflow for matching
Also flush caches on view destruction and improve performance
Diffstat (limited to 'plugins/warp/src/plugin/create.rs')
| -rw-r--r-- | plugins/warp/src/plugin/create.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/warp/src/plugin/create.rs b/plugins/warp/src/plugin/create.rs index b404ae1c..966c69ca 100644 --- a/plugins/warp/src/plugin/create.rs +++ b/plugins/warp/src/plugin/create.rs @@ -1,5 +1,6 @@ use crate::cache::cached_function; use crate::convert::from_bn_type; +use crate::matcher::invalidate_function_matcher_cache; use binaryninja::binaryview::{BinaryView, BinaryViewExt}; use binaryninja::command::Command; use rayon::prelude::*; @@ -15,7 +16,6 @@ pub struct CreateSignatureFile; impl Command for CreateSignatureFile { fn action(&self, view: &BinaryView) { let mut signature_dir = binaryninja::user_directory().unwrap().join("signatures/"); - // TODO: This needs to split out each platform into its own bucket... if let Some(default_plat) = view.default_platform() { // If there is a default platform, put the signature in there. signature_dir.push(default_plat.name().to_string()); @@ -53,7 +53,11 @@ impl Command for CreateSignatureFile { // TODO: Should we overwrite? Prompt user. if let Ok(mut file) = std::fs::File::create(&save_file) { match file.write_all(&data.to_bytes()) { - Ok(_) => log::info!("Signature file saved successfully."), + Ok(_) => { + log::info!("Signature file saved successfully."); + // Force rebuild platform matcher. + invalidate_function_matcher_cache(); + } Err(e) => log::error!("Failed to write data to signature file: {:?}", e), } } else { |
