From 8fbf9ca9c0c32c600008dc6d85cacf84276736f8 Mon Sep 17 00:00:00 2001 From: Brandon Miller Date: Fri, 22 May 2026 15:44:53 -0400 Subject: Rust APIs for custom function lifters --- rust/src/low_level_il/function.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'rust/src/low_level_il/function.rs') 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 LowLevelILFunction { -- cgit v1.3.1