From 7e32ee8b629e3e4f8d061cbe0729ff961b3502d7 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sat, 10 May 2025 19:24:35 -0400 Subject: [Rust] Remove `NonSSAVariant` bound from `LowLevelILFunction` We don't do enough with the lifted il != non lifted il to justify the bound. This makes modifying IL much less work as the historical lifted il bound is gone. --- plugins/warp/src/lib.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'plugins/warp/src/lib.rs') diff --git a/plugins/warp/src/lib.rs b/plugins/warp/src/lib.rs index 3d68b402..62af0102 100644 --- a/plugins/warp/src/lib.rs +++ b/plugins/warp/src/lib.rs @@ -10,9 +10,7 @@ use binaryninja::binary_view::BinaryViewExt; use binaryninja::confidence::MAX_CONFIDENCE; use binaryninja::function::{Function as BNFunction, NativeBlock}; use binaryninja::low_level_il::expression::{ExpressionHandler, LowLevelILExpressionKind}; -use binaryninja::low_level_il::function::{ - FunctionMutability, LowLevelILFunction, NonSSA, RegularNonSSA, -}; +use binaryninja::low_level_il::function::{FunctionMutability, LowLevelILFunction, NonSSA}; use binaryninja::low_level_il::instruction::{ InstructionHandler, LowLevelILInstruction, LowLevelILInstructionKind, }; @@ -46,7 +44,7 @@ pub fn user_signature_dir() -> PathBuf { pub fn build_function( func: &BNFunction, - llil: &LowLevelILFunction>, + llil: &LowLevelILFunction, ) -> Function { let bn_fn_ty = func.function_type(); Function { @@ -78,7 +76,7 @@ pub fn sorted_basic_blocks(func: &BNFunction) -> Vec( func: &BNFunction, - llil: &LowLevelILFunction>, + llil: &LowLevelILFunction, ) -> FunctionGUID { let basic_blocks = sorted_basic_blocks(func); let basic_block_guids = basic_blocks @@ -90,7 +88,7 @@ pub fn function_guid( pub fn basic_block_guid( basic_block: &BNBasicBlock, - llil: &LowLevelILFunction>, + llil: &LowLevelILFunction, ) -> BasicBlockGUID { let func = basic_block.function(); let view = func.view(); @@ -98,7 +96,7 @@ pub fn basic_block_guid( 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: &LowLevelILInstruction>| { + let is_blacklisted_instr = |instr: &LowLevelILInstruction| { match instr.kind() { LowLevelILInstructionKind::Nop(_) => true, LowLevelILInstructionKind::SetReg(op) => { @@ -126,8 +124,8 @@ pub fn basic_block_guid( } }; - let is_variant_instr = |instr: &LowLevelILInstruction>| { - let is_variant_expr = |expr: &LowLevelILExpressionKind>| { + let is_variant_instr = |instr: &LowLevelILInstruction| { + let is_variant_expr = |expr: &LowLevelILExpressionKind| { // TODO: Checking the section here is slow, we should gather all section ranges outside of this. match expr { LowLevelILExpressionKind::ConstPtr(op) -- cgit v1.3.1