Skip to content

Commit

Permalink
add Function::mapped_medium_level_il_if_available method
Browse files Browse the repository at this point in the history
  • Loading branch information
rbran committed May 14, 2024
1 parent 6664c9d commit 6504791
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rust/src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,16 @@ impl Function {
Ok(unsafe { mlil::MediumLevelILFunction::ref_from_raw(mlil) })
}

pub fn mapped_medium_level_il_if_available(
&self,
) -> Result<Ref<mlil::MediumLevelILFunction>, ()> {
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<Ref<mlil::MediumLevelILFunction>, ()> {
unsafe {
let mlil = BNGetFunctionMediumLevelIL(self.handle);
Expand Down

0 comments on commit 6504791

Please sign in to comment.