summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rust/src/low_level_il/function.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/rust/src/low_level_il/function.rs b/rust/src/low_level_il/function.rs
index a0db838b..d4cd88cf 100644
--- a/rust/src/low_level_il/function.rs
+++ b/rust/src/low_level_il/function.rs
@@ -375,6 +375,20 @@ impl<M: FunctionMutability> LowLevelILFunction<M, SSA> {
}
Some(value.into())
}
+
+
+ /// Returns the instruction that defines the given SSA Mem register.
+ #[must_use]
+ pub fn get_ssa_memory_definition<R: ArchReg>(
+ &self,
+ index: usize
+ ) -> Option<LowLevelILInstruction<'_, M, SSA>> {
+ use binaryninjacore_sys::BNGetLowLevelILSSAMemoryDefinition;
+ let instr_idx = unsafe {
+ BNGetLowLevelILSSAMemoryDefinition(self.handle, index)
+ };
+ self.instruction_from_index(LowLevelInstructionIndex(instr_idx))
+ }
}
impl<M, F> ToOwned for LowLevelILFunction<M, F>