Loading...
Searching...
No Matches
BinaryNinja::FirmwareNinjaRelationship Class Reference

FirmwareNinjaRelationship is a class used to represent inter-binary and cross-binary relationships. More...

Detailed Description

FirmwareNinjaRelationship is a class used to represent inter-binary and cross-binary relationships.

This class is only available in the Ultimate Edition of Binary Ninja.

Public Member Functions

 FirmwareNinjaRelationship (Ref< BinaryView > view, BNFirmwareNinjaRelationship *relationship=nullptr)
 
 ~FirmwareNinjaRelationship ()
 
void SetPrimaryAddress (uint64_t address)
 Set the primary relationship object to an address.
 
void SetPrimaryDataVariable (DataVariable &variable)
 Set the primary relationship object to a data variable.
 
void SetPrimaryFunction (Ref< Function > function)
 Set the primary relationship object to a function.
 
bool PrimaryIsAddress () const
 Determine if the primary object is an address.
 
bool PrimaryIsDataVariable () const
 Returns true if the primary object is a data variable.
 
bool PrimaryIsFunction () const
 Returns true if the primary object is a function.
 
bool GetPrimaryDataVariable (DataVariable &var)
 Get the primary data variable contained in the relationship.
 
std::optional< uint64_t > GetPrimaryAddress () const
 Get the primary address contained in the relationship.
 
Ref< FunctionGetPrimaryFunction () const
 Get the primary function contained in the relationship.
 
void SetSecondaryAddress (uint64_t address)
 Set the secondary relationship object to an address.
 
void SetSecondaryDataVariable (DataVariable &variable)
 Set the secondary relationship object to a data variable.
 
void SetSecondaryFunction (Ref< Function > function)
 Set the secondary relationship object to a function.
 
void SetSecondaryExternalAddress (Ref< ProjectFile > projectFile, uint64_t address)
 Set the secondary relationship object to an external address.
 
void SetSecondaryExternalSymbol (Ref< ProjectFile > projectFile, const std::string &symbol)
 Set the secondary relationship object to an external symbol.
 
bool SecondaryIsAddress () const
 Determine if the secondary object is an address in the current binary view.
 
bool SecondaryIsDataVariable () const
 Returns true if the secondary object is a data variable in the current binary view.
 
bool SecondaryIsFunction () const
 Returns true if the secondary object is a function in the current binary view.
 
bool SecondaryIsExternalAddress () const
 Returns true if the secondary object is an address contained in another binary in the project.
 
bool SecondaryIsExternalSymbol () const
 Returns true if the secondary object is a symbol contained in another binary in the project.
 
Ref< ProjectFileGetSecondaryExternalProjectFile () const
 Get the secondary object's external project file.
 
std::optional< uint64_t > GetSecondaryAddress () const
 Get the secondary address from the relationship.
 
bool GetSecondaryDataVariable (DataVariable &variable)
 Get the secondary data variable from the relationship.
 
Ref< FunctionGetSecondaryFunction () const
 Get the secondary function from the relationship.
 
std::string GetSecondaryExternalSymbol () const
 Get the secondary external address from the relationship.
 
void SetDescription (const std::string &description)
 Set the description of the relationship.
 
std::string GetDescription () const
 Get the description of the relationship.
 
void SetProvenance (const std::string &provenance)
 Set the provenance for the relationship.
 
std::string GetProvenance () const
 Get the provenance for the relationship.
 
std::string GetGuid () const
 Get the relationship identifier.
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNFirmwareNinjaRelationship, BNNewFirmwareNinjaRelationshipReference, BNFreeFirmwareNinjaRelationship >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNFirmwareNinjaRelationshipGetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNFirmwareNinjaRelationship, BNNewFirmwareNinjaRelationshipReference, BNFreeFirmwareNinjaRelationship >
static BNFirmwareNinjaRelationshipGetObject (CoreRefCountObject *obj)
 
static BNFirmwareNinjaRelationshipGetObject (const CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNFirmwareNinjaRelationship, BNNewFirmwareNinjaRelationshipReference, BNFreeFirmwareNinjaRelationship >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNFirmwareNinjaRelationshipm_object
 

Constructor & Destructor Documentation

◆ FirmwareNinjaRelationship()

FirmwareNinjaRelationship::FirmwareNinjaRelationship ( Ref< BinaryView > view,
BNFirmwareNinjaRelationship * relationship = nullptr )

◆ ~FirmwareNinjaRelationship()

FirmwareNinjaRelationship::~FirmwareNinjaRelationship ( )

Member Function Documentation

◆ SetPrimaryAddress()

void FirmwareNinjaRelationship::SetPrimaryAddress ( uint64_t address)

Set the primary relationship object to an address.

Parameters
addressAddress in current binary view

◆ SetPrimaryDataVariable()

void FirmwareNinjaRelationship::SetPrimaryDataVariable ( DataVariable & variable)

Set the primary relationship object to a data variable.

Parameters
varDataVariable in current binary view

◆ SetPrimaryFunction()

void FirmwareNinjaRelationship::SetPrimaryFunction ( Ref< Function > function)

Set the primary relationship object to a function.

Parameters
functionFunction in current binary view

◆ PrimaryIsAddress()

bool FirmwareNinjaRelationship::PrimaryIsAddress ( ) const

Determine if the primary object is an address.

Returns
true if the primary object is an address, false otherwise

◆ PrimaryIsDataVariable()

bool FirmwareNinjaRelationship::PrimaryIsDataVariable ( ) const

Returns true if the primary object is a data variable.

Returns
true if the primary object is a data variable, false otherwise

◆ PrimaryIsFunction()

bool FirmwareNinjaRelationship::PrimaryIsFunction ( ) const

Returns true if the primary object is a function.

Returns
true if the primary object is a function, false otherwise

◆ GetPrimaryDataVariable()

bool FirmwareNinjaRelationship::GetPrimaryDataVariable ( DataVariable & var)

Get the primary data variable contained in the relationship.

Parameters
varOutput data variable
Returns
true if the data variable was queried successfully, false if the primary object is not a data variable

◆ GetPrimaryAddress()

std::optional< uint64_t > FirmwareNinjaRelationship::GetPrimaryAddress ( ) const

Get the primary address contained in the relationship.

Returns
Optional address with a value if the primary object is an address

◆ GetPrimaryFunction()

Ref< Function > FirmwareNinjaRelationship::GetPrimaryFunction ( ) const

Get the primary function contained in the relationship.

Returns
Function object if the primary object is a function, nullptr otherwise

◆ SetSecondaryAddress()

void FirmwareNinjaRelationship::SetSecondaryAddress ( uint64_t address)

Set the secondary relationship object to an address.

Parameters
addressAddress in current binary view

◆ SetSecondaryDataVariable()

void FirmwareNinjaRelationship::SetSecondaryDataVariable ( DataVariable & variable)

Set the secondary relationship object to a data variable.

Parameters
varDataVariable in current binary view

◆ SetSecondaryFunction()

void FirmwareNinjaRelationship::SetSecondaryFunction ( Ref< Function > function)

Set the secondary relationship object to a function.

Parameters
functionFunction in current binary view

◆ SetSecondaryExternalAddress()

void FirmwareNinjaRelationship::SetSecondaryExternalAddress ( Ref< ProjectFile > projectFile,
uint64_t address )

Set the secondary relationship object to an external address.

Parameters
projectFileProject file for external binary in the project
addressAddress in the external binary

◆ SetSecondaryExternalSymbol()

void FirmwareNinjaRelationship::SetSecondaryExternalSymbol ( Ref< ProjectFile > projectFile,
const std::string & symbol )

Set the secondary relationship object to an external symbol.

Parameters
projectFileProject file for the external binary in the project
sybmolSymbol in external binary

◆ SecondaryIsAddress()

bool FirmwareNinjaRelationship::SecondaryIsAddress ( ) const

Determine if the secondary object is an address in the current binary view.

Returns
true if the secondary object is an address in the current binary view, false otherwise

◆ SecondaryIsDataVariable()

bool FirmwareNinjaRelationship::SecondaryIsDataVariable ( ) const

Returns true if the secondary object is a data variable in the current binary view.

Returns
true if the secondary object is a data variable in the current binary view, false otherwise

◆ SecondaryIsFunction()

bool FirmwareNinjaRelationship::SecondaryIsFunction ( ) const

Returns true if the secondary object is a function in the current binary view.

Returns
true if the secondary object is a function in the current binary view, false otherwise

◆ SecondaryIsExternalAddress()

bool FirmwareNinjaRelationship::SecondaryIsExternalAddress ( ) const

Returns true if the secondary object is an address contained in another binary in the project.

Returns
true if the secondary object is an external address, false otherwise

◆ SecondaryIsExternalSymbol()

bool FirmwareNinjaRelationship::SecondaryIsExternalSymbol ( ) const

Returns true if the secondary object is a symbol contained in another binary in the project.

Returns
true if the secondary object is an external symbol, false otherwise

◆ GetSecondaryExternalProjectFile()

Ref< ProjectFile > FirmwareNinjaRelationship::GetSecondaryExternalProjectFile ( ) const

Get the secondary object's external project file.

Returns
The secondary object's external project file or nullptr if the secondary object is not an external address

◆ GetSecondaryAddress()

std::optional< uint64_t > FirmwareNinjaRelationship::GetSecondaryAddress ( ) const

Get the secondary address from the relationship.

Returns
Optional address containing a value, if the secondary object is an address

◆ GetSecondaryDataVariable()

bool FirmwareNinjaRelationship::GetSecondaryDataVariable ( DataVariable & variable)

Get the secondary data variable from the relationship.

Parameters
varOutput data variable
Returns
true if the data variable was queried successfully, false if the secondary object is not a data variable

◆ GetSecondaryFunction()

Ref< Function > FirmwareNinjaRelationship::GetSecondaryFunction ( ) const

Get the secondary function from the relationship.

Returns
Function object if the secondary object is a function, nullptr otherwise

◆ GetSecondaryExternalSymbol()

std::string FirmwareNinjaRelationship::GetSecondaryExternalSymbol ( ) const

Get the secondary external address from the relationship.

Returns
External symbol string, or empty string if the secondary object is not an external symbol

◆ SetDescription()

void FirmwareNinjaRelationship::SetDescription ( const std::string & description)

Set the description of the relationship.

Parameters
descriptionDescription string

◆ GetDescription()

std::string FirmwareNinjaRelationship::GetDescription ( ) const

Get the description of the relationship.

Returns
Description string, or empty string if not set

◆ SetProvenance()

void FirmwareNinjaRelationship::SetProvenance ( const std::string & provenance)

Set the provenance for the relationship.

Parameters
provenanceProvenance string

◆ GetProvenance()

std::string FirmwareNinjaRelationship::GetProvenance ( ) const

Get the provenance for the relationship.

Returns
Provenance string, or empty string if not set

◆ GetGuid()

std::string FirmwareNinjaRelationship::GetGuid ( ) const

Get the relationship identifier.

Returns
Relationship GUID string