summaryrefslogtreecommitdiff
path: root/rust/src/low_level_il/function.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/low_level_il/function.rs')
-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 32e1f921..a0db838b 100644
--- a/rust/src/low_level_il/function.rs
+++ b/rust/src/low_level_il/function.rs
@@ -209,6 +209,20 @@ where
Some(unsafe { BasicBlock::ref_from_raw(block, LowLevelILBlock { function: self }) })
}
}
+
+ pub fn set_indirect_branches(&self, branches: &[Location]) {
+ let mut bn_branches: Box<[BNArchitectureAndAddress]> = branches
+ .iter()
+ .map(|loc| BNArchitectureAndAddress {
+ address: loc.addr,
+ arch: loc.arch.unwrap_or_else(|| self.arch()).handle,
+ })
+ .collect();
+
+ unsafe {
+ BNLowLevelILSetIndirectBranches(self.handle, bn_branches.as_mut_ptr(), branches.len());
+ }
+ }
}
impl<M: FunctionMutability> LowLevelILFunction<M, NonSSA> {