summaryrefslogtreecommitdiff
path: root/plugins/warp/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/warp/src')
-rw-r--r--plugins/warp/src/bin/sigem.rs25
-rw-r--r--plugins/warp/src/cache.rs44
-rw-r--r--plugins/warp/src/convert.rs123
-rw-r--r--plugins/warp/src/lib.rs111
-rw-r--r--plugins/warp/src/matcher.rs21
-rw-r--r--plugins/warp/src/plugin.rs26
-rw-r--r--plugins/warp/src/plugin/add.rs2
-rw-r--r--plugins/warp/src/plugin/copy.rs2
-rw-r--r--plugins/warp/src/plugin/create.rs7
-rw-r--r--plugins/warp/src/plugin/find.rs7
-rw-r--r--plugins/warp/src/plugin/load.rs10
-rw-r--r--plugins/warp/src/plugin/types.rs18
-rw-r--r--plugins/warp/src/plugin/workflow.rs19
-rw-r--r--plugins/warp/src/snapshots/warp_ninja__tests__insta_signatures.snap39
-rw-r--r--plugins/warp/src/snapshots/warp_ninja__tests__snapshot__ctype.snap126
-rw-r--r--plugins/warp/src/snapshots/warp_ninja__tests__snapshot__fptostr.snap9
-rw-r--r--plugins/warp/src/snapshots/warp_ninja__tests__snapshot__mbslen.snap39
-rw-r--r--plugins/warp/src/snapshots/warp_ninja__tests__snapshot__memicmp.snap9
-rw-r--r--plugins/warp/src/snapshots/warp_ninja__tests__snapshot__strnicm.snap9
-rw-r--r--plugins/warp/src/snapshots/warp_ninja__tests__snapshot__wctype.snap117
-rw-r--r--plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atof.snap390
-rw-r--r--plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atoldbl.snap192
-rw-r--r--plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atox.snap186
23 files changed, 1292 insertions, 239 deletions
diff --git a/plugins/warp/src/bin/sigem.rs b/plugins/warp/src/bin/sigem.rs
index 6076e7d5..a455f1e8 100644
--- a/plugins/warp/src/bin/sigem.rs
+++ b/plugins/warp/src/bin/sigem.rs
@@ -7,7 +7,7 @@ use ar::Archive;
use clap::{arg, Parser};
use rayon::prelude::*;
-use binaryninja::binaryview::{BinaryView, BinaryViewExt};
+use binaryninja::binary_view::{BinaryView, BinaryViewExt};
use binaryninja::function::Function as BNFunction;
use binaryninja::rc::Guard as BNGuard;
use binaryninja::settings::Settings;
@@ -47,6 +47,7 @@ struct Args {
/// The external debug information file to use
#[arg(short, long)]
debug_info: Option<PathBuf>,
+ // TODO: Add a file filter and default to filter out files starting with "."
}
fn default_settings(bn_settings: &Settings) -> Value {
@@ -75,6 +76,10 @@ fn main() {
let args = Args::parse();
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init();
+ // TODO: After analysis finishes for a file we should save off the bndb to another directory called the bndb cache
+ // TODO: This cache should be used before opening a file for first analysis.
+
+ // TODO: We should resolve the path to something sensible in cases where user is passing CWD.
// If no output file was given, just prepend binary with extension sbin
let output_file = args
.output
@@ -87,22 +92,18 @@ fn main() {
}
log::debug!("Starting Binary Ninja session...");
- let _headless_session = binaryninja::headless::Session::new();
+ let _headless_session =
+ binaryninja::headless::Session::new().expect("Failed to initialize session");
// Adjust the amount of worker threads so that we can actually free BinaryViews.
- let bn_settings = Settings::new("");
let worker_count = rayon::current_num_threads() * 4;
log::debug!("Adjusting Binary Ninja worker count to {}...", worker_count);
- bn_settings.set_integer(
- "analysis.limits.workerThreadCount",
- worker_count as u64,
- None,
- None,
- );
+ binaryninja::worker_thread::set_worker_thread_count(worker_count);
// Make sure caches are flushed when the views get destructed.
register_cache_destructor();
+ let bn_settings = Settings::new();
let settings = default_settings(&bn_settings);
log::info!("Creating functions for {:?}...", args.path);
@@ -222,7 +223,6 @@ fn data_from_directory(settings: &Value, dir: PathBuf) -> Option<Data> {
}
}
-// TODO: Pass settings.
fn data_from_file(settings: &Value, path: &Path) -> Option<Data> {
match path.extension() {
Some(ext) if ext == "a" || ext == "lib" || ext == "rlib" => {
@@ -253,8 +253,9 @@ mod tests {
env_logger::init();
// TODO: Store oracles here to get more out of this test.
let out_dir = env!("OUT_DIR").parse::<PathBuf>().unwrap();
- let _headless_session = binaryninja::headless::Session::new();
- let bn_settings = Settings::new("");
+ let _headless_session =
+ binaryninja::headless::Session::new().expect("Failed to initialize session");
+ let bn_settings = Settings::new();
let settings = default_settings(&bn_settings);
for entry in std::fs::read_dir(out_dir).expect("Failed to read OUT_DIR") {
let entry = entry.expect("Failed to read directory entry");
diff --git a/plugins/warp/src/cache.rs b/plugins/warp/src/cache.rs
index 8111ca51..4b1df5af 100644
--- a/plugins/warp/src/cache.rs
+++ b/plugins/warp/src/cache.rs
@@ -1,14 +1,18 @@
use crate::convert::{from_bn_symbol, from_bn_type_internal};
use crate::{build_function, function_guid};
use binaryninja::architecture::Architecture;
-use binaryninja::binaryview::{BinaryView, BinaryViewExt};
+use binaryninja::binary_view::{BinaryView, BinaryViewExt};
+use binaryninja::confidence::MAX_CONFIDENCE;
use binaryninja::function::Function as BNFunction;
-use binaryninja::llil::{FunctionMutability, NonSSA, NonSSAVariant};
+use binaryninja::low_level_il::function::{
+ FunctionMutability, LowLevelILFunction, NonSSA, RegularNonSSA,
+};
+use binaryninja::low_level_il::RegularLowLevelILFunction;
use binaryninja::rc::Guard;
use binaryninja::rc::Ref as BNRef;
use binaryninja::symbol::Symbol as BNSymbol;
use binaryninja::types::NamedTypeReference as BNNamedTypeReference;
-use binaryninja::{llil, ObjectDestructor};
+use binaryninja::ObjectDestructor;
use dashmap::mapref::one::Ref;
use dashmap::DashMap;
use std::collections::HashSet;
@@ -64,9 +68,9 @@ pub fn try_cached_function_match(function: &BNFunction) -> Option<Function> {
.to_owned()
}
-pub fn cached_function<A: Architecture, M: FunctionMutability, V: NonSSAVariant>(
+pub fn cached_function<A: Architecture>(
function: &BNFunction,
- llil: &llil::Function<A, M, NonSSA<V>>,
+ llil: &RegularLowLevelILFunction<A>,
) -> Function {
let view = function.view();
let view_id = ViewID::from(view.as_ref());
@@ -118,9 +122,9 @@ where
}
}
-pub fn cached_function_guid<A: Architecture, M: FunctionMutability, V: NonSSAVariant>(
+pub fn cached_function_guid<A: Architecture, M: FunctionMutability>(
function: &BNFunction,
- llil: &llil::Function<A, M, NonSSA<V>>,
+ llil: &LowLevelILFunction<A, M, NonSSA<RegularNonSSA>>,
) -> FunctionGUID {
let view = function.view();
let view_id = ViewID::from(view);
@@ -198,10 +202,10 @@ pub struct FunctionCache {
}
impl FunctionCache {
- pub fn function<A: Architecture, M: FunctionMutability, V: NonSSAVariant>(
+ pub fn function<A: Architecture>(
&self,
function: &BNFunction,
- llil: &llil::Function<A, M, NonSSA<V>>,
+ llil: &RegularLowLevelILFunction<A>,
) -> Function {
let function_id = FunctionID::from(function);
match self.cache.get(&function_id) {
@@ -228,9 +232,9 @@ impl GUIDCache {
let func_platform = function.platform();
let mut constraints = HashSet::new();
for call_site in &function.call_sites() {
- for cs_ref_addr in view.get_code_refs_from(call_site.address, Some(function)) {
+ for cs_ref_addr in view.code_refs_from_addr(call_site.address, Some(function)) {
match view.function_at(&func_platform, cs_ref_addr) {
- Ok(cs_ref_func) => {
+ Some(cs_ref_func) => {
// Call site is a function, constrain on it.
let cs_ref_func_id = FunctionID::from(cs_ref_func.as_ref());
if cs_ref_func_id != func_id {
@@ -241,11 +245,11 @@ impl GUIDCache {
.insert(self.function_constraint(&cs_ref_func, call_site_offset));
}
}
- Err(_) => {
+ None => {
// We could be dealing with an extern symbol, get the symbol as a constraint.
let call_site_offset: i64 =
call_site.address.wrapping_sub(func_start) as i64;
- if let Ok(call_site_sym) = view.symbol_by_address(cs_ref_addr) {
+ if let Some(call_site_sym) = view.symbol_by_address(cs_ref_addr) {
constraints.insert(
self.function_constraint_from_symbol(
&call_site_sym,
@@ -326,10 +330,10 @@ impl GUIDCache {
}
}
- pub fn function_guid<A: Architecture, M: FunctionMutability, V: NonSSAVariant>(
+ pub fn function_guid<A: Architecture, M: FunctionMutability>(
&self,
function: &BNFunction,
- llil: &llil::Function<A, M, NonSSA<V>>,
+ llil: &LowLevelILFunction<A, M, NonSSA<RegularNonSSA>>,
) -> FunctionGUID {
let function_id = FunctionID::from(function);
match self.cache.get(&function_id) {
@@ -368,8 +372,12 @@ impl TypeRefCache {
Some(cache) => cache.to_owned(),
None => match type_ref.target(view) {
Some(raw_ty) => {
- let computed_ty =
- ComputedType::new(from_bn_type_internal(view, visited_refs, &raw_ty, 255));
+ let computed_ty = ComputedType::new(from_bn_type_internal(
+ view,
+ visited_refs,
+ &raw_ty,
+ MAX_CONFIDENCE,
+ ));
self.cache
.entry(ntr_id)
.insert(Some(computed_ty))
@@ -474,6 +482,6 @@ impl ObjectDestructor for CacheDestructor {
if let Some(cache) = TYPE_REF_CACHE.get() {
cache.remove(&view_id);
}
- log::debug!("Removed WARP caches for {:?}", view);
+ log::debug!("Removed WARP caches for {:?}", view.file().filename());
}
}
diff --git a/plugins/warp/src/convert.rs b/plugins/warp/src/convert.rs
index 8240123d..acf9aabc 100644
--- a/plugins/warp/src/convert.rs
+++ b/plugins/warp/src/convert.rs
@@ -2,12 +2,13 @@ use std::collections::HashSet;
use binaryninja::architecture::Architecture as BNArchitecture;
use binaryninja::architecture::ArchitectureExt;
-use binaryninja::binaryview::{BinaryView, BinaryViewExt};
-use binaryninja::callingconvention::CallingConvention as BNCallingConvention;
+use binaryninja::binary_view::{BinaryView, BinaryViewExt};
+use binaryninja::calling_convention::CoreCallingConvention as BNCallingConvention;
+use binaryninja::confidence::{Conf as BNConf, MAX_CONFIDENCE};
use binaryninja::rc::Ref as BNRef;
use binaryninja::symbol::{Symbol as BNSymbol, SymbolType as BNSymbolType};
use binaryninja::types::{
- BaseStructure as BNBaseStructure, Conf as BNConf, EnumerationBuilder as BNEnumerationBuilder,
+ BaseStructure as BNBaseStructure, EnumerationBuilder as BNEnumerationBuilder,
FunctionParameter as BNFunctionParameter, MemberAccess as BNMemberAccess, MemberAccess,
MemberScope as BNMemberScope, NamedTypeReference, NamedTypeReference as BNNamedTypeReference,
NamedTypeReferenceClass, StructureBuilder as BNStructureBuilder,
@@ -101,17 +102,15 @@ pub fn to_bn_symbol_at_address(view: &BinaryView, symbol: &Symbol, addr: u64) ->
let mut symbol_builder = BNSymbol::builder(symbol_type, &symbol.name, addr);
// Demangle symbol name (short is with simplifications).
if let Some(arch) = view.default_arch() {
- if let Ok((_, full_name_list)) =
+ if let Some((full_name, _)) =
binaryninja::demangle::demangle_generic(&arch, raw_name, Some(view), false)
{
- let full_name = full_name_list.join("::");
- symbol_builder = symbol_builder.full_name(&full_name);
+ symbol_builder = symbol_builder.full_name(full_name);
}
- if let Ok((_, short_name_list)) =
+ if let Some((short_name, _)) =
binaryninja::demangle::demangle_generic(&arch, raw_name, Some(view), false)
{
- let short_name = short_name_list.join("::");
- symbol_builder = symbol_builder.short_name(&short_name);
+ symbol_builder = symbol_builder.short_name(short_name);
}
}
symbol_builder.create()
@@ -159,7 +158,6 @@ pub fn from_bn_type_internal(
let mut members = raw_struct
.members()
- .unwrap()
.into_iter()
.map(|raw_member| {
let bit_offset = bytes_to_bits(raw_member.offset);
@@ -184,26 +182,24 @@ pub fn from_bn_type_internal(
.collect::<Vec<_>>();
// Add base structures as flattened members
- if let Ok(base_structs) = raw_struct.base_structures() {
- let base_to_member_iter = base_structs.iter().map(|base_struct| {
- let bit_offset = bytes_to_bits(base_struct.offset);
- let mut modifiers = StructureMemberModifiers::empty();
- modifiers.set(StructureMemberModifiers::Flattened, true);
- let base_struct_ty = from_bn_type_internal(
- view,
- visited_refs,
- &BNType::named_type(&base_struct.ty),
- 255,
- );
- StructureMember {
- name: base_struct_ty.name.to_owned(),
- offset: bit_offset,
- ty: base_struct_ty,
- modifiers,
- }
- });
- members.extend(base_to_member_iter);
- }
+ let base_to_member_iter = raw_struct.base_structures().into_iter().map(|base_struct| {
+ let bit_offset = bytes_to_bits(base_struct.offset);
+ let mut modifiers = StructureMemberModifiers::empty();
+ modifiers.set(StructureMemberModifiers::Flattened, true);
+ let base_struct_ty = from_bn_type_internal(
+ view,
+ visited_refs,
+ &BNType::named_type(&base_struct.ty),
+ MAX_CONFIDENCE,
+ );
+ StructureMember {
+ name: base_struct_ty.name.to_owned(),
+ offset: bit_offset,
+ ty: base_struct_ty,
+ modifiers,
+ }
+ });
+ members.extend(base_to_member_iter);
// TODO: Check if union
let struct_class = StructureClass::new(members);
@@ -275,8 +271,8 @@ pub fn from_bn_type_internal(
ty: from_bn_type_internal(
view,
visited_refs,
- &raw_member.t.contents,
- raw_member.t.confidence,
+ &raw_member.ty.contents,
+ raw_member.ty.confidence,
),
// TODO: Just omit location for now?
// TODO: Location should be optional...
@@ -286,7 +282,7 @@ pub fn from_bn_type_internal(
.collect();
let mut out_members = Vec::new();
- if let Ok(return_ty) = raw_ty.return_value() {
+ if let Some(return_ty) = raw_ty.return_value() {
out_members.push(FunctionMember {
name: None,
ty: from_bn_type_internal(
@@ -301,8 +297,7 @@ pub fn from_bn_type_internal(
let calling_convention = raw_ty
.calling_convention()
- .map(|bn_cc| from_bn_calling_convention(bn_cc.contents))
- .ok();
+ .map(|bn_cc| from_bn_calling_convention(bn_cc.contents));
let func_class = FunctionClass {
calling_convention,
@@ -338,7 +333,7 @@ pub fn from_bn_type_internal(
}
};
- let name = raw_ty.registered_name().map(|n| n.name().to_string()).ok();
+ let name = raw_ty.registered_name().map(|n| n.name().to_string());
Type {
name,
@@ -353,9 +348,7 @@ pub fn from_bn_type_internal(
}
}
-pub fn from_bn_calling_convention<A: BNArchitecture>(
- raw_cc: BNRef<BNCallingConvention<A>>,
-) -> CallingConvention {
+pub fn from_bn_calling_convention(raw_cc: BNRef<BNCallingConvention>) -> CallingConvention {
// NOTE: Currently calling convention just stores the name.
CallingConvention::new(raw_cc.name().as_str())
}
@@ -363,7 +356,7 @@ pub fn from_bn_calling_convention<A: BNArchitecture>(
pub fn to_bn_calling_convention<A: BNArchitecture>(
arch: &A,
calling_convention: &CallingConvention,
-) -> BNRef<BNCallingConvention<A>> {
+) -> BNRef<BNCallingConvention> {
for cc in &arch.calling_conventions() {
if cc.name().as_str() == calling_convention.name {
return cc.clone();
@@ -406,7 +399,7 @@ pub fn to_bn_type<A: BNArchitecture>(arch: &A, ty: &Type) -> BNRef<BNType> {
BNType::array(&member_type, c.length.unwrap_or(0))
}
TypeClass::Structure(c) => {
- let builder = BNStructureBuilder::new();
+ let mut builder = BNStructureBuilder::new();
// TODO: Structure type class?
// TODO: Alignment
// TODO: Other modifiers?
@@ -439,11 +432,11 @@ pub fn to_bn_type<A: BNArchitecture>(arch: &A, ty: &Type) -> BNRef<BNType> {
Some(guid) => BNNamedTypeReference::new_with_id(
NamedTypeReferenceClass::UnknownNamedTypeClass,
guid.to_string(),
- base_struct_ntr_name.into(),
+ base_struct_ntr_name,
),
None => BNNamedTypeReference::new(
NamedTypeReferenceClass::UnknownNamedTypeClass,
- base_struct_ntr_name.into(),
+ base_struct_ntr_name,
),
};
base_structs.push(BNBaseStructure::new(
@@ -462,7 +455,7 @@ pub fn to_bn_type<A: BNArchitecture>(arch: &A, ty: &Type) -> BNRef<BNType> {
}
} else {
builder.insert_member(
- &BNStructureMember::new(
+ BNStructureMember::new(
member_type,
member_name,
member_offset,
@@ -473,7 +466,7 @@ pub fn to_bn_type<A: BNArchitecture>(arch: &A, ty: &Type) -> BNRef<BNType> {
);
}
}
- builder.set_base_structures(base_structs);
+ builder.base_structures(&base_structs);
BNType::structure(&builder.finalize())
}
TypeClass::Enumeration(c) => {
@@ -485,13 +478,14 @@ pub fn to_bn_type<A: BNArchitecture>(arch: &A, ty: &Type) -> BNRef<BNType> {
builder.insert(member_name, member_value);
}
// TODO: Warn if enumeration has no size.
- let width = bits_to_bytes(c.member_type.size().unwrap()) as _;
+ let width = bits_to_bytes(c.member_type.size().unwrap()) as usize;
let signed = matches!(*c.member_type.class, TypeClass::Integer(c) if c.signed);
- BNType::enumeration(&builder.finalize(), width, signed)
+ // TODO: Passing width like this is weird.
+ BNType::enumeration(&builder.finalize(), width.try_into().unwrap(), signed)
}
TypeClass::Union(c) => {
- let builder = BNStructureBuilder::new();
- builder.set_structure_type(BNStructureType::UnionStructureType);
+ let mut builder = BNStructureBuilder::new();
+ builder.structure_type(BNStructureType::UnionStructureType);
for member in &c.members {
let member_type = BNConf::new(to_bn_type(arch, &member.ty), u8::MAX);
let member_name = member.name.to_owned();
@@ -506,7 +500,7 @@ pub fn to_bn_type<A: BNArchitecture>(arch: &A, ty: &Type) -> BNRef<BNType> {
member_access,
member_scope,
);
- builder.insert_member(&structure_member, false);
+ builder.insert_member(structure_member, false);
}
BNType::structure(&builder.finalize())
}
@@ -533,15 +527,15 @@ pub fn to_bn_type<A: BNArchitecture>(arch: &A, ty: &Type) -> BNRef<BNType> {
match c.calling_convention.as_ref() {
Some(cc) => {
let calling_convention = to_bn_calling_convention(arch, cc);
- BNType::function_with_options(
+ BNType::function_with_opts(
&return_type,
&params,
variable_args,
- &BNConf::new(calling_convention, u8::MAX),
+ BNConf::new(calling_convention, u8::MAX),
BNConf::new(0, 0),
)
}
- None => BNType::function(&return_type, &params, variable_args),
+ None => BNType::function(&return_type, params, variable_args),
}
}
TypeClass::Referrer(c) => {
@@ -552,19 +546,19 @@ pub fn to_bn_type<A: BNArchitecture>(arch: &A, ty: &Type) -> BNRef<BNType> {
NamedTypeReference::new_with_id(
NamedTypeReferenceClass::UnknownNamedTypeClass,
guid_str,
- ntr_name.into(),
+ ntr_name,
)
}
None => match c.name.as_ref() {
Some(ntr_name) => NamedTypeReference::new(
NamedTypeReferenceClass::UnknownNamedTypeClass,
- ntr_name.into(),
+ ntr_name,
),
None => {
log::error!("Referrer with no reference! {:?}", c);
NamedTypeReference::new(
NamedTypeReferenceClass::UnknownNamedTypeClass,
- "AHHHHHH".into(),
+ "AHHHHHH",
)
}
},
@@ -577,7 +571,7 @@ pub fn to_bn_type<A: BNArchitecture>(arch: &A, ty: &Type) -> BNRef<BNType> {
#[cfg(test)]
mod tests {
use super::*;
- use binaryninja::binaryview::BinaryViewExt;
+ use binaryninja::binary_view::BinaryViewExt;
use binaryninja::headless::Session;
use std::path::PathBuf;
use std::sync::OnceLock;
@@ -586,7 +580,7 @@ mod tests {
static INIT: OnceLock<Session> = OnceLock::new();
fn get_session<'a>() -> &'a Session {
- INIT.get_or_init(|| Session::new())
+ INIT.get_or_init(|| Session::new().expect("Failed to initialize session"))
}
#[test]
@@ -602,8 +596,8 @@ mod tests {
let converted_types: Vec<_> = bv
.types()
.iter()
- .map(|t| {
- let ty = from_bn_type(&bv, &t.type_object(), u8::MAX);
+ .map(|qualified_name_and_type| {
+ let ty = from_bn_type(&bv, &qualified_name_and_type.ty, u8::MAX);
(TypeGUID::from(&ty), ty)
})
.collect();
@@ -613,6 +607,7 @@ mod tests {
}
}
+ #[ignore]
#[test]
fn check_for_leaks() {
let session = get_session();
@@ -627,13 +622,13 @@ mod tests {
.types()
.iter()
.map(|t| {
- let ty = from_bn_type(&inital_bv, &t.type_object(), u8::MAX);
+ let ty = from_bn_type(&inital_bv, &t.ty, u8::MAX);
(TypeGUID::from(&ty), ty)
})
.collect();
assert_eq!(types_len, converted_types.len());
// Hold on to a reference to the core to prevent view getting dropped in worker thread.
- let core_ref = inital_bv
+ let _core_ref = inital_bv
.functions()
.iter()
.next()
@@ -648,13 +643,13 @@ mod tests {
.types()
.iter()
.map(|t| {
- let ty = from_bn_type(&second_bv, &t.type_object(), u8::MAX);
+ let ty = from_bn_type(&second_bv, &t.ty, u8::MAX);
(TypeGUID::from(&ty), ty)
})
.collect();
assert_eq!(types_len, converted_types.len());
// Hold on to a reference to the core to prevent view getting dropped in worker thread.
- let core_ref = second_bv
+ let _core_ref = second_bv
.functions()
.iter()
.next()
diff --git a/plugins/warp/src/lib.rs b/plugins/warp/src/lib.rs
index 6e195fc3..3f2fc276 100644
--- a/plugins/warp/src/lib.rs
+++ b/plugins/warp/src/lib.rs
@@ -1,25 +1,28 @@
+use crate::cache::{
+ cached_adjacency_constraints, cached_call_site_constraints, cached_function_guid,
+};
+use crate::convert::{from_bn_symbol, from_bn_type};
use binaryninja::architecture::{
Architecture, ImplicitRegisterExtend, Register as BNRegister, RegisterInfo,
};
-use binaryninja::basicblock::BasicBlock as BNBasicBlock;
-use binaryninja::binaryview::BinaryViewExt;
+use binaryninja::basic_block::BasicBlock as BNBasicBlock;
+use binaryninja::binary_view::BinaryViewExt;
+use binaryninja::confidence::MAX_CONFIDENCE;
use binaryninja::function::{Function as BNFunction, NativeBlock};
-use binaryninja::llil;
-use binaryninja::llil::{
- ExprInfo, FunctionMutability, InstrInfo, Instruction, NonSSA, NonSSAVariant, Register,
- VisitorAction,
+use binaryninja::low_level_il::expression::{ExpressionHandler, LowLevelILExpressionKind};
+use binaryninja::low_level_il::function::{
+ FunctionMutability, LowLevelILFunction, NonSSA, RegularNonSSA,
};
+use binaryninja::low_level_il::instruction::{
+ InstructionHandler, LowLevelILInstruction, LowLevelILInstructionKind,
+};
+use binaryninja::low_level_il::{LowLevelILRegister, VisitorAction};
use binaryninja::rc::Ref as BNRef;
use std::path::PathBuf;
use warp::signature::basic_block::BasicBlockGUID;
use warp::signature::function::constraints::FunctionConstraints;
use warp::signature::function::{Function, FunctionGUID};
-use crate::cache::{
- cached_adjacency_constraints, cached_call_site_constraints, cached_function_guid,
-};
-use crate::convert::{from_bn_symbol, from_bn_type};
-
pub mod cache;
pub mod convert;
mod matcher;
@@ -28,7 +31,7 @@ mod plugin;
pub fn core_signature_dir() -> PathBuf {
// Get core signatures for the given platform
- let install_dir = binaryninja::install_directory().unwrap();
+ let install_dir = binaryninja::install_directory();
// macOS core dir is separate from the install dir.
#[cfg(target_os = "macos")]
let core_dir = install_dir.parent().unwrap().join("Resources");
@@ -38,18 +41,18 @@ pub fn core_signature_dir() -> PathBuf {
}
pub fn user_signature_dir() -> PathBuf {
- binaryninja::user_directory().unwrap().join("signatures/")
+ binaryninja::user_directory().join("signatures/")
}
-pub fn build_function<A: Architecture, M: FunctionMutability, V: NonSSAVariant>(
+pub fn build_function<A: Architecture, M: FunctionMutability>(
func: &BNFunction,
- llil: &llil::Function<A, M, NonSSA<V>>,
+ llil: &LowLevelILFunction<A, M, NonSSA<RegularNonSSA>>,
) -> Function {
let bn_fn_ty = func.function_type();
Function {
guid: cached_function_guid(func, llil),
symbol: from_bn_symbol(&func.symbol()),
- ty: from_bn_type(&func.view(), &bn_fn_ty, 255),
+ ty: from_bn_type(&func.view(), &bn_fn_ty, MAX_CONFIDENCE),
constraints: FunctionConstraints {
// NOTE: Adding adjacent only works if analysis is complete.
// NOTE: We do not filter out adjacent functions here.
@@ -69,13 +72,13 @@ pub fn sorted_basic_blocks(func: &BNFunction) -> Vec<BNRef<BNBasicBlock<NativeBl
.iter()
.map(|bb| bb.clone())
.collect::<Vec<_>>();
- basic_blocks.sort_by_key(|f| f.raw_start());
+ basic_blocks.sort_by_key(|f| f.start_index());
basic_blocks
}
-pub fn function_guid<A: Architecture, M: FunctionMutability, V: NonSSAVariant>(
+pub fn function_guid<A: Architecture, M: FunctionMutability>(
func: &BNFunction,
- llil: &llil::Function<A, M, NonSSA<V>>,
+ llil: &LowLevelILFunction<A, M, NonSSA<RegularNonSSA>>,
) -> FunctionGUID {
let basic_blocks = sorted_basic_blocks(func);
let basic_block_guids = basic_blocks
@@ -85,9 +88,9 @@ pub fn function_guid<A: Architecture, M: FunctionMutability, V: NonSSAVariant>(
FunctionGUID::from_basic_blocks(&basic_block_guids)
}
-pub fn basic_block_guid<A: Architecture, M: FunctionMutability, V: NonSSAVariant>(
+pub fn basic_block_guid<A: Architecture, M: FunctionMutability>(
basic_block: &BNBasicBlock<NativeBlock>,
- llil: &llil::Function<A, M, NonSSA<V>>,
+ llil: &LowLevelILFunction<A, M, NonSSA<RegularNonSSA>>,
) -> BasicBlockGUID {
let func = basic_block.function();
let view = func.view();
@@ -95,14 +98,16 @@ pub fn basic_block_guid<A: Architecture, M: FunctionMutability, V: NonSSAVariant
let max_instr_len = arch.max_instr_len();
// NOPs and useless moves are blacklisted to allow for hot-patchable functions.
- let is_blacklisted_instr = |instr: &Instruction<A, M, NonSSA<V>>| {
- match instr.info() {
- InstrInfo::Nop(_) => true,
- InstrInfo::SetReg(op) => {
- match op.source_expr().info() {
- ExprInfo::Reg(source_op) if op.dest_reg() == source_op.source_reg() => {
+ let is_blacklisted_instr = |instr: &LowLevelILInstruction<A, M, NonSSA<RegularNonSSA>>| {
+ match instr.kind() {
+ LowLevelILInstructionKind::Nop(_) => true,
+ LowLevelILInstructionKind::SetReg(op) => {
+ match op.source_expr().kind() {
+ LowLevelILExpressionKind::Reg(source_op)
+ if op.dest_reg() == source_op.source_reg() =>
+ {
match op.dest_reg() {
- Register::ArchReg(r) => {
+ LowLevelILRegister::ArchReg(r) => {
// If this register has no implicit extend then we can safely assume it's a NOP.
// Ex. on x86_64 we don't want to remove `mov edi, edi` as it will zero the upper 32 bits.
// Ex. on x86 we do want to remove `mov edi, edi` as it will not have a side effect like above.
@@ -111,7 +116,7 @@ pub fn basic_block_guid<A: Architecture, M: FunctionMutability, V: NonSSAVariant
ImplicitRegisterExtend::NoExtend
)
}
- Register::Temp(_) => false,
+ LowLevelILRegister::Temp(_) => false,
}
}
_ => false,
@@ -121,16 +126,19 @@ pub fn basic_block_guid<A: Architecture, M: FunctionMutability, V: NonSSAVariant
}
};
- let is_variant_instr = |instr: &Instruction<A, M, NonSSA<V>>| {
- let is_variant_expr = |expr: &ExprInfo<A, M, NonSSA<V>>| {
+ let is_variant_instr = |instr: &LowLevelILInstruction<A, M, NonSSA<RegularNonSSA>>| {
+ let is_variant_expr = |expr: &LowLevelILExpressionKind<A, M, NonSSA<RegularNonSSA>>| {
+ // TODO: Checking the section here is slow, we should gather all section ranges outside of this.
match expr {
- ExprInfo::ConstPtr(op) if !view.sections_at(op.value()).is_empty() => {
+ LowLevelILExpressionKind::ConstPtr(op)
+ if !view.sections_at(op.value()).is_empty() =>
+ {
// Constant Pointer must be in a section for it to be relocatable.
// NOTE: We cannot utilize segments here as there will be a zero based segment.
true
}
- ExprInfo::ExternPtr(_) => true,
- ExprInfo::Const(op) if !view.sections_at(op.value()).is_empty() => {
+ LowLevelILExpressionKind::ExternPtr(_) => true,
+ LowLevelILExpressionKind::Const(op) if !view.sections_at(op.value()).is_empty() => {
// Constant value must be in a section for it to be relocatable.
// NOTE: We cannot utilize segments here as there will be a zero based segment.
true
@@ -140,8 +148,8 @@ pub fn basic_block_guid<A: Architecture, M: FunctionMutability, V: NonSSAVariant
};
// Visit instruction expressions looking for variant expression, [VisitorAction::Halt] means variant.
- instr.visit_tree(&mut |_expr, expr_info| {
- if is_variant_expr(expr_info) {
+ instr.visit_tree(&mut |expr| {
+ if is_variant_expr(&expr.kind()) {
// Found a variant expression
VisitorAction::Halt
} else {
@@ -150,12 +158,12 @@ pub fn basic_block_guid<A: Architecture, M: FunctionMutability, V: NonSSAVariant
}) == VisitorAction::Halt
};
- let basic_block_range = basic_block.raw_start()..basic_block.raw_end();
+ let basic_block_range = basic_block.start_index()..basic_block.end_index();
let mut basic_block_bytes = Vec::with_capacity(basic_block_range.count());
for instr_addr in basic_block.into_iter() {
let mut instr_bytes = view.read_vec(instr_addr, max_instr_len);
if let Some(instr_info) = arch.instruction_info(&instr_bytes, instr_addr) {
- instr_bytes.truncate(instr_info.len());
+ instr_bytes.truncate(instr_info.length);
if let Some(instr_llil) = llil.instruction_at(instr_addr) {
// If instruction is blacklisted don't include the bytes.
if !is_blacklisted_instr(&instr_llil) {
@@ -176,7 +184,7 @@ pub fn basic_block_guid<A: Architecture, M: FunctionMutability, V: NonSSAVariant
#[cfg(test)]
mod tests {
use crate::cache::cached_function_guid;
- use binaryninja::binaryview::BinaryViewExt;
+ use binaryninja::binary_view::BinaryViewExt;
use binaryninja::headless::Session;
use std::path::PathBuf;
use std::sync::OnceLock;
@@ -185,7 +193,7 @@ mod tests {
fn get_session<'a>() -> &'a Session {
// TODO: This is not shared between other test modules, should still be fine (mutex in core now).
- INIT.get_or_init(|| Session::new())
+ INIT.get_or_init(|| Session::new().expect("Failed to initialize session"))
}
#[test]
@@ -196,19 +204,16 @@ mod tests {
let entry = entry.expect("Failed to read directory entry");
let path = entry.path();
if path.is_file() {
- if let Some(path_str) = path.to_str() {
- if path_str.ends_with("library.o") {
- if let Some(inital_bv) = session.load(path_str) {
- let mut functions = inital_bv
- .functions()
- .iter()
- .map(|f| cached_function_guid(&f, &f.low_level_il().unwrap()))
- .collect::<Vec<_>>();
- functions.sort_by_key(|guid| guid.guid);
- insta::assert_debug_snapshot!(functions);
- }
- }
- }
+ let view = session.load(&path).expect("Failed to load view");
+ let mut functions = view
+ .functions()
+ .iter()
+ .map(|f| cached_function_guid(&f, &f.low_level_il().unwrap()))
+ .collect::<Vec<_>>();
+ functions.sort_by_key(|guid| guid.guid);
+ let snapshot_name =
+ format!("snapshot_{}", path.file_stem().unwrap().to_string_lossy());
+ insta::assert_debug_snapshot!(snapshot_name, functions);
}
}
}
diff --git a/plugins/warp/src/matcher.rs b/plugins/warp/src/matcher.rs
index 8df72a20..81458f8d 100644
--- a/plugins/warp/src/matcher.rs
+++ b/plugins/warp/src/matcher.rs
@@ -1,5 +1,5 @@
use binaryninja::architecture::Architecture as BNArchitecture;
-use binaryninja::binaryview::{BinaryView, BinaryViewExt};
+use binaryninja::binary_view::{BinaryView, BinaryViewExt};
use binaryninja::function::Function as BNFunction;
use binaryninja::platform::Platform;
use binaryninja::rc::Guard;
@@ -119,7 +119,7 @@ impl Matcher {
ty: &Type,
) {
let ty_id_str = TypeGUID::from(ty).to_string();
- if view.get_type_by_id(&ty_id_str).is_some() {
+ if view.type_by_id(&ty_id_str).is_some() {
// Type already added.
return;
}
@@ -159,7 +159,7 @@ impl Matcher {
if let Some(ref_guid) = c.guid {
// NOTE: We do not need to check for cyclic reference here because
// NOTE: GUID references are unable to be referenced by themselves.
- if view.get_type_by_id(ref_guid.to_string()).is_none() {
+ if view.type_by_id(ref_guid.to_string()).is_none() {
// Add the referrer to the view if it is in the Matcher types
if let Some(ref_ty) = matcher.types.get(&ref_guid) {
inner_add_type_to_view(matcher, view, arch, visited_refs, &ref_ty);
@@ -172,7 +172,7 @@ impl Matcher {
// Only try and resolve by name if not already visiting.
if !resolved
&& visited_refs.insert(ref_name.to_string())
- && view.get_type_by_name(ref_name).is_none()
+ && view.type_by_name(ref_name).is_none()
{
// Add the ref to the view if it is in the Matcher types
if let Some(ref_ty) = matcher.named_types.get(ref_name) {
@@ -398,7 +398,7 @@ impl MatcherSettings {
/// NOTE: If you are using this as a library then just modify the MatcherSettings directly
/// in the matcher instance, that way you don't need to round-trip through Binary Ninja.
pub fn register() {
- let bn_settings = binaryninja::settings::Settings::new("");
+ let bn_settings = binaryninja::settings::Settings::new();
let trivial_function_len_props = json!({
"title" : "Trivial Function Length",
@@ -463,25 +463,24 @@ impl MatcherSettings {
pub fn global() -> Self {
let mut settings = MatcherSettings::default();
- let bn_settings = binaryninja::settings::Settings::new("");
+ let bn_settings = binaryninja::settings::Settings::new();
if bn_settings.contains(Self::TRIVIAL_FUNCTION_LEN_SETTING) {
settings.trivial_function_len =
- bn_settings.get_integer(Self::TRIVIAL_FUNCTION_LEN_SETTING, None, None);
+ bn_settings.get_integer(Self::TRIVIAL_FUNCTION_LEN_SETTING);
}
if bn_settings.contains(Self::MINIMUM_FUNCTION_LEN_SETTING) {
settings.minimum_function_len =
- bn_settings.get_integer(Self::MINIMUM_FUNCTION_LEN_SETTING, None, None);
+ bn_settings.get_integer(Self::MINIMUM_FUNCTION_LEN_SETTING);
}
if bn_settings.contains(Self::MAXIMUM_FUNCTION_LEN_SETTING) {
- match bn_settings.get_integer(Self::MAXIMUM_FUNCTION_LEN_SETTING, None, None) {
+ match bn_settings.get_integer(Self::MAXIMUM_FUNCTION_LEN_SETTING) {
0 => settings.maximum_function_len = None,
len => settings.maximum_function_len = Some(len),
}
}
if bn_settings.contains(Self::MINIMUM_MATCHED_CONSTRAINTS_SETTING) {
settings.minimum_matched_constraints =
- bn_settings.get_integer(Self::MINIMUM_MATCHED_CONSTRAINTS_SETTING, None, None)
- as usize;
+ bn_settings.get_integer(Self::MINIMUM_MATCHED_CONSTRAINTS_SETTING) as usize;
}
settings
}
diff --git a/plugins/warp/src/plugin.rs b/plugins/warp/src/plugin.rs
index 224887ef..86c4bc7b 100644
--- a/plugins/warp/src/plugin.rs
+++ b/plugins/warp/src/plugin.rs
@@ -6,7 +6,7 @@ use crate::matcher::{
invalidate_function_matcher_cache, Matcher, MatcherSettings, PlatformID, PLAT_MATCHER_CACHE,
};
use crate::{build_function, cache};
-use binaryninja::binaryview::{BinaryView, BinaryViewExt};
+use binaryninja::binary_view::{BinaryView, BinaryViewExt};
use binaryninja::command::{Command, FunctionCommand};
use binaryninja::function::{Function, FunctionUpdateType};
use binaryninja::logger::Logger;
@@ -30,7 +30,7 @@ const TAG_ICON: &str = "🌏";
const TAG_NAME: &str = "WARP";
fn get_warp_tag_type(view: &BinaryView) -> Ref<TagType> {
- view.get_tag_type(TAG_NAME)
+ view.tag_type_by_name(TAG_NAME)
.unwrap_or_else(|| view.create_tag_type(TAG_NAME, TAG_ICON))
}
@@ -186,67 +186,67 @@ pub extern "C" fn CorePluginInit() -> bool {
workflow::insert_workflow();
- binaryninja::command::register(
+ binaryninja::command::register_command(
"WARP\\Run Matcher",
"Run the matcher manually",
workflow::RunMatcher {},
);
- binaryninja::command::register(
+ binaryninja::command::register_command(
"WARP\\Debug\\Cache",
"Debug cache sizes... because...",
DebugCache {},
);
- binaryninja::command::register(
+ binaryninja::command::register_command(
"WARP\\Debug\\Invalidate Caches",
"Invalidate all WARP caches",
DebugInvalidateCache {},
);
- binaryninja::command::register_for_function(
+ binaryninja::command::register_command_for_function(
"WARP\\Debug\\Function Signature",
"Print the entire signature for the function",
DebugFunction {},
);
- binaryninja::command::register_for_function(
+ binaryninja::command::register_command_for_function(
"WARP\\Debug\\Function Matcher",
"Print all possible matches for the function",
DebugMatcher {},
);
- binaryninja::command::register(
+ binaryninja::command::register_command(
"WARP\\Debug\\Apply Signature File Types",
"Load all types from a signature file and ignore functions",
types::LoadTypes {},
);
- binaryninja::command::register(
+ binaryninja::command::register_command(
"WARP\\Load Signature File",
"Load file into the matcher, this does NOT kick off matcher analysis",
load::LoadSignatureFile {},
);
- binaryninja::command::register_for_function(
+ binaryninja::command::register_command_for_function(
"WARP\\Copy Function GUID",
"Copy the computed GUID for the function",
copy::CopyFunctionGUID {},
);
- binaryninja::command::register(
+ binaryninja::command::register_command(
"WARP\\Find Function From GUID",
"Locate the function in the view using a GUID",
find::FindFunctionFromGUID {},
);
- binaryninja::command::register(
+ binaryninja::command::register_command(
"WARP\\Generate Signature File",
"Generates a signature file containing all binary view functions",
create::CreateSignatureFile {},
);
- binaryninja::command::register_for_function(
+ binaryninja::command::register_command_for_function(
"WARP\\Add Function Signature to File",
"Stores the signature for the function in the signature file",
add::AddFunctionSignature {},
diff --git a/plugins/warp/src/plugin/add.rs b/plugins/warp/src/plugin/add.rs
index 19cf7115..2f76c8b5 100644
--- a/plugins/warp/src/plugin/add.rs
+++ b/plugins/warp/src/plugin/add.rs
@@ -1,7 +1,7 @@
use crate::cache::{cached_function, cached_type_references};
use crate::matcher::invalidate_function_matcher_cache;
use crate::user_signature_dir;
-use binaryninja::binaryview::BinaryView;
+use binaryninja::binary_view::BinaryView;
use binaryninja::command::FunctionCommand;
use binaryninja::function::Function;
use std::thread;
diff --git a/plugins/warp/src/plugin/copy.rs b/plugins/warp/src/plugin/copy.rs
index d539a430..18da7dfb 100644
--- a/plugins/warp/src/plugin/copy.rs
+++ b/plugins/warp/src/plugin/copy.rs
@@ -1,4 +1,4 @@
-use binaryninja::binaryview::BinaryView;
+use binaryninja::binary_view::BinaryView;
use binaryninja::command::FunctionCommand;
use binaryninja::function::Function;
diff --git a/plugins/warp/src/plugin/create.rs b/plugins/warp/src/plugin/create.rs
index a936074a..4beba195 100644
--- a/plugins/warp/src/plugin/create.rs
+++ b/plugins/warp/src/plugin/create.rs
@@ -1,7 +1,7 @@
use crate::cache::{cached_function, cached_type_references};
use crate::matcher::invalidate_function_matcher_cache;
use crate::user_signature_dir;
-use binaryninja::binaryview::{BinaryView, BinaryViewExt};
+use binaryninja::binary_view::{BinaryView, BinaryViewExt};
use binaryninja::command::Command;
use binaryninja::function::Function;
use binaryninja::rc::Guard;
@@ -30,11 +30,10 @@ impl Command for CreateSignatureFile {
thread::spawn(move || {
let total_functions = view.functions().len();
let done_functions = AtomicUsize::default();
- let background_task = binaryninja::backgroundtask::BackgroundTask::new(
+ let background_task = binaryninja::background_task::BackgroundTask::new(
format!("Generating signatures... ({}/{})", 0, total_functions),
true,
- )
- .unwrap();
+ );
let start = Instant::now();
diff --git a/plugins/warp/src/plugin/find.rs b/plugins/warp/src/plugin/find.rs
index f54b4a4c..b2102e5e 100644
--- a/plugins/warp/src/plugin/find.rs
+++ b/plugins/warp/src/plugin/find.rs
@@ -1,5 +1,5 @@
use crate::cache::try_cached_function_guid;
-use binaryninja::binaryview::{BinaryView, BinaryViewExt};
+use binaryninja::binary_view::{BinaryView, BinaryViewExt};
use binaryninja::command::Command;
use binaryninja::function::Function as BNFunction;
use binaryninja::rc::Guard as BNGuard;
@@ -26,11 +26,10 @@ impl Command for FindFunctionFromGUID {
log::info!("Searching functions for GUID... {}", searched_guid);
let funcs = view.functions();
thread::spawn(move || {
- let background_task = binaryninja::backgroundtask::BackgroundTask::new(
+ let background_task = binaryninja::background_task::BackgroundTask::new(
format!("Searching functions for GUID... {}", searched_guid),
false,
- )
- .unwrap();
+ );
// Only run this for functions which have already generated a GUID.
let matched = funcs
diff --git a/plugins/warp/src/plugin/load.rs b/plugins/warp/src/plugin/load.rs
index 03356444..c86a16cb 100644
--- a/plugins/warp/src/plugin/load.rs
+++ b/plugins/warp/src/plugin/load.rs
@@ -1,5 +1,5 @@
use crate::matcher::{Matcher, PlatformID, PLAT_MATCHER_CACHE};
-use binaryninja::binaryview::{BinaryView, BinaryViewExt};
+use binaryninja::binary_view::{BinaryView, BinaryViewExt};
use binaryninja::command::Command;
pub struct LoadSignatureFile;
@@ -10,8 +10,12 @@ impl Command for LoadSignatureFile {
return;
};
- let Some(file) =
- binaryninja::interaction::get_open_filename_input("Load Signature File", "*.sbin")
+ // NOTE: Because we only can consume signatures from a specific directory, we don't need to use the interaction API.
+ // If we did need to load signature files from a project than this would need to change.
+ let Some(file) = rfd::FileDialog::new()
+ .add_filter("Signature Files", &["sbin"])
+ .set_file_name(format!("{}.sbin", view.file().filename()))
+ .pick_file()
else {
return;
};
diff --git a/plugins/warp/src/plugin/types.rs b/plugins/warp/src/plugin/types.rs
index fb030bfe..057d5f98 100644
--- a/plugins/warp/src/plugin/types.rs
+++ b/plugins/warp/src/plugin/types.rs
@@ -1,5 +1,5 @@
use crate::convert::to_bn_type;
-use binaryninja::binaryview::{BinaryView, BinaryViewExt};
+use binaryninja::binary_view::{BinaryView, BinaryViewExt};
use binaryninja::command::Command;
use std::time::Instant;
@@ -7,10 +7,13 @@ pub struct LoadTypes;
impl Command for LoadTypes {
fn action(&self, view: &BinaryView) {
- let Some(file) = binaryninja::interaction::get_open_filename_input(
- "Apply Signature File Types",
- "*.sbin",
- ) else {
+ // NOTE: Because we only can consume signatures from a specific directory, we don't need to use the interaction API.
+ // If we did need to load signature files from a project than this would need to change.
+ let Some(file) = rfd::FileDialog::new()
+ .add_filter("Signature Files", &["sbin"])
+ .set_file_name(format!("{}.sbin", view.file().filename()))
+ .pick_file()
+ else {
return;
};
@@ -31,11 +34,10 @@ impl Command for LoadTypes {
let view = view.to_owned();
std::thread::spawn(move || {
- let background_task = binaryninja::backgroundtask::BackgroundTask::new(
+ let background_task = binaryninja::background_task::BackgroundTask::new(
format!("Applying {} types...", data.types.len()),
true,
- )
- .unwrap();
+ );
let start = Instant::now();
for comp_ty in data.types {
diff --git a/plugins/warp/src/plugin/workflow.rs b/plugins/warp/src/plugin/workflow.rs
index bcd19f47..fbd50dc8 100644
--- a/plugins/warp/src/plugin/workflow.rs
+++ b/plugins/warp/src/plugin/workflow.rs
@@ -1,9 +1,9 @@
use crate::cache::cached_function_guid;
use crate::matcher::cached_function_matcher;
-use binaryninja::backgroundtask::BackgroundTask;
-use binaryninja::binaryview::{BinaryView, BinaryViewExt};
+use binaryninja::background_task::BackgroundTask;
+use binaryninja::binary_view::{BinaryView, BinaryViewExt};
use binaryninja::command::Command;
-use binaryninja::llil;
+use binaryninja::low_level_il::function::RegularNonSSA;
use binaryninja::workflow::{Activity, AnalysisContext, Workflow};
use std::time::Instant;
@@ -37,7 +37,7 @@ impl Command for RunMatcher {
// TODO: Check to see if the GUID cache is empty and ask the user if they want to regenerate the guids.
std::thread::spawn(move || {
let undo_id = view.file().begin_undo_actions(true);
- let background_task = BackgroundTask::new("Matching on functions...", false).unwrap();
+ let background_task = BackgroundTask::new("Matching on functions...", false);
let start = Instant::now();
view.functions()
.iter()
@@ -59,7 +59,7 @@ pub fn insert_workflow() {
let matcher_activity = |ctx: &AnalysisContext| {
let view = ctx.view();
let undo_id = view.file().begin_undo_actions(true);
- let background_task = BackgroundTask::new("Matching on functions...", false).unwrap();
+ let background_task = BackgroundTask::new("Matching on functions...", false);
let start = Instant::now();
view.functions()
.iter()
@@ -73,12 +73,14 @@ pub fn insert_workflow() {
let guid_activity = |ctx: &AnalysisContext| {
let function = ctx.function();
- if let Some(llil) = unsafe { ctx.llil_function::<llil::NonSSA<llil::RegularNonSSA>>() } {
+ // TODO: Returning RegularNonSSA means we cant modify the il (the lifting code was written just for lifted il, that needs to be fixed)
+ if let Some(llil) = unsafe { ctx.llil_function::<RegularNonSSA>() } {
cached_function_guid(&function, &llil);
}
};
- let function_meta_workflow = Workflow::new_from_copy("core.function.metaAnalysis");
+ let old_function_meta_workflow = Workflow::instance("core.function.metaAnalysis");
+ let function_meta_workflow = old_function_meta_workflow.clone("core.function.metaAnalysis");
let guid_activity = Activity::new_with_action(GUID_ACTIVITY_CONFIG, guid_activity);
function_meta_workflow
.register_activity(&guid_activity)
@@ -86,7 +88,8 @@ pub fn insert_workflow() {
function_meta_workflow.insert("core.function.runFunctionRecognizers", [GUID_ACTIVITY_NAME]);
function_meta_workflow.register().unwrap();
- let module_meta_workflow = Workflow::new_from_copy("core.module.metaAnalysis");
+ let old_module_meta_workflow = Workflow::instance("core.module.metaAnalysis");
+ let module_meta_workflow = old_module_meta_workflow.clone("core.module.metaAnalysis");
let matcher_activity = Activity::new_with_action(MATCHER_ACTIVITY_CONFIG, matcher_activity);
module_meta_workflow
.register_activity(&matcher_activity)
diff --git a/plugins/warp/src/snapshots/warp_ninja__tests__insta_signatures.snap b/plugins/warp/src/snapshots/warp_ninja__tests__insta_signatures.snap
deleted file mode 100644
index 442fce25..00000000
--- a/plugins/warp/src/snapshots/warp_ninja__tests__insta_signatures.snap
+++ /dev/null
@@ -1,39 +0,0 @@
----
-source: src/lib.rs
-expression: functions
----
-[
- FunctionGUID {
- guid: 623a8338-34d6-5a6e-8c4e-36a1a071117e,
- },
- FunctionGUID {
- guid: 6cd81a21-6967-5c90-b73e-5a810f835a84,
- },
- FunctionGUID {
- guid: 905fa3b0-3571-58ed-b81f-7cf62bdcfe49,
- },
- FunctionGUID {
- guid: 9a3e480c-5ebd-5278-8e33-4a6e982167fb,
- },
- FunctionGUID {
- guid: a25a06fb-fb60-542c-9b11-4c286dbc607b,
- },
- FunctionGUID {
- guid: b1c5fbad-2657-5231-9f7b-b15a0d3b3bb6,
- },
- FunctionGUID {
- guid: bcba7769-cc5a-5cdf-be50-d95b7a74ef60,
- },
- FunctionGUID {
- guid: dd833eb1-f99b-5c58-a289-998dba19e69a,
- },
- FunctionGUID {
- guid: f631b282-0174-5bdd-846d-c0514f2539e1,
- },
- FunctionGUID {
- guid: fa2d7ebf-d187-5592-bfc1-ee41614437b3,
- },
- FunctionGUID {
- guid: fa2d7ebf-d187-5592-bfc1-ee41614437b3,
- },
-]
diff --git a/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__ctype.snap b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__ctype.snap
new file mode 100644
index 00000000..0cda5d3a
--- /dev/null
+++ b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__ctype.snap
@@ -0,0 +1,126 @@
+---
+source: plugins/warp/src/lib.rs
+expression: functions
+---
+[
+ FunctionGUID {
+ guid: 00c71b63-3039-5aa3-94f7-1737530239d9,
+ },
+ FunctionGUID {
+ guid: 06ff982d-b167-5dce-9689-71a631820da6,
+ },
+ FunctionGUID {
+ guid: 0d6d3685-7a8a-5d1c-8b7a-fe14871218ff,
+ },
+ FunctionGUID {
+ guid: 0df54a49-5267-52f7-9665-70a8e66ad0dd,
+ },
+ FunctionGUID {
+ guid: 13b16f81-0c6f-5aee-ad9f-0d142658cf18,
+ },
+ FunctionGUID {
+ guid: 15d686e8-3e80-5632-9ce7-17c3510f8238,
+ },
+ FunctionGUID {
+ guid: 18cfce71-47bc-5595-89cb-06e0563b211d,
+ },
+ FunctionGUID {
+ guid: 1b6aa5a3-ac7f-542d-a0ab-bae8f142d8d8,
+ },
+ FunctionGUID {
+ guid: 1e794537-6289-59e7-bef9-0c72f3989db8,
+ },
+ FunctionGUID {
+ guid: 29690354-fa27-54d1-a8be-18535b19b1c3,
+ },
+ FunctionGUID {
+ guid: 33e6bc5f-eeb6-5a07-810e-f04a2dba36cf,
+ },
+ FunctionGUID {
+ guid: 3b992cd7-1721-5f30-b59c-84ea682be808,
+ },
+ FunctionGUID {
+ guid: 3ba4d0cb-9c07-5904-aafe-34e051b89be5,
+ },
+ FunctionGUID {
+ guid: 3cc2e827-b707-5c9d-82e9-d76ac3abc904,
+ },
+ FunctionGUID {
+ guid: 43a8c54b-dd4f-5334-ae00-218cb758ad4c,
+ },
+ FunctionGUID {
+ guid: 53b484f3-751a-505d-beae-acc9d69c261d,
+ },
+ FunctionGUID {
+ guid: 5b7cc78f-3b2f-5b82-9726-37c26ad087b4,
+ },
+ FunctionGUID {
+ guid: 5b7f41e9-de1e-558c-ac7d-888acca3a76c,
+ },
+ FunctionGUID {
+ guid: 6abe3fc2-6d29-5fde-a31e-bb8249db6bf9,
+ },
+ FunctionGUID {
+ guid: 6db530d1-8ea4-568e-a089-c61164851f04,
+ },
+ FunctionGUID {
+ guid: 7cae2466-6b19-5fff-869e-9a9717043df4,
+ },
+ FunctionGUID {
+ guid: 7cae2466-6b19-5fff-869e-9a9717043df4,
+ },
+ FunctionGUID {
+ guid: 7f0e055b-1e83-5f7b-a1fd-6a0a3d0b74f5,
+ },
+ FunctionGUID {
+ guid: 88d9b26b-3884-58d6-b164-435d8d888e5c,
+ },
+ FunctionGUID {
+ guid: 8a2b7bda-5fdb-5ba3-888b-20d5b8d7b2cd,
+ },
+ FunctionGUID {
+ guid: 8ff1fc25-6912-5772-8fa3-19e1b996aea7,
+ },
+ FunctionGUID {
+ guid: 951d5c60-d457-5b62-98e7-ade4a37d7cbe,
+ },
+ FunctionGUID {
+ guid: 95bf9d56-3b11-515f-960f-07abf69aed95,
+ },
+ FunctionGUID {
+ guid: 9e30f7d4-0a31-50cf-93f8-490a9e8c300b,
+ },
+ FunctionGUID {
+ guid: a7acb567-eb98-53e4-a843-5c60a8c59f19,
+ },
+ FunctionGUID {
+ guid: ae6f9d26-872c-5b6e-925e-40c0ec95c702,
+ },
+ FunctionGUID {
+ guid: b8b2746b-20aa-5ad2-bcfd-ab5448d952eb,
+ },
+ FunctionGUID {
+ guid: bc4d18a4-96d5-5322-ba99-fcee83648701,
+ },
+ FunctionGUID {
+ guid: c7bd1444-8f5c-5bc6-87c3-48f010b00455,
+ },
+ FunctionGUID {
+ guid: cacf9fe4-7518-5b22-ae3a-ab775dea4c9a,
+ },
+ FunctionGUID {
+ guid: cdb3f650-974f-5686-b81f-10b6544680f4,
+ },
+ FunctionGUID {
+ guid: d344f254-4903-581d-ad93-713c9ff2be2e,
+ },
+ FunctionGUID {
+ guid: d5456209-db22-53a1-906d-1ecb3254ab2d,
+ },
+ FunctionGUID {
+ guid: ec40932b-8293-5ffb-9d31-04c282b6530d,
+ },
+ FunctionGUID {
+ guid: faedbe75-8451-525b-83da-7a57ec96166e,
+ },
+]
diff --git a/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__fptostr.snap b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__fptostr.snap
new file mode 100644
index 00000000..5628853f
--- /dev/null
+++ b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__fptostr.snap
@@ -0,0 +1,9 @@
+---
+source: plugins/warp/src/lib.rs
+expression: functions
+---
+[
+ FunctionGUID {
+ guid: 9d4dba66-7106-5215-8e64-a47279f67dfe,
+ },
+]
diff --git a/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__mbslen.snap b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__mbslen.snap
new file mode 100644
index 00000000..01ca9ec5
--- /dev/null
+++ b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__mbslen.snap
@@ -0,0 +1,39 @@
+---
+source: plugins/warp/src/lib.rs
+expression: functions
+---
+[
+ FunctionGUID {
+ guid: 13b16f81-0c6f-5aee-ad9f-0d142658cf18,
+ },
+ FunctionGUID {
+ guid: 1e794537-6289-59e7-bef9-0c72f3989db8,
+ },
+ FunctionGUID {
+ guid: 29690354-fa27-54d1-a8be-18535b19b1c3,
+ },
+ FunctionGUID {
+ guid: 3cc2e827-b707-5c9d-82e9-d76ac3abc904,
+ },
+ FunctionGUID {
+ guid: 6a7eb6dd-be3e-50dd-ae91-cea8f3eb4f06,
+ },
+ FunctionGUID {
+ guid: 6abe3fc2-6d29-5fde-a31e-bb8249db6bf9,
+ },
+ FunctionGUID {
+ guid: 6b0d368e-83d9-55fc-9683-5812e651a49b,
+ },
+ FunctionGUID {
+ guid: 8a2b7bda-5fdb-5ba3-888b-20d5b8d7b2cd,
+ },
+ FunctionGUID {
+ guid: bfaf2f0a-d92d-5ef7-879d-86eb0ca01257,
+ },
+ FunctionGUID {
+ guid: f034945d-32e2-5d86-8a86-3761cc54f419,
+ },
+ FunctionGUID {
+ guid: f552d8ee-3064-50ed-af18-4e60f095c9ea,
+ },
+]
diff --git a/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__memicmp.snap b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__memicmp.snap
new file mode 100644
index 00000000..8f83530e
--- /dev/null
+++ b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__memicmp.snap
@@ -0,0 +1,9 @@
+---
+source: plugins/warp/src/lib.rs
+expression: functions
+---
+[
+ FunctionGUID {
+ guid: cf6e80f2-69aa-5757-a06f-fb2e4866ab14,
+ },
+]
diff --git a/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__strnicm.snap b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__strnicm.snap
new file mode 100644
index 00000000..9d661016
--- /dev/null
+++ b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__strnicm.snap
@@ -0,0 +1,9 @@
+---
+source: plugins/warp/src/lib.rs
+expression: functions
+---
+[
+ FunctionGUID {
+ guid: 7c350a2d-2282-5625-943e-009f317b8d2c,
+ },
+]
diff --git a/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__wctype.snap b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__wctype.snap
new file mode 100644
index 00000000..2d9f4e73
--- /dev/null
+++ b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot__wctype.snap
@@ -0,0 +1,117 @@
+---
+source: plugins/warp/src/lib.rs
+expression: functions
+---
+[
+ FunctionGUID {
+ guid: 0a9027e0-fc87-5f83-a9da-ea7b1eef0761,
+ },
+ FunctionGUID {
+ guid: 13b16f81-0c6f-5aee-ad9f-0d142658cf18,
+ },
+ FunctionGUID {
+ guid: 1b434f0e-26b8-539b-9679-33d96a683190,
+ },
+ FunctionGUID {
+ guid: 1b434f0e-26b8-539b-9679-33d96a683190,
+ },
+ FunctionGUID {
+ guid: 1e34d278-fd31-5cdf-98dc-395cb29419a7,
+ },
+ FunctionGUID {
+ guid: 1e34d278-fd31-5cdf-98dc-395cb29419a7,
+ },
+ FunctionGUID {
+ guid: 1e794537-6289-59e7-bef9-0c72f3989db8,
+ },
+ FunctionGUID {
+ guid: 23ba7382-bd48-5d47-a1f0-79ad5db87730,
+ },
+ FunctionGUID {
+ guid: 23ba7382-bd48-5d47-a1f0-79ad5db87730,
+ },
+ FunctionGUID {
+ guid: 29690354-fa27-54d1-a8be-18535b19b1c3,
+ },
+ FunctionGUID {
+ guid: 33ce8a60-e3fa-5941-9ca6-09707bb1f579,
+ },
+ FunctionGUID {
+ guid: 33ce8a60-e3fa-5941-9ca6-09707bb1f579,
+ },
+ FunctionGUID {
+ guid: 3cc2e827-b707-5c9d-82e9-d76ac3abc904,
+ },
+ FunctionGUID {
+ guid: 607a10c5-8943-5dec-b888-f5210f08b311,
+ },
+ FunctionGUID {
+ guid: 607a10c5-8943-5dec-b888-f5210f08b311,
+ },
+ FunctionGUID {
+ guid: 6abe3fc2-6d29-5fde-a31e-bb8249db6bf9,
+ },
+ FunctionGUID {
+ guid: 6cebba56-9929-5f3d-9dd3-fc56f8e84593,
+ },
+ FunctionGUID {
+ guid: 75b0aba8-582a-5085-abbb-cebf55d2498d,
+ },
+ FunctionGUID {
+ guid: 75b0aba8-582a-5085-abbb-cebf55d2498d,
+ },
+ FunctionGUID {
+ guid: 8a2b7bda-5fdb-5ba3-888b-20d5b8d7b2cd,
+ },
+ FunctionGUID {
+ guid: 90cb6aa0-f402-5874-ae2d-e10752ad6462,
+ },
+ FunctionGUID {
+ guid: 90cb6aa0-f402-5874-ae2d-e10752ad6462,
+ },
+ FunctionGUID {
+ guid: 9dd8ec46-e680-5fbe-b28b-30505b505fa3,
+ },
+ FunctionGUID {
+ guid: 9dd8ec46-e680-5fbe-b28b-30505b505fa3,
+ },
+ FunctionGUID {
+ guid: b08dcc9b-b766-56e0-a9af-1d24cc6c6574,
+ },
+ FunctionGUID {
+ guid: b08dcc9b-b766-56e0-a9af-1d24cc6c6574,
+ },
+ FunctionGUID {
+ guid: b098f8a1-ecdd-5938-8da3-bb37935c6b7e,
+ },
+ FunctionGUID {
+ guid: b2339a04-7dcf-5791-b74e-806220d37f56,
+ },
+ FunctionGUID {
+ guid: b2339a04-7dcf-5791-b74e-806220d37f56,
+ },
+ FunctionGUID {
+ guid: b3723a76-a709-510c-9d93-97dc42b163a3,
+ },
+ FunctionGUID {
+ guid: b3723a76-a709-510c-9d93-97dc42b163a3,
+ },
+ FunctionGUID {
+ guid: cc259c7e-0ada-5680-8ad7-b077d60bd2a1,
+ },
+ FunctionGUID {
+ guid: cc259c7e-0ada-5680-8ad7-b077d60bd2a1,
+ },
+ FunctionGUID {
+ guid: eed08c42-3616-5c27-82ad-719db5cce36e,
+ },
+ FunctionGUID {
+ guid: eed08c42-3616-5c27-82ad-719db5cce36e,
+ },
+ FunctionGUID {
+ guid: f6535880-21d4-5272-b2c0-5e63cbc208e7,
+ },
+ FunctionGUID {
+ guid: f6535880-21d4-5272-b2c0-5e63cbc208e7,
+ },
+]
diff --git a/plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atof.snap b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atof.snap
new file mode 100644
index 00000000..4ff8251c
--- /dev/null
+++ b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atof.snap
@@ -0,0 +1,390 @@
+---
+source: plugins/warp/src/lib.rs
+expression: functions
+---
+[
+ FunctionGUID {
+ guid: 02d864ef-80bc-5265-b78f-0e42815a4d1d,
+ },
+ FunctionGUID {
+ guid: 02d864ef-80bc-5265-b78f-0e42815a4d1d,
+ },
+ FunctionGUID {
+ guid: 06a9339a-7249-50f3-9c3d-131d3248d560,
+ },
+ FunctionGUID {
+ guid: 06a9339a-7249-50f3-9c3d-131d3248d560,
+ },
+ FunctionGUID {
+ guid: 06a9339a-7249-50f3-9c3d-131d3248d560,
+ },
+ FunctionGUID {
+ guid: 06a9339a-7249-50f3-9c3d-131d3248d560,
+ },
+ FunctionGUID {
+ guid: 07c4bac9-cf7d-5e00-833d-d23ba44c07d9,
+ },
+ FunctionGUID {
+ guid: 0916139e-a5db-51c8-be24-2c6fb20a9e3a,
+ },
+ FunctionGUID {
+ guid: 0c7b078d-dafb-5be7-8b10-a25b1e691b33,
+ },
+ FunctionGUID {
+ guid: 0e6feb85-ff6f-5b86-bd2c-26fb9829241c,
+ },
+ FunctionGUID {
+ guid: 0e6feb85-ff6f-5b86-bd2c-26fb9829241c,
+ },
+ FunctionGUID {
+ guid: 11592e15-a2a6-51b3-bda2-534cc0434df0,
+ },
+ FunctionGUID {
+ guid: 13b16f81-0c6f-5aee-ad9f-0d142658cf18,
+ },
+ FunctionGUID {
+ guid: 1b1669c2-4a81-5300-99f7-14cba1cc7b24,
+ },
+ FunctionGUID {
+ guid: 1b969932-96ce-5a6f-b91c-82e5f7b7f33d,
+ },
+ FunctionGUID {
+ guid: 1c037c1e-9af1-59af-b19e-122fdf885148,
+ },
+ FunctionGUID {
+ guid: 1de88f85-a19c-5454-9122-ddc80f7509b4,
+ },
+ FunctionGUID {
+ guid: 1de88f85-a19c-5454-9122-ddc80f7509b4,
+ },
+ FunctionGUID {
+ guid: 1e794537-6289-59e7-bef9-0c72f3989db8,
+ },
+ FunctionGUID {
+ guid: 1eee5e05-95ef-5f99-8713-504c2003183c,
+ },
+ FunctionGUID {
+ guid: 2833f544-9acb-552d-aa4b-df7d51dbab64,
+ },
+ FunctionGUID {
+ guid: 29690354-fa27-54d1-a8be-18535b19b1c3,
+ },
+ FunctionGUID {
+ guid: 31a8e73e-74fe-5a33-b0ab-aa1b136e021d,
+ },
+ FunctionGUID {
+ guid: 364c5864-0cd1-5527-8ca0-2378d5b4c0a5,
+ },
+ FunctionGUID {
+ guid: 3c38a678-9c4e-527a-b543-3075b345d532,
+ },
+ FunctionGUID {
+ guid: 3c38a678-9c4e-527a-b543-3075b345d532,
+ },
+ FunctionGUID {
+ guid: 3cc2e827-b707-5c9d-82e9-d76ac3abc904,
+ },
+ FunctionGUID {
+ guid: 3eb2a4c5-84f5-5687-92a0-35ef66c8b746,
+ },
+ FunctionGUID {
+ guid: 3efd6327-6038-53ed-904c-a800bee86d2e,
+ },
+ FunctionGUID {
+ guid: 40358a63-7e16-52da-9270-434c7d444b10,
+ },
+ FunctionGUID {
+ guid: 40358a63-7e16-52da-9270-434c7d444b10,
+ },
+ FunctionGUID {
+ guid: 40358a63-7e16-52da-9270-434c7d444b10,
+ },
+ FunctionGUID {
+ guid: 410b1cab-55ff-5931-a894-54842e56bee2,
+ },
+ FunctionGUID {
+ guid: 41fd6d24-0f8b-5848-9873-65b98bd370ab,
+ },
+ FunctionGUID {
+ guid: 4345609a-e619-5f33-84ca-7cc1ccdfa2d0,
+ },
+ FunctionGUID {
+ guid: 43a8c54b-dd4f-5334-ae00-218cb758ad4c,
+ },
+ FunctionGUID {
+ guid: 45770948-1c56-5b24-bd38-f5a559ae8d22,
+ },
+ FunctionGUID {
+ guid: 45770948-1c56-5b24-bd38-f5a559ae8d22,
+ },
+ FunctionGUID {
+ guid: 479b6feb-0dff-5c33-8f30-fd0c563b9abc,
+ },
+ FunctionGUID {
+ guid: 4b60a419-4ad1-5808-b41f-d341868c9234,
+ },
+ FunctionGUID {
+ guid: 4ba8a311-60f3-57d4-a17a-c0cc93f5c2a4,
+ },
+ FunctionGUID {
+ guid: 4f0bdeb9-691c-52f8-8541-6c834f3fbe64,
+ },
+ FunctionGUID {
+ guid: 4f645f3c-3e89-5b5d-a185-9f1a25e94ed2,
+ },
+ FunctionGUID {
+ guid: 52b2a610-5304-5e4f-8b79-9b975e9efb86,
+ },
+ FunctionGUID {
+ guid: 53b484f3-751a-505d-beae-acc9d69c261d,
+ },
+ FunctionGUID {
+ guid: 53b484f3-751a-505d-beae-acc9d69c261d,
+ },
+ FunctionGUID {
+ guid: 56c82b1f-380c-52fe-ae70-a39962e5ffdc,
+ },
+ FunctionGUID {
+ guid: 5779439c-a22f-5d33-8868-4e1832ad49e9,
+ },
+ FunctionGUID {
+ guid: 5b55a8c8-1d3a-5825-a0d9-917f434e07af,
+ },
+ FunctionGUID {
+ guid: 5b7f41e9-de1e-558c-ac7d-888acca3a76c,
+ },
+ FunctionGUID {
+ guid: 65be15d9-ef02-58a4-af63-b40ddb3e56b7,
+ },
+ FunctionGUID {
+ guid: 669a32f2-f1e9-5b38-98aa-9eb8431ebc4e,
+ },
+ FunctionGUID {
+ guid: 6abe3fc2-6d29-5fde-a31e-bb8249db6bf9,
+ },
+ FunctionGUID {
+ guid: 6c01cd47-89a2-59f3-ac6a-cd7806fb8f79,
+ },
+ FunctionGUID {
+ guid: 72452dc5-da9c-54fc-82de-032aab1780a4,
+ },
+ FunctionGUID {
+ guid: 7995ca73-04fe-5b30-9e88-1e69197007c1,
+ },
+ FunctionGUID {
+ guid: 7995ca73-04fe-5b30-9e88-1e69197007c1,
+ },
+ FunctionGUID {
+ guid: 7c43c697-22ef-57a9-a43a-2214e627749d,
+ },
+ FunctionGUID {
+ guid: 7cbd1cef-0134-5a29-a8c6-82697f5717fe,
+ },
+ FunctionGUID {
+ guid: 7d4d1429-5fef-5c8b-9074-93e9d97ab57e,
+ },
+ FunctionGUID {
+ guid: 82e98c80-859c-5ab3-83ab-b597fc520a3f,
+ },
+ FunctionGUID {
+ guid: 84429ba2-9f72-585f-8cda-31e8ef4983fd,
+ },
+ FunctionGUID {
+ guid: 86ab6ab4-45e5-5c08-9a47-05344ea503ab,
+ },
+ FunctionGUID {
+ guid: 86ab6ab4-45e5-5c08-9a47-05344ea503ab,
+ },
+ FunctionGUID {
+ guid: 87371a48-38c9-5e0e-81db-5e2d6da49202,
+ },
+ FunctionGUID {
+ guid: 879b1d59-7301-5cb7-911e-db05292bee8f,
+ },
+ FunctionGUID {
+ guid: 88d9b26b-3884-58d6-b164-435d8d888e5c,
+ },
+ FunctionGUID {
+ guid: 89f0e45b-c1f6-5aeb-94a8-26e72bb66e6c,
+ },
+ FunctionGUID {
+ guid: 8a2b7bda-5fdb-5ba3-888b-20d5b8d7b2cd,
+ },
+ FunctionGUID {
+ guid: 8c736b66-b63f-5000-a060-2e60a1b8952a,
+ },
+ FunctionGUID {
+ guid: 8c736b66-b63f-5000-a060-2e60a1b8952a,
+ },
+ FunctionGUID {
+ guid: 8c736b66-b63f-5000-a060-2e60a1b8952a,
+ },
+ FunctionGUID {
+ guid: 8dca0c9d-bdb7-56a1-9832-431aec16a68f,
+ },
+ FunctionGUID {
+ guid: 9a9e3287-e407-5526-885b-1b5ee78a5300,
+ },
+ FunctionGUID {
+ guid: 9e4c3806-b291-569c-a687-0bcaa48e248b,
+ },
+ FunctionGUID {
+ guid: 9ef21651-3eaf-5940-8e72-104bda834e85,
+ },
+ FunctionGUID {
+ guid: a0c07bfa-a027-5c19-9da4-d2d35d7beb40,
+ },
+ FunctionGUID {
+ guid: a0c07bfa-a027-5c19-9da4-d2d35d7beb40,
+ },
+ FunctionGUID {
+ guid: a23505e4-e7cd-5543-897c-46b97c1eaef3,
+ },
+ FunctionGUID {
+ guid: a482559e-6a69-505e-b692-147deeced692,
+ },
+ FunctionGUID {
+ guid: a482559e-6a69-505e-b692-147deeced692,
+ },
+ FunctionGUID {
+ guid: a5b947d4-a7e0-5072-86b3-240474c16595,
+ },
+ FunctionGUID {
+ guid: a603d813-2b33-567d-80c8-06e31562a400,
+ },
+ FunctionGUID {
+ guid: a707a2d3-c7d2-5b93-97c9-1db77d8ccfe5,
+ },
+ FunctionGUID {
+ guid: a707a2d3-c7d2-5b93-97c9-1db77d8ccfe5,
+ },
+ FunctionGUID {
+ guid: a707a2d3-c7d2-5b93-97c9-1db77d8ccfe5,
+ },
+ FunctionGUID {
+ guid: a707a2d3-c7d2-5b93-97c9-1db77d8ccfe5,
+ },
+ FunctionGUID {
+ guid: a707a2d3-c7d2-5b93-97c9-1db77d8ccfe5,
+ },
+ FunctionGUID {
+ guid: a707a2d3-c7d2-5b93-97c9-1db77d8ccfe5,
+ },
+ FunctionGUID {
+ guid: adadfe23-cb3f-5c9f-ae8d-1dd2fd922367,
+ },
+ FunctionGUID {
+ guid: b098f8a1-ecdd-5938-8da3-bb37935c6b7e,
+ },
+ FunctionGUID {
+ guid: b098f8a1-ecdd-5938-8da3-bb37935c6b7e,
+ },
+ FunctionGUID {
+ guid: b0aca296-adc3-5b46-a6b1-e82ef2100ead,
+ },
+ FunctionGUID {
+ guid: b9111cf4-dcff-52a5-8755-2dedea6d5c72,
+ },
+ FunctionGUID {
+ guid: bbb9b018-a0cd-5f98-b941-367f8707434d,
+ },
+ FunctionGUID {
+ guid: bbb9b018-a0cd-5f98-b941-367f8707434d,
+ },
+ FunctionGUID {
+ guid: bfaf2f0a-d92d-5ef7-879d-86eb0ca01257,
+ },
+ FunctionGUID {
+ guid: bfaf2f0a-d92d-5ef7-879d-86eb0ca01257,
+ },
+ FunctionGUID {
+ guid: c3842e85-b9f2-54d5-b353-e9bb2a0b1203,
+ },
+ FunctionGUID {
+ guid: c3842e85-b9f2-54d5-b353-e9bb2a0b1203,
+ },
+ FunctionGUID {
+ guid: c44bdef1-d78a-57ec-bff5-4e7d32ff4337,
+ },
+ FunctionGUID {
+ guid: c71f4559-f0af-54dc-a224-e1f341311988,
+ },
+ FunctionGUID {
+ guid: c71f4559-f0af-54dc-a224-e1f341311988,
+ },
+ FunctionGUID {
+ guid: c74ed160-24fe-50d7-ba1c-9751c4599420,
+ },
+ FunctionGUID {
+ guid: ccbd9943-6b24-59d8-ae4d-3ee868a2729c,
+ },
+ FunctionGUID {
+ guid: ccbd9943-6b24-59d8-ae4d-3ee868a2729c,
+ },
+ FunctionGUID {
+ guid: ce28e080-0609-5bcd-abe1-2a6e57c91f83,
+ },
+ FunctionGUID {
+ guid: ce28e080-0609-5bcd-abe1-2a6e57c91f83,
+ },
+ FunctionGUID {
+ guid: ce28e080-0609-5bcd-abe1-2a6e57c91f83,
+ },
+ FunctionGUID {
+ guid: cf4808fe-2fea-517d-8f85-f88ddc96cc78,
+ },
+ FunctionGUID {
+ guid: cf4808fe-2fea-517d-8f85-f88ddc96cc78,
+ },
+ FunctionGUID {
+ guid: cfa4374b-0fc7-575d-9ba1-4a37d2de0406,
+ },
+ FunctionGUID {
+ guid: d72f40b9-0557-5695-aa4d-468515ec4b8e,
+ },
+ FunctionGUID {
+ guid: d8ba616a-1747-587c-9265-cd4e26ae35c8,
+ },
+ FunctionGUID {
+ guid: db957206-4cca-5631-893d-1d3dc500c804,
+ },
+ FunctionGUID {
+ guid: dd480d6b-04f7-5fb2-a7b2-236e1d78b2b0,
+ },
+ FunctionGUID {
+ guid: e1b1e1df-fdb9-59d6-b966-5b7f926b5649,
+ },
+ FunctionGUID {
+ guid: e480dd82-0b7d-5c75-ac67-ba8c0bb755cb,
+ },
+ FunctionGUID {
+ guid: e4ba95bb-0221-5dbd-9884-13a39c4f9d55,
+ },
+ FunctionGUID {
+ guid: e8290b3d-cf56-5c1b-8315-abce0f135559,
+ },
+ FunctionGUID {
+ guid: e8290b3d-cf56-5c1b-8315-abce0f135559,
+ },
+ FunctionGUID {
+ guid: ecca9a9d-1722-5344-b68f-54f4527c0d78,
+ },
+ FunctionGUID {
+ guid: ed23805d-3729-590d-83a3-3b0803a56870,
+ },
+ FunctionGUID {
+ guid: eefbc8a9-f4f1-5725-9a4f-9dcd04ea3478,
+ },
+ FunctionGUID {
+ guid: f37337a6-4cf0-55b4-a0da-25a15e3d9bcb,
+ },
+ FunctionGUID {
+ guid: f37cf37b-b19d-5575-b2c7-a6604d3faa69,
+ },
+ FunctionGUID {
+ guid: f3d57592-4cb1-5356-9591-1f9327c58565,
+ },
+ FunctionGUID {
+ guid: fb20fa7c-c796-58e4-a2f9-7a128baaf5b1,
+ },
+]
diff --git a/plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atoldbl.snap b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atoldbl.snap
new file mode 100644
index 00000000..5dc305cc
--- /dev/null
+++ b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atoldbl.snap
@@ -0,0 +1,192 @@
+---
+source: plugins/warp/src/lib.rs
+expression: functions
+---
+[
+ FunctionGUID {
+ guid: 02d864ef-80bc-5265-b78f-0e42815a4d1d,
+ },
+ FunctionGUID {
+ guid: 07b3f23f-333b-5c13-873f-5f1973cee8e2,
+ },
+ FunctionGUID {
+ guid: 13b16f81-0c6f-5aee-ad9f-0d142658cf18,
+ },
+ FunctionGUID {
+ guid: 1de88f85-a19c-5454-9122-ddc80f7509b4,
+ },
+ FunctionGUID {
+ guid: 1e794537-6289-59e7-bef9-0c72f3989db8,
+ },
+ FunctionGUID {
+ guid: 22c32840-7bb0-5d80-858c-55dd04553db0,
+ },
+ FunctionGUID {
+ guid: 29690354-fa27-54d1-a8be-18535b19b1c3,
+ },
+ FunctionGUID {
+ guid: 29690354-fa27-54d1-a8be-18535b19b1c3,
+ },
+ FunctionGUID {
+ guid: 30f44555-ef86-5e85-96c3-6153f4bcc11e,
+ },
+ FunctionGUID {
+ guid: 364c5864-0cd1-5527-8ca0-2378d5b4c0a5,
+ },
+ FunctionGUID {
+ guid: 39cd0d51-d688-58e2-a757-ac868ff8635e,
+ },
+ FunctionGUID {
+ guid: 3c83a5f5-215d-5d25-97c8-ffe65f73907c,
+ },
+ FunctionGUID {
+ guid: 3cc2e827-b707-5c9d-82e9-d76ac3abc904,
+ },
+ FunctionGUID {
+ guid: 41fd6d24-0f8b-5848-9873-65b98bd370ab,
+ },
+ FunctionGUID {
+ guid: 43a8c54b-dd4f-5334-ae00-218cb758ad4c,
+ },
+ FunctionGUID {
+ guid: 45770948-1c56-5b24-bd38-f5a559ae8d22,
+ },
+ FunctionGUID {
+ guid: 4738dcb9-abab-5157-baef-8edf38d9fabc,
+ },
+ FunctionGUID {
+ guid: 48551d5f-2e1f-557b-85a3-a122d3ce07cf,
+ },
+ FunctionGUID {
+ guid: 4ba8a311-60f3-57d4-a17a-c0cc93f5c2a4,
+ },
+ FunctionGUID {
+ guid: 4f645f3c-3e89-5b5d-a185-9f1a25e94ed2,
+ },
+ FunctionGUID {
+ guid: 5779439c-a22f-5d33-8868-4e1832ad49e9,
+ },
+ FunctionGUID {
+ guid: 5b7f41e9-de1e-558c-ac7d-888acca3a76c,
+ },
+ FunctionGUID {
+ guid: 61d32a04-c077-5985-b241-c326dd5b1864,
+ },
+ FunctionGUID {
+ guid: 6444ff14-38c5-520e-b9e3-6e3ae15215c4,
+ },
+ FunctionGUID {
+ guid: 6589669f-6b11-569e-9adf-ca3c6d6bc62e,
+ },
+ FunctionGUID {
+ guid: 6590d978-d2b0-510c-b5a6-a81361800609,
+ },
+ FunctionGUID {
+ guid: 67f303c6-d2e4-55e1-8a5f-5492da69e69f,
+ },
+ FunctionGUID {
+ guid: 6abe3fc2-6d29-5fde-a31e-bb8249db6bf9,
+ },
+ FunctionGUID {
+ guid: 6ef93fa8-909e-596c-9454-74b89e8cabb7,
+ },
+ FunctionGUID {
+ guid: 7995ca73-04fe-5b30-9e88-1e69197007c1,
+ },
+ FunctionGUID {
+ guid: 7c43c697-22ef-57a9-a43a-2214e627749d,
+ },
+ FunctionGUID {
+ guid: 86ab6ab4-45e5-5c08-9a47-05344ea503ab,
+ },
+ FunctionGUID {
+ guid: 88d9b26b-3884-58d6-b164-435d8d888e5c,
+ },
+ FunctionGUID {
+ guid: 8a2b7bda-5fdb-5ba3-888b-20d5b8d7b2cd,
+ },
+ FunctionGUID {
+ guid: 8c736b66-b63f-5000-a060-2e60a1b8952a,
+ },
+ FunctionGUID {
+ guid: 8c736b66-b63f-5000-a060-2e60a1b8952a,
+ },
+ FunctionGUID {
+ guid: 8c736b66-b63f-5000-a060-2e60a1b8952a,
+ },
+ FunctionGUID {
+ guid: 8ccf8b37-65c5-525a-b96a-64f26d711c75,
+ },
+ FunctionGUID {
+ guid: 9676fc90-ecba-595b-8d24-5df4e66ac683,
+ },
+ FunctionGUID {
+ guid: 9891b84c-000b-529a-8c5b-d762120eff9d,
+ },
+ FunctionGUID {
+ guid: a030f6f1-e29b-5e4a-8f83-56e6c6c51c15,
+ },
+ FunctionGUID {
+ guid: a23505e4-e7cd-5543-897c-46b97c1eaef3,
+ },
+ FunctionGUID {
+ guid: a45d9322-0d45-5dc9-b17b-32b843416c4b,
+ },
+ FunctionGUID {
+ guid: a482559e-6a69-505e-b692-147deeced692,
+ },
+ FunctionGUID {
+ guid: a603d813-2b33-567d-80c8-06e31562a400,
+ },
+ FunctionGUID {
+ guid: a707a2d3-c7d2-5b93-97c9-1db77d8ccfe5,
+ },
+ FunctionGUID {
+ guid: a707a2d3-c7d2-5b93-97c9-1db77d8ccfe5,
+ },
+ FunctionGUID {
+ guid: a707a2d3-c7d2-5b93-97c9-1db77d8ccfe5,
+ },
+ FunctionGUID {
+ guid: b9e4b6b0-47c3-54ca-9a01-56916ea0db8e,
+ },
+ FunctionGUID {
+ guid: bae57993-863a-5c22-b8bb-92b862148af3,
+ },
+ FunctionGUID {
+ guid: bfaf2f0a-d92d-5ef7-879d-86eb0ca01257,
+ },
+ FunctionGUID {
+ guid: c3842e85-b9f2-54d5-b353-e9bb2a0b1203,
+ },
+ FunctionGUID {
+ guid: c5766cb0-afbc-5701-ad2f-23d980f4bc15,
+ },
+ FunctionGUID {
+ guid: cb8ebff6-30e8-5a8a-9c1b-ec5f26041d65,
+ },
+ FunctionGUID {
+ guid: ccbd9943-6b24-59d8-ae4d-3ee868a2729c,
+ },
+ FunctionGUID {
+ guid: ce28e080-0609-5bcd-abe1-2a6e57c91f83,
+ },
+ FunctionGUID {
+ guid: cf4808fe-2fea-517d-8f85-f88ddc96cc78,
+ },
+ FunctionGUID {
+ guid: e3b83b64-6ba1-5fe5-97da-5db987d79b07,
+ },
+ FunctionGUID {
+ guid: eefbc8a9-f4f1-5725-9a4f-9dcd04ea3478,
+ },
+ FunctionGUID {
+ guid: efcd394f-9201-57f7-aa2d-fc89ad355326,
+ },
+ FunctionGUID {
+ guid: efcd394f-9201-57f7-aa2d-fc89ad355326,
+ },
+ FunctionGUID {
+ guid: f25e7750-c61c-5ed8-a43d-959c3ba3a5b4,
+ },
+]
diff --git a/plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atox.snap b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atox.snap
new file mode 100644
index 00000000..c9960a24
--- /dev/null
+++ b/plugins/warp/src/snapshots/warp_ninja__tests__snapshot_atox.snap
@@ -0,0 +1,186 @@
+---
+source: plugins/warp/src/lib.rs
+expression: functions
+---
+[
+ FunctionGUID {
+ guid: 0244fa6b-6425-5aa9-ad87-2378cc4992e7,
+ },
+ FunctionGUID {
+ guid: 02d864ef-80bc-5265-b78f-0e42815a4d1d,
+ },
+ FunctionGUID {
+ guid: 02d864ef-80bc-5265-b78f-0e42815a4d1d,
+ },
+ FunctionGUID {
+ guid: 067d6811-472a-5e4a-b65f-3760df0b7bd5,
+ },
+ FunctionGUID {
+ guid: 0916139e-a5db-51c8-be24-2c6fb20a9e3a,
+ },
+ FunctionGUID {
+ guid: 13b16f81-0c6f-5aee-ad9f-0d142658cf18,
+ },
+ FunctionGUID {
+ guid: 1de88f85-a19c-5454-9122-ddc80f7509b4,
+ },
+ FunctionGUID {
+ guid: 1de88f85-a19c-5454-9122-ddc80f7509b4,
+ },
+ FunctionGUID {
+ guid: 1e794537-6289-59e7-bef9-0c72f3989db8,
+ },
+ FunctionGUID {
+ guid: 283e5e36-a239-5f0c-8937-f48a4b1d86e0,
+ },
+ FunctionGUID {
+ guid: 29690354-fa27-54d1-a8be-18535b19b1c3,
+ },
+ FunctionGUID {
+ guid: 31a8e73e-74fe-5a33-b0ab-aa1b136e021d,
+ },
+ FunctionGUID {
+ guid: 33717d5d-a15f-5c10-bc4a-d85cce963aca,
+ },
+ FunctionGUID {
+ guid: 39d556f9-435a-5105-b56c-6558ddc63fc0,
+ },
+ FunctionGUID {
+ guid: 3cc2e827-b707-5c9d-82e9-d76ac3abc904,
+ },
+ FunctionGUID {
+ guid: 3f9f8782-0b8c-5843-8b1d-831a1ef9b024,
+ },
+ FunctionGUID {
+ guid: 3f9f8782-0b8c-5843-8b1d-831a1ef9b024,
+ },
+ FunctionGUID {
+ guid: 3f9f8782-0b8c-5843-8b1d-831a1ef9b024,
+ },
+ FunctionGUID {
+ guid: 3f9f8782-0b8c-5843-8b1d-831a1ef9b024,
+ },
+ FunctionGUID {
+ guid: 43a8c54b-dd4f-5334-ae00-218cb758ad4c,
+ },
+ FunctionGUID {
+ guid: 46eae5e0-61e2-5316-9e4d-030dd2240567,
+ },
+ FunctionGUID {
+ guid: 4ba8a311-60f3-57d4-a17a-c0cc93f5c2a4,
+ },
+ FunctionGUID {
+ guid: 56c82b1f-380c-52fe-ae70-a39962e5ffdc,
+ },
+ FunctionGUID {
+ guid: 5779439c-a22f-5d33-8868-4e1832ad49e9,
+ },
+ FunctionGUID {
+ guid: 580affd8-2657-50b2-9b65-3327422894de,
+ },
+ FunctionGUID {
+ guid: 580affd8-2657-50b2-9b65-3327422894de,
+ },
+ FunctionGUID {
+ guid: 580affd8-2657-50b2-9b65-3327422894de,
+ },
+ FunctionGUID {
+ guid: 580affd8-2657-50b2-9b65-3327422894de,
+ },
+ FunctionGUID {
+ guid: 580affd8-2657-50b2-9b65-3327422894de,
+ },
+ FunctionGUID {
+ guid: 580affd8-2657-50b2-9b65-3327422894de,
+ },
+ FunctionGUID {
+ guid: 580affd8-2657-50b2-9b65-3327422894de,
+ },
+ FunctionGUID {
+ guid: 580affd8-2657-50b2-9b65-3327422894de,
+ },
+ FunctionGUID {
+ guid: 5b7f41e9-de1e-558c-ac7d-888acca3a76c,
+ },
+ FunctionGUID {
+ guid: 65cb411a-0ae9-546f-9293-3abaa3fd1c31,
+ },
+ FunctionGUID {
+ guid: 6abe3fc2-6d29-5fde-a31e-bb8249db6bf9,
+ },
+ FunctionGUID {
+ guid: 7995ca73-04fe-5b30-9e88-1e69197007c1,
+ },
+ FunctionGUID {
+ guid: 7995ca73-04fe-5b30-9e88-1e69197007c1,
+ },
+ FunctionGUID {
+ guid: 88d9b26b-3884-58d6-b164-435d8d888e5c,
+ },
+ FunctionGUID {
+ guid: 8a2b7bda-5fdb-5ba3-888b-20d5b8d7b2cd,
+ },
+ FunctionGUID {
+ guid: 9ef21651-3eaf-5940-8e72-104bda834e85,
+ },
+ FunctionGUID {
+ guid: a23505e4-e7cd-5543-897c-46b97c1eaef3,
+ },
+ FunctionGUID {
+ guid: a482559e-6a69-505e-b692-147deeced692,
+ },
+ FunctionGUID {
+ guid: a482559e-6a69-505e-b692-147deeced692,
+ },
+ FunctionGUID {
+ guid: a603d813-2b33-567d-80c8-06e31562a400,
+ },
+ FunctionGUID {
+ guid: a8a9d162-b637-5ce6-82f8-a8ac0fb740dc,
+ },
+ FunctionGUID {
+ guid: bdf90a04-d375-59b1-8a92-b962b3f914ae,
+ },
+ FunctionGUID {
+ guid: bdf90a04-d375-59b1-8a92-b962b3f914ae,
+ },
+ FunctionGUID {
+ guid: bdf90a04-d375-59b1-8a92-b962b3f914ae,
+ },
+ FunctionGUID {
+ guid: bdf90a04-d375-59b1-8a92-b962b3f914ae,
+ },
+ FunctionGUID {
+ guid: bdf90a04-d375-59b1-8a92-b962b3f914ae,
+ },
+ FunctionGUID {
+ guid: bdf90a04-d375-59b1-8a92-b962b3f914ae,
+ },
+ FunctionGUID {
+ guid: bdf90a04-d375-59b1-8a92-b962b3f914ae,
+ },
+ FunctionGUID {
+ guid: bdf90a04-d375-59b1-8a92-b962b3f914ae,
+ },
+ FunctionGUID {
+ guid: c3842e85-b9f2-54d5-b353-e9bb2a0b1203,
+ },
+ FunctionGUID {
+ guid: c3842e85-b9f2-54d5-b353-e9bb2a0b1203,
+ },
+ FunctionGUID {
+ guid: c66dd704-899b-5d58-9d4a-136063f5f552,
+ },
+ FunctionGUID {
+ guid: ccbd9943-6b24-59d8-ae4d-3ee868a2729c,
+ },
+ FunctionGUID {
+ guid: ccbd9943-6b24-59d8-ae4d-3ee868a2729c,
+ },
+ FunctionGUID {
+ guid: f674b84a-7a05-5ca0-aac4-5b5598683087,
+ },
+ FunctionGUID {
+ guid: f762c527-0674-52ce-b59f-49bf4e13d878,
+ },
+]