diff options
| author | Michael Krasnitski <michael.krasnitski@gmail.com> | 2024-03-20 14:57:23 -0400 |
|---|---|---|
| committer | Kyle Martin <krm504@nyu.edu> | 2024-04-09 12:19:40 -0400 |
| commit | a6b48153b64a227c3492d77a96e679b8c469034c (patch) | |
| tree | 1eff372ed5dad25d5437ff9a0e7d044b8892ff28 /rust/src/hlil | |
| parent | 111be980e6578e3799ded8e685ae7158027bfe55 (diff) | |
Add index field to IL instructions
Diffstat (limited to 'rust/src/hlil')
| -rw-r--r-- | rust/src/hlil/instruction.rs | 7 | ||||
| -rw-r--r-- | rust/src/hlil/lift.rs | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/rust/src/hlil/instruction.rs b/rust/src/hlil/instruction.rs index 159652f1..9bffadaf 100644 --- a/rust/src/hlil/instruction.rs +++ b/rust/src/hlil/instruction.rs @@ -15,6 +15,7 @@ use super::{HighLevelILFunction, HighLevelILLiftedInstruction, HighLevelILLifted pub struct HighLevelILInstruction { pub function: Ref<HighLevelILFunction>, pub address: u64, + pub index: usize, pub kind: HighLevelILInstructionKind, } @@ -144,8 +145,8 @@ pub enum HighLevelILInstructionKind { DoWhileSsa(WhileSsa), } impl HighLevelILInstruction { - pub(crate) fn new(function: Ref<HighLevelILFunction>, idx: usize) -> Self { - let op = unsafe { BNGetHighLevelILByIndex(function.handle, idx, function.full_ast) }; + pub(crate) fn new(function: Ref<HighLevelILFunction>, index: usize) -> Self { + let op = unsafe { BNGetHighLevelILByIndex(function.handle, index, function.full_ast) }; use BNHighLevelILOperation::*; use HighLevelILInstructionKind as Op; let kind = match op.operation { @@ -627,6 +628,7 @@ impl HighLevelILInstruction { Self { function, address: op.address, + index, kind, } } @@ -875,6 +877,7 @@ impl HighLevelILInstruction { HighLevelILLiftedInstruction { function: self.function.clone(), address: self.address, + index: self.index, kind, } } diff --git a/rust/src/hlil/lift.rs b/rust/src/hlil/lift.rs index 20f8800b..74ae0c64 100644 --- a/rust/src/hlil/lift.rs +++ b/rust/src/hlil/lift.rs @@ -23,6 +23,7 @@ pub enum HighLevelILLiftedOperand { pub struct HighLevelILLiftedInstruction { pub function: Ref<HighLevelILFunction>, pub address: u64, + pub index: usize, pub kind: HighLevelILLiftedInstructionKind, } |
