diff options
| author | Mason Reed <mason@vector35.com> | 2024-12-13 15:17:54 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2024-12-13 15:18:13 -0500 |
| commit | 9c2667464b4e20cfea11cb8d3447f92f51db7440 (patch) | |
| tree | 361ed45cc3b074e1188739bc61ef3634a1bbf109 /plugins/warp/src/lib.rs | |
| parent | 323315207580f3996702b04ec87a43ce8fde6c55 (diff) | |
WARP: User friendly file picker
Instead of using the interaction api or text input just use a rust crate to manage the file picker dialog
Diffstat (limited to 'plugins/warp/src/lib.rs')
| -rw-r--r-- | plugins/warp/src/lib.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/plugins/warp/src/lib.rs b/plugins/warp/src/lib.rs index 1b4f70a0..dee5d26b 100644 --- a/plugins/warp/src/lib.rs +++ b/plugins/warp/src/lib.rs @@ -1,8 +1,9 @@ +use std::path::PathBuf; use binaryninja::architecture::{ Architecture, ImplicitRegisterExtend, Register as BNRegister, RegisterInfo, }; use binaryninja::basicblock::BasicBlock as BNBasicBlock; -use binaryninja::binaryview::BinaryViewExt; +use binaryninja::binaryview::{BinaryView, BinaryViewExt}; use binaryninja::function::{Function as BNFunction, NativeBlock}; use binaryninja::llil; use binaryninja::llil::{ @@ -25,6 +26,24 @@ mod matcher; /// Only used when compiled for cdylib target. mod plugin; +pub fn core_signature_dir() -> PathBuf { + // Get core signatures for the given platform + let install_dir = binaryninja::install_directory().unwrap(); + // macOS core dir is separate from the install dir. + #[cfg(target_os = "macos")] + let core_dir = install_dir + .parent() + .unwrap() + .join("Resources"); + #[cfg(not(target_os = "macos"))] + let core_dir = install_dir; + core_dir.join("signatures") +} + +pub fn user_signature_dir() -> PathBuf { + binaryninja::user_directory().unwrap().join("signatures/") +} + pub fn build_function<A: Architecture, M: FunctionMutability, V: NonSSAVariant>( func: &BNFunction, llil: &llil::Function<A, M, NonSSA<V>>, |
