Struct binaryninja::component::Component
source · pub struct Component { /* private fields */ }
Expand description
Components are objects that can contain Functions, Data Variables, and other Components.
They can be queried for information about the items contained within them.
Components have a Guid, which persistent across saves and loads of the database, and should be used for retrieving components when such is required and a reference to the Component cannot be held.
Implementations§
source§impl Component
impl Component
pub fn guid(&self) -> BnString
sourcepub fn add_function(&self, func: &Function) -> bool
pub fn add_function(&self, func: &Function) -> bool
Add function to this component.
sourcepub fn contains_function(&self, func: &Function) -> bool
pub fn contains_function(&self, func: &Function) -> bool
Check whether this component contains a function.
sourcepub fn remove_function(&self, func: &Function) -> bool
pub fn remove_function(&self, func: &Function) -> bool
Remove function from this component.
sourcepub fn add_component(&self, component: &Component) -> bool
pub fn add_component(&self, component: &Component) -> bool
Move component to this component. This will remove it from the old parent.
sourcepub fn contains_component(&self, component: &Component) -> bool
pub fn contains_component(&self, component: &Component) -> bool
Check whether this component contains a component.
sourcepub fn remove_component(&self, component: &Component) -> bool
pub fn remove_component(&self, component: &Component) -> bool
Remove a component from the current component, moving it to the root.
This function has no effect when used from the root component.
Use BinaryView.remove_component
to Remove a component from the tree entirely.
sourcepub fn add_data_variable(&self, data_variable: &DataVariable) -> bool
pub fn add_data_variable(&self, data_variable: &DataVariable) -> bool
Add data variable to this component.
sourcepub fn contains_data_variable(&self, data_variable: &DataVariable) -> bool
pub fn contains_data_variable(&self, data_variable: &DataVariable) -> bool
Check whether this component contains a data variable.
sourcepub fn remove_data_variable(&self, data_variable: &DataVariable) -> bool
pub fn remove_data_variable(&self, data_variable: &DataVariable) -> bool
Remove data variable from this component.
sourcepub fn display_name(&self) -> BnString
pub fn display_name(&self) -> BnString
Original name of the component
sourcepub fn name(&self) -> BnString
pub fn name(&self) -> BnString
Original name set for this component
:note: The .display_name
property should be used for bv.get_component_by_path()
lookups.
This can differ from the .display_name property if one of its sibling components has the same .original_name; In that
case, .name will be an automatically generated unique name (e.g. “MyComponentName (1)”) while .original_name will
remain what was originally set (e.g. “MyComponentName”)
If this component has a duplicate name and is moved to a component where none of its siblings share its name,
.name will return the original “MyComponentName”
pub fn set_name<S: BnStrCompatible>(&self, name: S)
sourcepub fn parent(&self) -> Option<Component>
pub fn parent(&self) -> Option<Component>
The component that contains this component, if it exists.
pub fn view(&self) -> Option<Ref<BinaryView>>
sourcepub fn components(&self) -> Array<Component>
pub fn components(&self) -> Array<Component>
Is an iterator for all Components contained within this Component
sourcepub fn functions(&self) -> Array<Function>
pub fn functions(&self) -> Array<Function>
List of all Functions contained within this Component
sourcepub fn data_variables(&self) -> Array<DataVariable>
pub fn data_variables(&self) -> Array<DataVariable>
List of all Data Variables contained within this Component
sourcepub fn get_referenced_data_variables(
&self,
recursive: bool
) -> Array<DataVariable>
pub fn get_referenced_data_variables( &self, recursive: bool ) -> Array<DataVariable>
Get data variables referenced by this component
recursive
- Get all DataVariables referenced by this component and subcomponents.
sourcepub fn get_referenced_types(
&self,
recursive: bool
) -> Array<ComponentReferencedTypes>
pub fn get_referenced_types( &self, recursive: bool ) -> Array<ComponentReferencedTypes>
Get Types referenced by this component
recursive
- Get all Types referenced by this component and subcomponents.