From 7d4e905c07b6798255ea9de7fec8634f8e4dbfad Mon Sep 17 00:00:00 2001 From: gerard Date: Mon, 8 Jun 2026 12:57:22 +0200 Subject: Port get_ssa_memory_definition to rust --- rust/src/low_level_il/function.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 LowLevelILFunction { } Some(value.into()) } + + + /// Returns the instruction that defines the given SSA Mem register. + #[must_use] + pub fn get_ssa_memory_definition( + &self, + index: usize + ) -> Option> { + use binaryninjacore_sys::BNGetLowLevelILSSAMemoryDefinition; + let instr_idx = unsafe { + BNGetLowLevelILSSAMemoryDefinition(self.handle, index) + }; + self.instruction_from_index(LowLevelInstructionIndex(instr_idx)) + } } impl ToOwned for LowLevelILFunction -- cgit v1.3.1