summaryrefslogtreecommitdiff
path: root/rust/src/low_level_il/function.rs
diff options
context:
space:
mode:
authorBrandon Miller <brandon@vector35.com>2026-05-22 15:44:53 -0400
committerBrandon Miller <brandon@vector35.com>2026-05-27 08:36:26 -0400
commit8fbf9ca9c0c32c600008dc6d85cacf84276736f8 (patch)
treedfac45c21a5ce7902cfedc96ecf4effdf4808832 /rust/src/low_level_il/function.rs
parent8bb4ab351a7a0f371ca758ed82ca50085e6c50fd (diff)
Rust APIs for custom function lifters
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> {