From f193132145f62cac0ffeebc3ff918ebf9dd37103 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Fri, 26 Apr 2024 18:25:36 -0400 Subject: Add MLIL APIs for getting by instruction index, and expose the operation size in the Rust API --- rust/src/mlil/instruction.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'rust/src/mlil/instruction.rs') diff --git a/rust/src/mlil/instruction.rs b/rust/src/mlil/instruction.rs index 3b5dcfb4..bd2cc717 100644 --- a/rust/src/mlil/instruction.rs +++ b/rust/src/mlil/instruction.rs @@ -18,6 +18,7 @@ pub struct MediumLevelILInstruction { pub function: Ref, pub address: u64, pub index: usize, + pub size: usize, pub kind: MediumLevelILInstructionKind, } @@ -704,7 +705,12 @@ impl MediumLevelILInstruction { }), // translated directly into a list for Expression or Variables // TODO MLIL_MEMORY_INTRINSIC_SSA needs to be handled properly - MLIL_CALL_OUTPUT | MLIL_CALL_PARAM | MLIL_CALL_PARAM_SSA | MLIL_CALL_OUTPUT_SSA | MLIL_MEMORY_INTRINSIC_OUTPUT_SSA | MLIL_MEMORY_INTRINSIC_SSA => { + MLIL_CALL_OUTPUT + | MLIL_CALL_PARAM + | MLIL_CALL_PARAM_SSA + | MLIL_CALL_OUTPUT_SSA + | MLIL_MEMORY_INTRINSIC_OUTPUT_SSA + | MLIL_MEMORY_INTRINSIC_SSA => { unreachable!() } }; @@ -713,6 +719,7 @@ impl MediumLevelILInstruction { function, address: op.address, index, + size: op.size, kind, } } @@ -1022,6 +1029,7 @@ impl MediumLevelILInstruction { function: self.function.clone(), address: self.address, index: self.index, + size: self.size, kind, } } -- cgit v1.3.1