summaryrefslogtreecommitdiff
path: root/rust/src/function.rs
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2025-06-10 18:38:47 -0400
committerGlenn Smith <glenn@vector35.com>2025-06-11 17:37:30 -0400
commit7714756208488751236371949777023618888407 (patch)
tree3e8dcfcabb9736cc03ad7ad2d521e71b7b5fe25b /rust/src/function.rs
parent4559573522332364873709280012593875935285 (diff)
API to create immediate function graphs
Diffstat (limited to 'rust/src/function.rs')
-rw-r--r--rust/src/function.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/rust/src/function.rs b/rust/src/function.rs
index e7e269dc..33b22d19 100644
--- a/rust/src/function.rs
+++ b/rust/src/function.rs
@@ -2435,6 +2435,18 @@ impl Function {
unsafe { FlowGraph::ref_from_raw(result) }
}
+ pub fn create_graph_immediate(
+ &self,
+ view_type: FunctionViewType,
+ settings: Option<&DisassemblySettings>,
+ ) -> Ref<FlowGraph> {
+ let settings_raw = settings.map(|s| s.handle).unwrap_or(std::ptr::null_mut());
+ let raw_view_type = FunctionViewType::into_raw(view_type);
+ let result = unsafe { BNCreateImmediateFunctionGraph(self.handle, raw_view_type, settings_raw) };
+ FunctionViewType::free_raw(raw_view_type);
+ unsafe { FlowGraph::ref_from_raw(result) }
+ }
+
pub fn parent_components(&self) -> Array<Component> {
let mut count = 0;
let result =