Skip to content

Commit 00a7175

Browse files
committed
Add clear_indirect_branches to Rust API
1 parent 1165cf3 commit 00a7175

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

rust/src/low_level_il/function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ where
215215
.iter()
216216
.map(|loc| BNArchitectureAndAddress {
217217
address: loc.addr,
218-
arch: self.arch().handle,
218+
arch: loc.arch.unwrap_or_else(|| self.arch()).handle,
219219
})
220220
.collect();
221221

rust/src/low_level_il/lifting.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
use std::marker::PhantomData;
1616

1717
use binaryninjacore_sys::{
18-
BNAddLowLevelILLabelForAddress, BNLowLevelILOperation, BNSetLowLevelILExprAttributes,
18+
BNAddLowLevelILLabelForAddress, BNLowLevelILClearIndirectBranches, BNLowLevelILLabel,
19+
BNLowLevelILOperation, BNRegisterOrConstant, BNSetLowLevelILExprAttributes,
1920
};
20-
use binaryninjacore_sys::{BNLowLevelILLabel, BNRegisterOrConstant};
2121

2222
use super::*;
2323
use crate::architecture::{Architecture, FlagWriteId, RegisterId};
@@ -1586,6 +1586,10 @@ impl LowLevelILMutableFunction {
15861586
BNSetLowLevelILExprAttributes(self.handle, expr.0, result);
15871587
}
15881588
}
1589+
1590+
pub fn clear_indirect_branches(&self) {
1591+
unsafe { BNLowLevelILClearIndirectBranches(self.handle) };
1592+
}
15891593
}
15901594

15911595
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]

0 commit comments

Comments
 (0)