diff --git a/rust/src/function.rs b/rust/src/function.rs index 5d48474d6..20704e7fa 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -310,6 +310,16 @@ impl Function { Ok(unsafe { mlil::MediumLevelILFunction::ref_from_raw(mlil) }) } + pub fn mapped_medium_level_il_if_available( + &self, + ) -> Result, ()> { + let mlil = unsafe { BNGetFunctionMappedMediumLevelILIfAvailable(self.handle) }; + if mlil.is_null() { + return Err(()); + } + Ok(unsafe { mlil::MediumLevelILFunction::ref_from_raw(mlil) }) + } + pub fn medium_level_il(&self) -> Result, ()> { unsafe { let mlil = BNGetFunctionMediumLevelIL(self.handle);