diff options
| author | Rubens Brandao <git@rubens.io> | 2024-06-14 14:17:15 -0300 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2024-07-02 15:54:54 -0400 |
| commit | b47f34b2c82e1829d03f327bdcd602a83ae5e08b (patch) | |
| tree | f1c5535c15599d60041bc3f21b26dac5f8593a08 /rust/src/function.rs | |
| parent | 2a532263525a1bdb9f79522c64d5d2a63c373f9f (diff) | |
implement rust Component
Diffstat (limited to 'rust/src/function.rs')
| -rw-r--r-- | rust/src/function.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rust/src/function.rs b/rust/src/function.rs index 48f02205..bfd8b587 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -19,6 +19,7 @@ use crate::{ basicblock::{BasicBlock, BlockContext}, binaryview::{BinaryView, BinaryViewExt}, callingconvention::CallingConvention, + component::Component, disassembly::{DisassemblySettings, DisassemblyTextLine}, flowgraph::FlowGraph, hlil, llil, @@ -2138,6 +2139,13 @@ impl Function { let result = unsafe { BNCreateFunctionGraph(self.handle, graph_type, settings_raw) }; unsafe { Ref::new(FlowGraph::from_raw(result)) } } + + pub fn parent_components(&self) -> Array<Component> { + let mut count = 0; + let result = unsafe{ BNGetFunctionParentComponents(self.view().handle, self.handle, &mut count) }; + assert!(!result.is_null()); + unsafe{ Array::new(result, count, ()) } + } } impl fmt::Debug for Function { |
