From b47f34b2c82e1829d03f327bdcd602a83ae5e08b Mon Sep 17 00:00:00 2001 From: Rubens Brandao Date: Fri, 14 Jun 2024 14:17:15 -0300 Subject: implement rust Component --- rust/src/function.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'rust/src/function.rs') 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 { + 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 { -- cgit v1.3.1