BinaryView

Classes related to interacting with and implementing custom BinaryViews. More...

Detailed Description

Classes related to interacting with and implementing custom BinaryViews.

Classes

class  BinaryNinja::BinaryDataNotification
 
class  BinaryNinja::AnalysisCompletionEvent
 
struct  BinaryNinja::ActiveAnalysisInfo
 
struct  BinaryNinja::AnalysisInfo
 
struct  BinaryNinja::DataVariable
 
struct  BinaryNinja::DataVariableAndName
 
class  BinaryNinja::TagType
 
struct  BinaryNinja::TagReference
 
class  BinaryNinja::Segment
 The Segment object is returned during BinaryView creation and should not be directly instantiated. More...
 
class  BinaryNinja::Section
 The Section object is returned during BinaryView creation and should not be directly instantiated. More...
 
class  BinaryNinja::BinaryView
 BinaryView implements a view on binary data, and presents a queryable interface of a binary file. More...
 
class  BinaryNinja::Relocation
 
class  BinaryNinja::BinaryData
 
class  BinaryNinja::BinaryViewType
 The BinaryViewType object is used internally and should not be directly instantiated. More...
 
class  BinaryNinja::CoreBinaryViewType
 
class  BinaryNinja::ReadException
 Thrown whenever a read is performed out of bounds. More...
 
class  BinaryNinja::BinaryReader
 BinaryReader is a convenience class for reading binary data. More...
 
class  BinaryNinja::WriteException
 Raised whenever a write is performed out of bounds. More...
 
class  BinaryNinja::BinaryWriter
 BinaryWriter is a convenience class for writing binary data. More...
 
class  BinaryNinja::SymbolQueue
 

Class Documentation

◆ BinaryNinja::BinaryDataNotification

class BinaryNinja::BinaryDataNotification

Public Member Functions

 BinaryDataNotification ()
 
virtual ~BinaryDataNotification ()
 
BNBinaryDataNotificationGetCallbacks ()
 
virtual void OnBinaryDataWritten (BinaryView *view, uint64_t offset, size_t len)
 
virtual void OnBinaryDataInserted (BinaryView *view, uint64_t offset, size_t len)
 
virtual void OnBinaryDataRemoved (BinaryView *view, uint64_t offset, uint64_t len)
 
virtual void OnAnalysisFunctionAdded (BinaryView *view, Function *func)
 
virtual void OnAnalysisFunctionRemoved (BinaryView *view, Function *func)
 
virtual void OnAnalysisFunctionUpdated (BinaryView *view, Function *func)
 
virtual void OnAnalysisFunctionUpdateRequested (BinaryView *view, Function *func)
 
virtual void OnDataVariableAdded (BinaryView *view, const DataVariable &var)
 
virtual void OnDataVariableRemoved (BinaryView *view, const DataVariable &var)
 
virtual void OnDataVariableUpdated (BinaryView *view, const DataVariable &var)
 
virtual void OnDataMetadataUpdated (BinaryView *view, uint64_t offset)
 
virtual void OnTagTypeUpdated (BinaryView *view, Ref< TagType > tagTypeRef)
 
virtual void OnTagAdded (BinaryView *view, const TagReference &tagRef)
 
virtual void OnTagUpdated (BinaryView *view, const TagReference &tagRef)
 
virtual void OnTagRemoved (BinaryView *view, const TagReference &tagRef)
 
virtual void OnSymbolAdded (BinaryView *view, Symbol *sym)
 
virtual void OnSymbolUpdated (BinaryView *view, Symbol *sym)
 
virtual void OnSymbolRemoved (BinaryView *view, Symbol *sym)
 
virtual void OnStringFound (BinaryView *data, BNStringType type, uint64_t offset, size_t len)
 
virtual void OnStringRemoved (BinaryView *data, BNStringType type, uint64_t offset, size_t len)
 
virtual void OnTypeDefined (BinaryView *data, const QualifiedName &name, Type *type)
 
virtual void OnTypeUndefined (BinaryView *data, const QualifiedName &name, Type *type)
 
virtual void OnTypeReferenceChanged (BinaryView *data, const QualifiedName &name, Type *type)
 
virtual void OnTypeFieldReferenceChanged (BinaryView *data, const QualifiedName &name, uint64_t offset)
 
virtual void OnSegmentAdded (BinaryView *data, Segment *segment)
 
virtual void OnSegmentUpdated (BinaryView *data, Segment *segment)
 
virtual void OnSegmentRemoved (BinaryView *data, Segment *segment)
 
virtual void OnSectionAdded (BinaryView *data, Section *section)
 
virtual void OnSectionUpdated (BinaryView *data, Section *section)
 
virtual void OnSectionRemoved (BinaryView *data, Section *section)
 
virtual void OnComponentNameUpdated (BinaryView *data, std::string &previousName, Component *component)
 This notification is posted after the display name for a component is updated. More...
 
virtual void OnComponentAdded (BinaryView *data, Component *component)
 This notification is posted after a Component is added to the tree. More...
 
virtual void OnComponentRemoved (BinaryView *data, Component *formerParent, Component *component)
 This notification is posted after a Component is removed from the tree. More...
 
virtual void OnComponentMoved (BinaryView *data, Component *formerParent, Component *newParent, Component *component)
 This notification is posted whenever a component is moved from one component to another. More...
 
virtual void OnComponentFunctionAdded (BinaryView *data, Component *component, Function *function)
 This notification is posted whenever a Function is added to a Component. More...
 
virtual void OnComponentFunctionRemoved (BinaryView *data, Component *component, Function *function)
 This notification is posted whenever a Function is removed from a Component. More...
 
virtual void OnComponentDataVariableAdded (BinaryView *data, Component *component, const DataVariable &var)
 This notification is posted whenever a DataVariable is added to a Component. More...
 
virtual void OnComponentDataVariableRemoved (BinaryView *data, Component *component, const DataVariable &var)
 This notification is posted whenever a DataVariable is removed from a Component. More...
 

Constructor & Destructor Documentation

◆ BinaryDataNotification()

BinaryDataNotification::BinaryDataNotification ( )

◆ ~BinaryDataNotification()

virtual BinaryNinja::BinaryDataNotification::~BinaryDataNotification ( )
inlinevirtual

Member Function Documentation

◆ GetCallbacks()

BNBinaryDataNotification * BinaryNinja::BinaryDataNotification::GetCallbacks ( )
inline

◆ OnBinaryDataWritten()

virtual void BinaryNinja::BinaryDataNotification::OnBinaryDataWritten ( BinaryView view,
uint64_t  offset,
size_t  len 
)
inlinevirtual

◆ OnBinaryDataInserted()

virtual void BinaryNinja::BinaryDataNotification::OnBinaryDataInserted ( BinaryView view,
uint64_t  offset,
size_t  len 
)
inlinevirtual

◆ OnBinaryDataRemoved()

virtual void BinaryNinja::BinaryDataNotification::OnBinaryDataRemoved ( BinaryView view,
uint64_t  offset,
uint64_t  len 
)
inlinevirtual

◆ OnAnalysisFunctionAdded()

virtual void BinaryNinja::BinaryDataNotification::OnAnalysisFunctionAdded ( BinaryView view,
Function func 
)
inlinevirtual

◆ OnAnalysisFunctionRemoved()

virtual void BinaryNinja::BinaryDataNotification::OnAnalysisFunctionRemoved ( BinaryView view,
Function func 
)
inlinevirtual

◆ OnAnalysisFunctionUpdated()

virtual void BinaryNinja::BinaryDataNotification::OnAnalysisFunctionUpdated ( BinaryView view,
Function func 
)
inlinevirtual

◆ OnAnalysisFunctionUpdateRequested()

virtual void BinaryNinja::BinaryDataNotification::OnAnalysisFunctionUpdateRequested ( BinaryView view,
Function func 
)
inlinevirtual

Reimplemented in FlowGraphWidget.

◆ OnDataVariableAdded()

virtual void BinaryNinja::BinaryDataNotification::OnDataVariableAdded ( BinaryView view,
const DataVariable var 
)
inlinevirtual

◆ OnDataVariableRemoved()

virtual void BinaryNinja::BinaryDataNotification::OnDataVariableRemoved ( BinaryView view,
const DataVariable var 
)
inlinevirtual

◆ OnDataVariableUpdated()

virtual void BinaryNinja::BinaryDataNotification::OnDataVariableUpdated ( BinaryView view,
const DataVariable var 
)
inlinevirtual

Reimplemented in FeatureMap, LinearView, and TokenizedTextView.

◆ OnDataMetadataUpdated()

virtual void BinaryNinja::BinaryDataNotification::OnDataMetadataUpdated ( BinaryView view,
uint64_t  offset 
)
inlinevirtual

Reimplemented in FlowGraphWidget, LinearView, and TokenizedTextView.

◆ OnTagTypeUpdated()

virtual void BinaryNinja::BinaryDataNotification::OnTagTypeUpdated ( BinaryView view,
Ref< TagType tagTypeRef 
)
inlinevirtual

◆ OnTagAdded()

virtual void BinaryNinja::BinaryDataNotification::OnTagAdded ( BinaryView view,
const TagReference tagRef 
)
inlinevirtual

Reimplemented in TagListModel, TagList, TagTypeListModel, and LinearView.

◆ OnTagUpdated()

virtual void BinaryNinja::BinaryDataNotification::OnTagUpdated ( BinaryView view,
const TagReference tagRef 
)
inlinevirtual

◆ OnTagRemoved()

virtual void BinaryNinja::BinaryDataNotification::OnTagRemoved ( BinaryView view,
const TagReference tagRef 
)
inlinevirtual

Reimplemented in TagListModel, TagList, TagTypeListModel, and LinearView.

◆ OnSymbolAdded()

virtual void BinaryNinja::BinaryDataNotification::OnSymbolAdded ( BinaryView view,
Symbol sym 
)
inlinevirtual

Reimplemented in SymbolListModel, and LinearView.

◆ OnSymbolUpdated()

virtual void BinaryNinja::BinaryDataNotification::OnSymbolUpdated ( BinaryView view,
Symbol sym 
)
inlinevirtual

Reimplemented in SymbolListModel, and LinearView.

◆ OnSymbolRemoved()

virtual void BinaryNinja::BinaryDataNotification::OnSymbolRemoved ( BinaryView view,
Symbol sym 
)
inlinevirtual

Reimplemented in SymbolListModel, and LinearView.

◆ OnStringFound()

virtual void BinaryNinja::BinaryDataNotification::OnStringFound ( BinaryView data,
BNStringType  type,
uint64_t  offset,
size_t  len 
)
inlinevirtual

Reimplemented in FeatureMap, and StringsListModel.

◆ OnStringRemoved()

virtual void BinaryNinja::BinaryDataNotification::OnStringRemoved ( BinaryView data,
BNStringType  type,
uint64_t  offset,
size_t  len 
)
inlinevirtual

Reimplemented in FeatureMap, and StringsListModel.

◆ OnTypeDefined()

virtual void BinaryNinja::BinaryDataNotification::OnTypeDefined ( BinaryView data,
const QualifiedName name,
Type type 
)
inlinevirtual

Reimplemented in LinearView, and TypeView.

◆ OnTypeUndefined()

virtual void BinaryNinja::BinaryDataNotification::OnTypeUndefined ( BinaryView data,
const QualifiedName name,
Type type 
)
inlinevirtual

Reimplemented in LinearView, and TypeView.

◆ OnTypeReferenceChanged()

virtual void BinaryNinja::BinaryDataNotification::OnTypeReferenceChanged ( BinaryView data,
const QualifiedName name,
Type type 
)
inlinevirtual

Reimplemented in TypeView.

◆ OnTypeFieldReferenceChanged()

virtual void BinaryNinja::BinaryDataNotification::OnTypeFieldReferenceChanged ( BinaryView data,
const QualifiedName name,
uint64_t  offset 
)
inlinevirtual

Reimplemented in TypeView.

◆ OnSegmentAdded()

virtual void BinaryNinja::BinaryDataNotification::OnSegmentAdded ( BinaryView data,
Segment segment 
)
inlinevirtual

Reimplemented in LogItemDelegate, and SegmentWidget.

◆ OnSegmentUpdated()

virtual void BinaryNinja::BinaryDataNotification::OnSegmentUpdated ( BinaryView data,
Segment segment 
)
inlinevirtual

Reimplemented in LogItemDelegate, and SegmentWidget.

◆ OnSegmentRemoved()

virtual void BinaryNinja::BinaryDataNotification::OnSegmentRemoved ( BinaryView data,
Segment segment 
)
inlinevirtual

Reimplemented in LogItemDelegate, and SegmentWidget.

◆ OnSectionAdded()

virtual void BinaryNinja::BinaryDataNotification::OnSectionAdded ( BinaryView data,
Section section 
)
inlinevirtual

Reimplemented in SectionWidget.

◆ OnSectionUpdated()

virtual void BinaryNinja::BinaryDataNotification::OnSectionUpdated ( BinaryView data,
Section section 
)
inlinevirtual

Reimplemented in SectionWidget.

◆ OnSectionRemoved()

virtual void BinaryNinja::BinaryDataNotification::OnSectionRemoved ( BinaryView data,
Section section 
)
inlinevirtual

Reimplemented in SectionWidget.

◆ OnComponentNameUpdated()

virtual void BinaryNinja::BinaryDataNotification::OnComponentNameUpdated ( BinaryView data,
std::string &  previousName,
Component component 
)
inlinevirtual

This notification is posted after the display name for a component is updated.

Parameters
dataBinaryView the Component is contained in
previousNamePrevious name of the component
componentThe component which was modified.

◆ OnComponentAdded()

virtual void BinaryNinja::BinaryDataNotification::OnComponentAdded ( BinaryView data,
Component component 
)
inlinevirtual

This notification is posted after a Component is added to the tree.

Parameters
dataBinaryView the Component was added to
componentComponent which was added.

◆ OnComponentRemoved()

virtual void BinaryNinja::BinaryDataNotification::OnComponentRemoved ( BinaryView data,
Component formerParent,
Component component 
)
inlinevirtual

This notification is posted after a Component is removed from the tree.

Parameters
dataBinaryView the Component was removed from
formerParentFormer parent of the Component
component

The removed and now "dead" Component object.

This "dead" Component can no longer be moved to other components or have components added to it. It should not be used after this point for storing any objects, and will be destroyed once no more references are held to it.

◆ OnComponentMoved()

virtual void BinaryNinja::BinaryDataNotification::OnComponentMoved ( BinaryView data,
Component formerParent,
Component newParent,
Component component 
)
inlinevirtual

This notification is posted whenever a component is moved from one component to another.

Parameters
dataBinaryView the Component was removed from
formerParentFormer parent of the Component
newParentNew parent which the Component was moved to
componentThe component that was moved.

◆ OnComponentFunctionAdded()

virtual void BinaryNinja::BinaryDataNotification::OnComponentFunctionAdded ( BinaryView data,
Component component,
Function function 
)
inlinevirtual

This notification is posted whenever a Function is added to a Component.

Parameters
dataBinaryView containing the Component and Function
componentComponent the Function was added to
functionThe Function which was added

◆ OnComponentFunctionRemoved()

virtual void BinaryNinja::BinaryDataNotification::OnComponentFunctionRemoved ( BinaryView data,
Component component,
Function function 
)
inlinevirtual

This notification is posted whenever a Function is removed from a Component.

Parameters
dataBinaryView containing the Component and Function
componentComponent the Function was removed from
functionThe Function which was removed

◆ OnComponentDataVariableAdded()

virtual void BinaryNinja::BinaryDataNotification::OnComponentDataVariableAdded ( BinaryView data,
Component component,
const DataVariable var 
)
inlinevirtual

This notification is posted whenever a DataVariable is added to a Component.

Parameters
dataBinaryView containing the Component and DataVariable
componentComponent the DataVariable was added to
varThe DataVariable which was added

◆ OnComponentDataVariableRemoved()

virtual void BinaryNinja::BinaryDataNotification::OnComponentDataVariableRemoved ( BinaryView data,
Component component,
const DataVariable var 
)
inlinevirtual

This notification is posted whenever a DataVariable is removed from a Component.

Parameters
dataBinaryView containing the Component and DataVariable
componentComponent the DataVariable was removed from
varThe DataVariable which was removed

◆ BinaryNinja::AnalysisCompletionEvent

class BinaryNinja::AnalysisCompletionEvent

Public Member Functions

 AnalysisCompletionEvent (BinaryView *view, const std::function< void()> &callback)
 
void Cancel ()
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNAnalysisCompletionEvent, BNNewAnalysisCompletionEventReference, BNFreeAnalysisCompletionEvent >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNAnalysisCompletionEvent * GetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Static Protected Member Functions

static void CompletionCallback (void *ctxt)
 

Protected Attributes

std::function< void()> m_callback
 
std::recursive_mutex m_mutex
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNAnalysisCompletionEvent, BNNewAnalysisCompletionEventReference, BNFreeAnalysisCompletionEvent >
static BNAnalysisCompletionEvent * GetObject (CoreRefCountObject *obj)
 
static BNAnalysisCompletionEvent * GetObject (const CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNAnalysisCompletionEvent, BNNewAnalysisCompletionEventReference, BNFreeAnalysisCompletionEvent >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNAnalysisCompletionEvent * m_object
 

Constructor & Destructor Documentation

◆ AnalysisCompletionEvent()

AnalysisCompletionEvent::AnalysisCompletionEvent ( BinaryView view,
const std::function< void()> &  callback 
)

Member Function Documentation

◆ CompletionCallback()

void AnalysisCompletionEvent::CompletionCallback ( void *  ctxt)
staticprotected

◆ Cancel()

void AnalysisCompletionEvent::Cancel ( )

Member Data Documentation

◆ m_callback

std::function<void()> BinaryNinja::AnalysisCompletionEvent::m_callback
protected

◆ m_mutex

std::recursive_mutex BinaryNinja::AnalysisCompletionEvent::m_mutex
protected

◆ BinaryNinja::ActiveAnalysisInfo

struct BinaryNinja::ActiveAnalysisInfo

Public Member Functions

 ActiveAnalysisInfo (Ref< Function > f, uint64_t t, size_t uc, size_t sc)
 

Public Attributes

Ref< Functionfunc
 
uint64_t analysisTime
 
size_t updateCount
 
size_t submitCount
 

Constructor & Destructor Documentation

◆ ActiveAnalysisInfo()

BinaryNinja::ActiveAnalysisInfo::ActiveAnalysisInfo ( Ref< Function f,
uint64_t  t,
size_t  uc,
size_t  sc 
)
inline

Member Data Documentation

◆ func

Ref<Function> BinaryNinja::ActiveAnalysisInfo::func

◆ analysisTime

uint64_t BinaryNinja::ActiveAnalysisInfo::analysisTime

◆ updateCount

size_t BinaryNinja::ActiveAnalysisInfo::updateCount

◆ submitCount

size_t BinaryNinja::ActiveAnalysisInfo::submitCount

◆ BinaryNinja::AnalysisInfo

struct BinaryNinja::AnalysisInfo
Class Members
BNAnalysisState state
uint64_t analysisTime
vector< ActiveAnalysisInfo > activeInfo

◆ BinaryNinja::DataVariable

struct BinaryNinja::DataVariable

Public Member Functions

 DataVariable ()
 
 DataVariable (uint64_t a, Type *t, bool d)
 

Public Attributes

uint64_t address
 
Confidence< Ref< Type > > type
 
bool autoDiscovered
 

Constructor & Destructor Documentation

◆ DataVariable() [1/2]

BinaryNinja::DataVariable::DataVariable ( )
inline

◆ DataVariable() [2/2]

BinaryNinja::DataVariable::DataVariable ( uint64_t  a,
Type t,
bool  d 
)
inline

Member Data Documentation

◆ address

uint64_t BinaryNinja::DataVariable::address

◆ type

Confidence<Ref<Type> > BinaryNinja::DataVariable::type

◆ autoDiscovered

bool BinaryNinja::DataVariable::autoDiscovered

◆ BinaryNinja::DataVariableAndName

struct BinaryNinja::DataVariableAndName

Public Member Functions

 DataVariableAndName ()
 
 DataVariableAndName (uint64_t a, Type *t, bool d, const std::string &n)
 

Public Attributes

uint64_t address
 
Confidence< Ref< Type > > type
 
bool autoDiscovered
 
std::string name
 

Constructor & Destructor Documentation

◆ DataVariableAndName() [1/2]

BinaryNinja::DataVariableAndName::DataVariableAndName ( )
inline

◆ DataVariableAndName() [2/2]

BinaryNinja::DataVariableAndName::DataVariableAndName ( uint64_t  a,
Type t,
bool  d,
const std::string &  n 
)
inline

Member Data Documentation

◆ address

uint64_t BinaryNinja::DataVariableAndName::address

◆ type

Confidence<Ref<Type> > BinaryNinja::DataVariableAndName::type

◆ autoDiscovered

bool BinaryNinja::DataVariableAndName::autoDiscovered

◆ name

std::string BinaryNinja::DataVariableAndName::name

◆ BinaryNinja::TagType

class BinaryNinja::TagType

Public Types

typedef BNTagTypeType Type
 

Public Member Functions

 TagType (BNTagType *tagType)
 
 TagType (BinaryView *view)
 
 TagType (BinaryView *view, const std::string &name, const std::string &icon, bool visible=true, Type type=UserTagType)
 
BinaryViewGetView () const
 
std::string GetId () const
 
std::string GetName () const
 
void SetName (const std::string &name)
 Set the name of the TagType. More...
 
std::string GetIcon () const
 
void SetIcon (const std::string &icon)
 Set the icon to be used for a TagType. More...
 
bool GetVisible () const
 
void SetVisible (bool visible)
 Set whether the tags of this type are visible. More...
 
Type GetType () const
 One of: UserTagType, NotificationTagType, BookmarksTagType. More...
 
void SetType (Type type)
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNTagType, BNNewTagTypeReference, BNFreeTagType >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNTagType * GetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNTagType, BNNewTagTypeReference, BNFreeTagType >
static BNTagType * GetObject (CoreRefCountObject *obj)
 
static BNTagType * GetObject (const CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNTagType, BNNewTagTypeReference, BNFreeTagType >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNTagType * m_object
 

Member Typedef Documentation

◆ Type

Constructor & Destructor Documentation

◆ TagType() [1/3]

TagType::TagType ( BNTagType *  tagType)

◆ TagType() [2/3]

TagType::TagType ( BinaryView view)

◆ TagType() [3/3]

TagType::TagType ( BinaryView view,
const std::string &  name,
const std::string &  icon,
bool  visible = true,
TagType::Type  type = UserTagType 
)

Member Function Documentation

◆ GetView()

BinaryView * TagType::GetView ( ) const
Returns
BinaryView for this TagType

◆ GetId()

std::string TagType::GetId ( ) const
Returns
Unique ID of the TagType

◆ GetName()

std::string TagType::GetName ( ) const
Returns
Name of the TagType

◆ SetName()

void TagType::SetName ( const std::string &  name)

Set the name of the TagType.

Parameters
nameNew name

◆ GetIcon()

std::string TagType::GetIcon ( ) const
Returns
Unicode string containing an emoji to be used as an icon

◆ SetIcon()

void TagType::SetIcon ( const std::string &  icon)

Set the icon to be used for a TagType.

Parameters
iconUnicode string containing an emoji to be used as an icon

◆ GetVisible()

bool TagType::GetVisible ( ) const
Returns
Whether the tags of this type are visible

◆ SetVisible()

void TagType::SetVisible ( bool  visible)

Set whether the tags of this type are visible.

Parameters
visibleWhether the tags of this type are visible

◆ GetType()

TagType::Type TagType::GetType ( ) const

One of: UserTagType, NotificationTagType, BookmarksTagType.

Returns
Tag Type.

◆ SetType()

void TagType::SetType ( TagType::Type  type)
Parameters
typeTag Type. One of: UserTagType, NotificationTagType, BookmarksTagType

◆ BinaryNinja::TagReference

struct BinaryNinja::TagReference

Public Types

typedef BNTagReferenceType RefType
 

Public Member Functions

 TagReference ()
 
 TagReference (const BNTagReference &ref)
 
bool operator== (const TagReference &other) const
 
bool operator!= (const TagReference &other) const
 
 operator BNTagReference () const
 

Static Public Member Functions

static BNTagReferenceCreateTagReferenceList (const std::vector< TagReference > &tags, size_t *count)
 
static std::vector< TagReferenceConvertTagReferenceList (BNTagReference *tags, size_t count)
 
static std::vector< TagReferenceConvertAndFreeTagReferenceList (BNTagReference *tags, size_t count)
 

Public Attributes

RefType refType
 
bool autoDefined
 
Ref< Tagtag
 
Ref< Architecturearch
 
Ref< Functionfunc
 
uint64_t addr
 

Member Typedef Documentation

◆ RefType

Constructor & Destructor Documentation

◆ TagReference() [1/2]

TagReference::TagReference ( )

◆ TagReference() [2/2]

TagReference::TagReference ( const BNTagReference ref)

Member Function Documentation

◆ operator==()

bool TagReference::operator== ( const TagReference other) const

◆ operator!=()

bool TagReference::operator!= ( const TagReference other) const

◆ operator BNTagReference()

TagReference::operator BNTagReference ( ) const

◆ CreateTagReferenceList()

BNTagReference * TagReference::CreateTagReferenceList ( const std::vector< TagReference > &  tags,
size_t *  count 
)
static

◆ ConvertTagReferenceList()

std::vector< TagReference > TagReference::ConvertTagReferenceList ( BNTagReference tags,
size_t  count 
)
static

◆ ConvertAndFreeTagReferenceList()

std::vector< TagReference > TagReference::ConvertAndFreeTagReferenceList ( BNTagReference tags,
size_t  count 
)
static

Member Data Documentation

◆ refType

RefType BinaryNinja::TagReference::refType

◆ autoDefined

bool BinaryNinja::TagReference::autoDefined

◆ tag

Ref<Tag> BinaryNinja::TagReference::tag

◆ arch

Ref<Architecture> BinaryNinja::TagReference::arch

◆ func

Ref<Function> BinaryNinja::TagReference::func

◆ addr

uint64_t BinaryNinja::TagReference::addr

◆ BinaryNinja::Segment

class BinaryNinja::Segment

The Segment object is returned during BinaryView creation and should not be directly instantiated.

Public Member Functions

 Segment (BNSegment *seg)
 
uint64_t GetStart () const
 
uint64_t GetLength () const
 
uint64_t GetEnd () const
 
uint64_t GetDataEnd () const
 
uint64_t GetDataOffset () const
 
uint64_t GetDataLength () const
 
uint32_t GetFlags () const
 
bool IsAutoDefined () const
 
std::vector< std::pair< uint64_t, uint64_t > > GetRelocationRanges () const
 
std::vector< std::pair< uint64_t, uint64_t > > GetRelocationRangesAtAddress (uint64_t addr) const
 
std::vector< Ref< Relocation > > GetRelocationsInRange (uint64_t addr, uint64_t size) const
 
uint64_t GetRelocationsCount () const
 
void SetLength (uint64_t length)
 
void SetDataOffset (uint64_t dataOffset)
 
void SetDataLength (uint64_t dataLength)
 
void SetFlags (uint32_t flags)
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNSegment, BNNewSegmentReference, BNFreeSegment >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNSegment * GetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNSegment, BNNewSegmentReference, BNFreeSegment >
static BNSegment * GetObject (CoreRefCountObject *obj)
 
static BNSegment * GetObject (const CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNSegment, BNNewSegmentReference, BNFreeSegment >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNSegment * m_object
 

Constructor & Destructor Documentation

◆ Segment()

Segment::Segment ( BNSegment *  seg)

Member Function Documentation

◆ GetStart()

uint64_t Segment::GetStart ( ) const

◆ GetLength()

uint64_t Segment::GetLength ( ) const

◆ GetEnd()

uint64_t Segment::GetEnd ( ) const

◆ GetDataEnd()

uint64_t Segment::GetDataEnd ( ) const

◆ GetDataOffset()

uint64_t Segment::GetDataOffset ( ) const

◆ GetDataLength()

uint64_t Segment::GetDataLength ( ) const

◆ GetFlags()

uint32_t Segment::GetFlags ( ) const

◆ IsAutoDefined()

bool Segment::IsAutoDefined ( ) const

◆ GetRelocationRanges()

vector< pair< uint64_t, uint64_t > > Segment::GetRelocationRanges ( ) const

◆ GetRelocationRangesAtAddress()

vector< pair< uint64_t, uint64_t > > Segment::GetRelocationRangesAtAddress ( uint64_t  addr) const

◆ GetRelocationsInRange()

std::vector< Ref< Relocation > > BinaryNinja::Segment::GetRelocationsInRange ( uint64_t  addr,
uint64_t  size 
) const

◆ GetRelocationsCount()

uint64_t Segment::GetRelocationsCount ( ) const

◆ SetLength()

void Segment::SetLength ( uint64_t  length)

◆ SetDataOffset()

void Segment::SetDataOffset ( uint64_t  dataOffset)

◆ SetDataLength()

void Segment::SetDataLength ( uint64_t  dataLength)

◆ SetFlags()

void Segment::SetFlags ( uint32_t  flags)

◆ BinaryNinja::Section

class BinaryNinja::Section

The Section object is returned during BinaryView creation and should not be directly instantiated.

Public Member Functions

 Section (BNSection *sec)
 
 Section (const std::string &name, uint64_t start, uint64_t length, BNSectionSemantics semantics, const std::string &type, uint64_t align, uint64_t entrySize, const std::string &linkedSection, const std::string &infoSection, uint64_t infoData, bool autoDefined)
 
std::string GetName () const
 
std::string GetType () const
 
uint64_t GetStart () const
 
uint64_t GetLength () const
 
uint64_t GetInfoData () const
 
uint64_t GetAlignment () const
 
uint64_t GetEntrySize () const
 
std::string GetLinkedSection () const
 
std::string GetInfoSection () const
 
BNSectionSemantics GetSemantics () const
 
bool AutoDefined () const
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNSection, BNNewSectionReference, BNFreeSection >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNSection * GetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNSection, BNNewSectionReference, BNFreeSection >
static BNSection * GetObject (CoreRefCountObject *obj)
 
static BNSection * GetObject (const CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNSection, BNNewSectionReference, BNFreeSection >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNSection * m_object
 

Constructor & Destructor Documentation

◆ Section() [1/2]

Section::Section ( BNSection *  sec)

◆ Section() [2/2]

BinaryNinja::Section::Section ( const std::string &  name,
uint64_t  start,
uint64_t  length,
BNSectionSemantics  semantics,
const std::string &  type,
uint64_t  align,
uint64_t  entrySize,
const std::string &  linkedSection,
const std::string &  infoSection,
uint64_t  infoData,
bool  autoDefined 
)

Member Function Documentation

◆ GetName()

std::string Section::GetName ( ) const

◆ GetType()

std::string Section::GetType ( ) const

◆ GetStart()

uint64_t Section::GetStart ( ) const

◆ GetLength()

uint64_t Section::GetLength ( ) const

◆ GetInfoData()

uint64_t Section::GetInfoData ( ) const

◆ GetAlignment()

uint64_t Section::GetAlignment ( ) const

◆ GetEntrySize()

uint64_t Section::GetEntrySize ( ) const

◆ GetLinkedSection()

std::string Section::GetLinkedSection ( ) const

◆ GetInfoSection()

std::string Section::GetInfoSection ( ) const

◆ GetSemantics()

BNSectionSemantics Section::GetSemantics ( ) const

◆ AutoDefined()

bool Section::AutoDefined ( ) const

◆ BinaryNinja::BinaryView

class BinaryNinja::BinaryView

BinaryView implements a view on binary data, and presents a queryable interface of a binary file.

One key job of BinaryView is file format parsing which allows Binary Ninja to read, write, insert, remove portions of the file given a virtual address. For the purposes of this documentation we define a virtual address as the memory address that the various pieces of the physical file will be loaded at.

A binary file does not have to have just one BinaryView, thus much of the interface to manipulate disassembly exists within or is accessed through a BinaryView. All files are guaranteed to have at least the Raw BinaryView. The Raw BinaryView is simply a hex editor, but is helpful for manipulating binary files via their absolute addresses.

BinaryViews are plugins and thus registered with Binary Ninja at startup, and thus should never be instantiated directly as this is already done. The list of available BinaryViews can be seen in the BinaryViewType class which provides an iterator and map of the various installed BinaryViews:

// Getting a list of valid BinaryViewTypes
vector<Ref<BinaryViewType>> types = BinaryViewType::GetViewTypes()
// Getting a list of valid BinaryViewTypes valid for given data
vector<Ref<BinaryViewType>> types = BinaryViewType::GetViewTypesForData(bv);
Ref<BinaryViewType> machoType = BinaryViewType::GetByName("Mach-O");
static std::vector< Ref< BinaryViewType > > GetViewTypes()
Get the list of registered View Types.
Definition: binaryviewtype.cpp:113
The BinaryViewType object is used internally and should not be directly instantiated.
Definition: binaryninjaapi.h:5237
Definition: binaryninjaapi.h:231
See also
BinaryViewType

In the python console:

>>> list(BinaryViewType)
[<view type: 'Raw'>, <view type: 'ELF'>, <view type: 'Mach-O'>, <view type: 'PE'>]
>>> BinaryViewType['ELF']
<view type: 'ELF'>

To open a file with a given BinaryView the following code is recommended:

auto bv = OpenView("/bin/ls");
Ref< BinaryView > OpenView(const std::string &filename, bool updateAnalysis=true, std::function< bool(size_t, size_t)> progress={}, Json::Value options=Json::Value(Json::objectValue))
OpenView opens a file on disk and returns a BinaryView, attempting to use the most relevant BinaryVie...
Definition: binaryview.cpp:4570
Remarks
By convention in the rest of this document we will use bv to mean an open and, analyzed, BinaryView of an executable file.

When a BinaryView is open on an executable view analysis is automatically run unless specific named parameters are used to disable updates. If such a parameter is used, updates can be triggered using the UpdateAnalysisAndWait() method which disassembles the executable and returns when all disassembly and analysis is complete:

bv->UpdateAnalysisAndWait();

Since BinaryNinja's analysis is multi-threaded this can also be done in the background by using the UpdateAnalysis method instead.

Note
An important note on the *User*() methods. Binary Ninja makes a distinction between edits performed by the user and actions performed by auto analysis. Auto analysis actions that can quickly be recalculated are not saved to the database. Auto analysis actions that take a long time and all user edits are stored in the database (e.g. RemoveUserFunction rather than RemoveFunction ). Thus use *User*() methods if saving to the database is desired.

Public Member Functions

 BinaryView (BNBinaryView *view)
 
virtual bool Init ()
 
FileMetadataGetFile () const
 
Ref< BinaryViewGetParentView () const
 
std::string GetTypeName () const
 
bool IsModified () const
 
bool IsAnalysisChanged () const
 
bool CreateDatabase (const std::string &path, Ref< SaveSettings > settings=new SaveSettings())
 Writes the current database (.bndb) out to the specified file. More...
 
bool CreateDatabase (const std::string &path, const std::function< bool(size_t progress, size_t total)> &progressCallback, Ref< SaveSettings > settings=new SaveSettings())
 Writes the current database (.bndb) out to the specified file. More...
 
bool SaveAutoSnapshot (Ref< SaveSettings > settings=new SaveSettings())
 
bool SaveAutoSnapshot (const std::function< bool(size_t progress, size_t total)> &progressCallback, Ref< SaveSettings > settings=new SaveSettings())
 
void BeginUndoActions ()
 Start recording actions taken so they can be undone at some point. More...
 
void AddUndoAction (UndoAction *action)
 
void CommitUndoActions ()
 Commit the actions taken since the last commit to the undo database. More...
 
bool CanUndo ()
 
bool Undo ()
 Undo the last committed action in the undo database. More...
 
bool CanRedo ()
 
bool Redo ()
 Redo the last committed action in the undo database. More...
 
std::string GetCurrentView ()
 Get the current View name, e.g. More...
 
uint64_t GetCurrentOffset ()
 Get the current offset in the current view. More...
 
bool Navigate (const std::string &view, uint64_t offset)
 Navigate to the specified virtual address in the specified view. More...
 
size_t Read (void *dest, uint64_t offset, size_t len)
 Read writes len bytes at virtual address offset to address dest More...
 
DataBuffer ReadBuffer (uint64_t offset, size_t len)
 ReadBuffer reads len bytes from a virtual address into a DataBuffer. More...
 
size_t Write (uint64_t offset, const void *data, size_t len)
 Write writes len bytes data at address dest to virtual address offset More...
 
size_t WriteBuffer (uint64_t offset, const DataBuffer &data)
 WriteBuffer writes the contents of a DataBuffer into a virtual address. More...
 
size_t Insert (uint64_t offset, const void *data, size_t len)
 Insert inserts len bytes data at address dest starting from virtual address offset More...
 
size_t InsertBuffer (uint64_t offset, const DataBuffer &data)
 InsertBuffer inserts the contents of a DataBuffer starting from a virtual address. More...
 
size_t Remove (uint64_t offset, uint64_t len)
 PerformRemove removes len bytes from virtual address offset More...
 
std::vector< float > GetEntropy (uint64_t offset, size_t len, size_t blockSize)
 
BNModificationStatus GetModification (uint64_t offset)
 GetModification checks whether the virtual address offset is modified. More...
 
std::vector< BNModificationStatusGetModification (uint64_t offset, size_t len)
 
bool IsValidOffset (uint64_t offset) const
 IsValidOffset checks whether a virtual address offset is valid. More...
 
bool IsOffsetReadable (uint64_t offset) const
 IsOffsetReadable checks whether a virtual address is readable. More...
 
bool IsOffsetWritable (uint64_t offset) const
 IsOffsetWritable checks whether a virtual address is writable. More...
 
bool IsOffsetExecutable (uint64_t offset) const
 IsOffsetExecutable checks whether a virtual address is executable. More...
 
bool IsOffsetBackedByFile (uint64_t offset) const
 IsOffsetBackedByFile checks whether a virtual address is backed by a file. More...
 
bool IsOffsetCodeSemantics (uint64_t offset) const
 
bool IsOffsetWritableSemantics (uint64_t offset) const
 
bool IsOffsetExternSemantics (uint64_t offset) const
 
uint64_t GetNextValidOffset (uint64_t offset) const
 GetNextValidOffset implements a query for the next valid readable, writable, or executable virtual memory address after offset More...
 
uint64_t GetStart () const
 GetStart queries for the first valid virtual address in the BinaryView. More...
 
uint64_t GetEnd () const
 GetEnd queries for the first valid virtual address in the BinaryView. More...
 
uint64_t GetLength () const
 GetLength queries for the total length of the BinaryView from start to end. More...
 
uint64_t GetEntryPoint () const
 GetEntryPoint returns the entry point of the executable in the BinaryView. More...
 
Ref< ArchitectureGetDefaultArchitecture () const
 GetDefaultArchitecture returns the current "default architecture" for the BinaryView. More...
 
void SetDefaultArchitecture (Architecture *arch)
 SetDefaultArchitecture allows setting the default architecture for the BinaryView. More...
 
Ref< PlatformGetDefaultPlatform () const
 GetDefaultPlatform returns the current default platform for the BinaryView. More...
 
void SetDefaultPlatform (Platform *platform)
 SetDefaultPlatform allows setting the default platform for the BinaryView. More...
 
BNEndianness GetDefaultEndianness () const
 GetDefaultEndianness returns the default endianness for the BinaryView. More...
 
bool IsRelocatable () const
 Whether the binary is relocatable. More...
 
size_t GetAddressSize () const
 Address size of the binary. More...
 
bool IsExecutable () const
 Whether the binary is an executable. More...
 
bool Save (FileAccessor *file)
 Save the original binary file to a FileAccessor. More...
 
bool Save (const std::string &path)
 Save the original binary file to the provided destination. More...
 
void DefineRelocation (Architecture *arch, BNRelocationInfo &info, uint64_t target, uint64_t reloc)
 
void DefineRelocation (Architecture *arch, BNRelocationInfo &info, Ref< Symbol > target, uint64_t reloc)
 
std::vector< std::pair< uint64_t, uint64_t > > GetRelocationRanges () const
 
std::vector< std::pair< uint64_t, uint64_t > > GetRelocationRangesAtAddress (uint64_t addr) const
 
bool RangeContainsRelocation (uint64_t addr, size_t size) const
 
void RegisterNotification (BinaryDataNotification *notify)
 Provides a mechanism for receiving callbacks for various analysis events. More...
 
void UnregisterNotification (BinaryDataNotification *notify)
 Unregister a notification passed to RegisterNotification. More...
 
void AddAnalysisOption (const std::string &name)
 Adds an analysis option. More...
 
Ref< FunctionAddFunctionForAnalysis (Platform *platform, uint64_t addr, bool autoDiscovered=false, Type *type=nullptr)
 Add a new function of the given platform at the virtual address. More...
 
void AddEntryPointForAnalysis (Platform *platform, uint64_t start)
 adds an virtual address to start analysis from for a given platform More...
 
void RemoveAnalysisFunction (Function *func, bool updateRefs=false)
 removes a function from the list of functions More...
 
void CreateUserFunction (Platform *platform, uint64_t start)
 Add a new user function of the given platform at the virtual address. More...
 
void RemoveUserFunction (Function *func)
 removes a user function from the list of functions More...
 
bool HasInitialAnalysis ()
 check for the presence of an initial analysis in this BinaryView. More...
 
void SetAnalysisHold (bool enable)
 Controls the analysis hold for this BinaryView. More...
 
void UpdateAnalysisAndWait ()
 start the analysis running and dont return till it is complete More...
 
void UpdateAnalysis ()
 asynchronously starts the analysis running and returns immediately. More...
 
void AbortAnalysis ()
 Abort the currently running analysis. More...
 
void DefineDataVariable (uint64_t addr, const Confidence< Ref< Type > > &type)
 Define a DataVariable at a given address with a set type. More...
 
void DefineUserDataVariable (uint64_t addr, const Confidence< Ref< Type > > &type)
 Define a user DataVariable at a given address with a set type. More...
 
void UndefineDataVariable (uint64_t addr)
 Undefine a DataVariable at a given address. More...
 
void UndefineUserDataVariable (uint64_t addr)
 Undefine a user DataVariable at a given address. More...
 
std::map< uint64_t, DataVariableGetDataVariables ()
 Get a map of DataVariables defined in the current BinaryView. More...
 
bool GetDataVariableAtAddress (uint64_t addr, DataVariable &var)
 Get a DataVariable at a given address. More...
 
std::vector< Ref< Function > > GetAnalysisFunctionList ()
 Get a list of functions within this BinaryView. More...
 
bool HasFunctions () const
 Check whether the BinaryView has any functions defined. More...
 
Ref< FunctionGetAnalysisFunction (Platform *platform, uint64_t addr)
 Gets a function object for the function starting at a virtual address. More...
 
Ref< FunctionGetRecentAnalysisFunctionForAddress (uint64_t addr)
 Get the most recently used Function starting at a virtual address. More...
 
std::vector< Ref< Function > > GetAnalysisFunctionsForAddress (uint64_t addr)
 Get a list of functions defined at an address. More...
 
std::vector< Ref< Function > > GetAnalysisFunctionsContainingAddress (uint64_t addr)
 Get a list of functions containing an address. More...
 
Ref< FunctionGetAnalysisEntryPoint ()
 Get the function defined as the Analysis entry point for the view. More...
 
Ref< BasicBlockGetRecentBasicBlockForAddress (uint64_t addr)
 Get most recently used Basic Block containing a virtual address. More...
 
std::vector< Ref< BasicBlock > > GetBasicBlocksForAddress (uint64_t addr)
 Get a list of Basic Blocks containing a virtual address. More...
 
std::vector< Ref< BasicBlock > > GetBasicBlocksStartingAtAddress (uint64_t addr)
 Get a list of basic blocks starting at a virtual address. More...
 
std::vector< ReferenceSourceGetCodeReferences (uint64_t addr)
 Get a list of references made from code (instructions) to a virtual address. More...
 
std::vector< ReferenceSourceGetCodeReferences (uint64_t addr, uint64_t len)
 Get a list of references from code (instructions) to a range of addresses. More...
 
std::vector< uint64_t > GetCodeReferencesFrom (ReferenceSource src)
 Get code references made by a particular "ReferenceSource". More...
 
std::vector< uint64_t > GetCodeReferencesFrom (ReferenceSource src, uint64_t len)
 Get code references from a range of addresses. More...
 
std::vector< uint64_t > GetDataReferences (uint64_t addr)
 Get references made by data ('DataVariables') to a virtual address. More...
 
std::vector< uint64_t > GetDataReferences (uint64_t addr, uint64_t len)
 Get references made by data ('DataVariables') in a given range, to a virtual address. More...
 
std::vector< uint64_t > GetDataReferencesFrom (uint64_t addr)
 Get references made by data ('DataVariables') located at a virtual address. More...
 
std::vector< uint64_t > GetDataReferencesFrom (uint64_t addr, uint64_t len)
 Get references made by data ('DataVariables') located in a range of virtual addresses. More...
 
void AddUserDataReference (uint64_t fromAddr, uint64_t toAddr)
 Add a user Data Reference from a virtual address to another virtual address. More...
 
void RemoveUserDataReference (uint64_t fromAddr, uint64_t toAddr)
 Remove a user Data Reference from a virtual address to another virtual address. More...
 
std::vector< ReferenceSourceGetCodeReferencesForType (const QualifiedName &type)
 Get code references to a Type. More...
 
std::vector< uint64_t > GetDataReferencesForType (const QualifiedName &type)
 Get data references to a Type. More...
 
std::vector< TypeReferenceSourceGetTypeReferencesForType (const QualifiedName &type)
 Get Type references to a Type. More...
 
std::vector< TypeFieldReferenceGetCodeReferencesForTypeField (const QualifiedName &type, uint64_t offset)
 Returns a list of references to a specific type field. More...
 
std::vector< uint64_t > GetDataReferencesForTypeField (const QualifiedName &type, uint64_t offset)
 Returns a list of virtual addresses of data which references the type type . More...
 
std::vector< uint64_t > GetDataReferencesFromForTypeField (const QualifiedName &type, uint64_t offset)
 Returns a list of virtual addresses of data which are referenced from the type type . More...
 
std::vector< TypeReferenceSourceGetTypeReferencesForTypeField (const QualifiedName &type, uint64_t offset)
 Returns a list of type references to a specific type field. More...
 
std::vector< TypeReferenceSourceGetCodeReferencesForTypeFrom (ReferenceSource src)
 Returns a list of types referenced by code at ReferenceSource src. More...
 
std::vector< TypeReferenceSourceGetCodeReferencesForTypeFrom (ReferenceSource src, uint64_t len)
 Returns a list of types referenced by code at ReferenceSource src. More...
 
std::vector< TypeReferenceSourceGetCodeReferencesForTypeFieldFrom (ReferenceSource src)
 Returns a list of type fields referenced by code at ReferenceSource src. More...
 
std::vector< TypeReferenceSourceGetCodeReferencesForTypeFieldFrom (ReferenceSource src, uint64_t len)
 Returns a list of type fields referenced by code at ReferenceSource src. More...
 
std::vector< uint64_t > GetAllFieldsReferenced (const QualifiedName &type)
 Returns a list of offsets in the QualifiedName specified by name, which are referenced by code. More...
 
std::map< uint64_t, std::vector< size_t > > GetAllSizesReferenced (const QualifiedName &type)
 Returns a map from field offset to a list of sizes of the accesses to the specified type. More...
 
std::map< uint64_t, std::vector< Confidence< Ref< Type > > > > GetAllTypesReferenced (const QualifiedName &type)
 Returns a map from field offset to a list of incoming types written to the specified type. More...
 
std::vector< size_t > GetSizesReferenced (const QualifiedName &type, uint64_t offset)
 Returns a list of types related to the type field access. More...
 
std::vector< Confidence< Ref< Type > > > GetTypesReferenced (const QualifiedName &type, uint64_t offset)
 Returns a list of types referenced by a particular type field. More...
 
Ref< StructureCreateStructureBasedOnFieldAccesses (const QualifiedName &type)
 
std::vector< uint64_t > GetCallees (ReferenceSource addr)
 Returns a list of virtual addresses called by the call site in the ReferenceSource. More...
 
std::vector< ReferenceSourceGetCallers (uint64_t addr)
 Returns a list of ReferenceSource objects (xrefs or cross-references) that call the provided virtual address. More...
 
Ref< SymbolGetSymbolByAddress (uint64_t addr, const NameSpace &nameSpace=NameSpace())
 Returns the Symbol at the provided virtual address. More...
 
Ref< SymbolGetSymbolByRawName (const std::string &name, const NameSpace &nameSpace=NameSpace())
 Retrieves a Symbol object for the given a raw (mangled) name. More...
 
std::vector< Ref< Symbol > > GetSymbolsByName (const std::string &name, const NameSpace &nameSpace=NameSpace())
 Retrieves a list of symbols with a given name. More...
 
std::vector< Ref< Symbol > > GetSymbolsByRawName (const std::string &name, const NameSpace &nameSpace=NameSpace())
 Retrieves the list of all Symbol objects with a given raw name. More...
 
std::vector< Ref< Symbol > > GetSymbols (const NameSpace &nameSpace=NameSpace())
 Retrieves the list of all Symbol objects. More...
 
std::vector< Ref< Symbol > > GetSymbols (uint64_t start, uint64_t len, const NameSpace &nameSpace=NameSpace())
 Retrieves a list of symbols in a given range. More...
 
std::vector< Ref< Symbol > > GetSymbolsOfType (BNSymbolType type, const NameSpace &nameSpace=NameSpace())
 Retrieves a list of all Symbol objects of the provided symbol type. More...
 
std::vector< Ref< Symbol > > GetSymbolsOfType (BNSymbolType type, uint64_t start, uint64_t len, const NameSpace &nameSpace=NameSpace())
 Retrieves a list of all Symbol objects of the provided symbol type in the given range. More...
 
std::vector< Ref< Symbol > > GetVisibleSymbols (const NameSpace &nameSpace=NameSpace())
 Get the list of visible symbols. More...
 
void DefineAutoSymbol (Ref< Symbol > sym)
 Adds a symbol to the internal list of automatically discovered Symbol objects in a given namespace. More...
 
Ref< SymbolDefineAutoSymbolAndVariableOrFunction (Ref< Platform > platform, Ref< Symbol > sym, Ref< Type > type)
 Defines an "Auto" symbol, and a Variable/Function alongside it. More...
 
void UndefineAutoSymbol (Ref< Symbol > sym)
 Undefine an automatically defined symbol. More...
 
void DefineUserSymbol (Ref< Symbol > sym)
 Define a user symbol. More...
 
void UndefineUserSymbol (Ref< Symbol > sym)
 Undefine a user symbol. More...
 
void DefineImportedFunction (Ref< Symbol > importAddressSym, Ref< Function > func, Ref< Type > type=nullptr)
 Defines an imported Function func with a ImportedFunctionSymbol type. More...
 
Ref< DebugInfoGetDebugInfo ()
 The current debug info object for this binary view. More...
 
void ApplyDebugInfo (Ref< DebugInfo > newDebugInfo)
 Sets the debug info and applies its contents to the current BinaryView. More...
 
void SetDebugInfo (Ref< DebugInfo > newDebugInfo)
 Sets the debug info for the current binary view. More...
 
bool IsApplyingDebugInfo () const
 Determine is a debug info object is currently being applied. More...
 
void BeginBulkModifySymbols ()
 
void EndBulkModifySymbols ()
 
void AddTagType (Ref< TagType > tagType)
 Add a new TagType to this binaryview. More...
 
void RemoveTagType (Ref< TagType > tagType)
 Remove a TagType from this binaryview. More...
 
Ref< TagTypeGetTagType (const std::string &name)
 Get a TagType by name. More...
 
Ref< TagTypeGetTagType (const std::string &name, TagType::Type type)
 Get a TagType by name and TagType::Type. More...
 
Ref< TagTypeGetTagTypeByName (const std::string &name)
 Get a TagType by name. More...
 
Ref< TagTypeGetTagTypeByName (const std::string &name, TagType::Type type)
 Get a TagType by name and TagType::Type. More...
 
Ref< TagTypeGetTagTypeById (const std::string &id)
 Get a TagType by its ID. More...
 
Ref< TagTypeGetTagTypeById (const std::string &id, TagType::Type type)
 Get a TagType by its ID and TagType::Type. More...
 
std::vector< Ref< TagType > > GetTagTypes ()
 Get the list of all defined TagTypes. More...
 
void AddTag (Ref< Tag > tag, bool user=false)
 Add a Tag. More...
 
void RemoveTag (Ref< Tag > tag, bool user=false)
 Remove a tag. More...
 
Ref< TagGetTag (const std::string &tagId)
 Get a tag by its ID. More...
 
std::vector< TagReferenceGetAllTagReferences ()
 
std::vector< TagReferenceGetAllAddressTagReferences ()
 
std::vector< TagReferenceGetAllFunctionTagReferences ()
 
std::vector< TagReferenceGetAllTagReferencesOfType (Ref< TagType > tagType)
 
std::vector< TagReferenceGetTagReferencesOfType (Ref< TagType > tagType)
 
size_t GetTagReferencesOfTypeCount (Ref< TagType > tagType)
 
size_t GetAllTagReferencesOfTypeCount (Ref< TagType > tagType)
 
std::map< Ref< TagType >, size_t > GetAllTagReferenceTypeCounts ()
 
std::vector< TagReferenceGetDataTagReferences ()
 
std::vector< TagReferenceGetAutoDataTagReferences ()
 
std::vector< TagReferenceGetUserDataTagReferences ()
 
std::vector< Ref< Tag > > GetDataTags (uint64_t addr)
 
std::vector< Ref< Tag > > GetAutoDataTags (uint64_t addr)
 
std::vector< Ref< Tag > > GetUserDataTags (uint64_t addr)
 
std::vector< Ref< Tag > > GetDataTagsOfType (uint64_t addr, Ref< TagType > tagType)
 
std::vector< Ref< Tag > > GetAutoDataTagsOfType (uint64_t addr, Ref< TagType > tagType)
 
std::vector< Ref< Tag > > GetUserDataTagsOfType (uint64_t addr, Ref< TagType > tagType)
 
std::vector< TagReferenceGetDataTagsInRange (uint64_t start, uint64_t end)
 
std::vector< TagReferenceGetAutoDataTagsInRange (uint64_t start, uint64_t end)
 
std::vector< TagReferenceGetUserDataTagsInRange (uint64_t start, uint64_t end)
 
void AddAutoDataTag (uint64_t addr, Ref< Tag > tag)
 
void RemoveAutoDataTag (uint64_t addr, Ref< Tag > tag)
 
void RemoveAutoDataTagsOfType (uint64_t addr, Ref< TagType > tagType)
 
void AddUserDataTag (uint64_t addr, Ref< Tag > tag)
 
void RemoveUserDataTag (uint64_t addr, Ref< Tag > tag)
 
void RemoveUserDataTagsOfType (uint64_t addr, Ref< TagType > tagType)
 
void RemoveTagReference (const TagReference &ref)
 
Ref< TagCreateAutoDataTag (uint64_t addr, const std::string &tagTypeName, const std::string &data, bool unique=false)
 
Ref< TagCreateUserDataTag (uint64_t addr, const std::string &tagTypeName, const std::string &data, bool unique=false)
 
Ref< TagCreateAutoDataTag (uint64_t addr, Ref< TagType > tagType, const std::string &data, bool unique=false)
 
Ref< TagCreateUserDataTag (uint64_t addr, Ref< TagType > tagType, const std::string &data, bool unique=false)
 
std::optional< Ref< Component > > GetComponentByGuid (std::string guid)
 Lookup a component by its GUID. More...
 
std::optional< Ref< Component > > GetComponentByPath (std::string path)
 Lookup a component by its pathname. More...
 
Ref< ComponentGetRootComponent ()
 Get the root component for the BinaryView (read-only) More...
 
Ref< ComponentCreateComponent ()
 Create a component. More...
 
Ref< ComponentCreateComponent (std::string parentGUID)
 Create a component as a subcomponent of the component with a given Guid. More...
 
Ref< ComponentCreateComponent (Ref< Component > parent)
 Create a component as a subcomponent of a given Component. More...
 
Ref< ComponentCreateComponentWithName (std::string name, std::string parentGUID={})
 Create a component with a given name and optional parent. More...
 
Ref< ComponentCreateComponentWithName (std::string name, Ref< Component > parent)
 Create a component with a given name and parent. More...
 
bool RemoveComponent (Ref< Component > component)
 Remove a component from the tree entirely. More...
 
bool RemoveComponent (std::string guid)
 Remove a component from the tree entirely. More...
 
std::vector< Ref< Component > > GetFunctionParentComponents (Ref< Function > function) const
 
std::vector< Ref< Component > > GetDataVariableParentComponents (DataVariable var) const
 
bool CanAssemble (Architecture *arch)
 Check whether the given architecture supports assembling instructions. More...
 
bool IsNeverBranchPatchAvailable (Architecture *arch, uint64_t addr)
 Check whether the "Never Branch" patch is available for a given architecture at a given address. More...
 
bool IsAlwaysBranchPatchAvailable (Architecture *arch, uint64_t addr)
 Check whether the "Always Branch" patch is available for a given architecture at a given address. More...
 
bool IsInvertBranchPatchAvailable (Architecture *arch, uint64_t addr)
 Check whether the "Invert Branch" patch is available for a given architecture at a given address. More...
 
bool IsSkipAndReturnZeroPatchAvailable (Architecture *arch, uint64_t addr)
 Check whether the "Skip and Return Zero" patch is available for a given architecture at a given address. More...
 
bool IsSkipAndReturnValuePatchAvailable (Architecture *arch, uint64_t addr)
 Check whether the "Skip and Return Value" patch is available for a given architecture at a given address. More...
 
bool ConvertToNop (Architecture *arch, uint64_t addr)
 Convert the instruction at the given address to a nop. More...
 
bool AlwaysBranch (Architecture *arch, uint64_t addr)
 Convert the conditional branch at the given address to always branch. More...
 
bool InvertBranch (Architecture *arch, uint64_t addr)
 Convert the conditional branch at the given address to branch under inverted conditions. More...
 
bool SkipAndReturnValue (Architecture *arch, uint64_t addr, uint64_t value)
 Convert the given instruction to skip the rest of the function and return 0. More...
 
size_t GetInstructionLength (Architecture *arch, uint64_t addr)
 Get the length of the instruction at a given address. More...
 
bool GetStringAtAddress (uint64_t addr, BNStringReference &strRef)
 Get the string at an address. More...
 
std::vector< BNStringReferenceGetStrings ()
 Get the list of strings located within the view. More...
 
std::vector< BNStringReferenceGetStrings (uint64_t start, uint64_t len)
 Get the list of strings located within a range. More...
 
Ref< AnalysisCompletionEventAddAnalysisCompletionEvent (const std::function< void()> &callback)
 Sets up a call back function to be called when analysis has been completed. More...
 
AnalysisInfo GetAnalysisInfo ()
 
BNAnalysisProgress GetAnalysisProgress ()
 
Ref< BackgroundTaskGetBackgroundAnalysisTask ()
 
uint64_t GetNextFunctionStartAfterAddress (uint64_t addr)
 Returns the virtual address of the Function that occurs after the virtual address addr More...
 
uint64_t GetNextBasicBlockStartAfterAddress (uint64_t addr)
 Returns the virtual address of the BasicBlock that occurs after the virtual address addr More...
 
uint64_t GetNextDataAfterAddress (uint64_t addr)
 Retrieves the virtual address of the next non-code byte. More...
 
uint64_t GetNextDataVariableStartAfterAddress (uint64_t addr)
 Retrieves the address of the next DataVariable. More...
 
uint64_t GetPreviousFunctionStartBeforeAddress (uint64_t addr)
 Returns the virtual address of the Function that occurs prior to the virtual address provided. More...
 
uint64_t GetPreviousBasicBlockStartBeforeAddress (uint64_t addr)
 Returns the virtual address of the Basic Block that occurs prior to the virtual address provided. More...
 
uint64_t GetPreviousBasicBlockEndBeforeAddress (uint64_t addr)
 Returns the ending virtual address of the Basic Block that occurs prior to the virtual address provided. More...
 
uint64_t GetPreviousDataBeforeAddress (uint64_t addr)
 Returns the virtual address of the previous data (non-code) byte. More...
 
uint64_t GetPreviousDataVariableStartBeforeAddress (uint64_t addr)
 Returns the virtual address of the previous DataVariable. More...
 
bool ParsePossibleValueSet (const std::string &value, BNRegisterValueType state, PossibleValueSet &result, uint64_t here, std::string &errors)
 
bool ParseTypeString (const std::string &text, QualifiedNameAndType &result, std::string &errors, const std::set< QualifiedName > &typesAllowRedefinition={})
 Parse a single type and name from a string containing their definition. More...
 
bool ParseTypeString (const std::string &text, std::map< QualifiedName, Ref< Type > > &types, std::map< QualifiedName, Ref< Type > > &variables, std::map< QualifiedName, Ref< Type > > &functions, std::string &errors, const std::set< QualifiedName > &typesAllowRedefinition={})
 Parse an entire block of source into types, variables, and functions. More...
 
bool ParseTypesFromSource (const std::string &text, const std::vector< std::string > &options, const std::vector< std::string > &includeDirs, TypeParserResult &result, std::string &errors, const std::set< QualifiedName > &typesAllowRedefinition={})
 
std::map< QualifiedName, Ref< Type > > GetTypes ()
 
std::vector< std::pair< QualifiedName, Ref< Type > > > GetDependencySortedTypes ()
 List of all types, sorted such that types are after all types on which they depend. More...
 
std::vector< QualifiedNameGetTypeNames (const std::string &matching="")
 
Ref< TypeGetTypeByName (const QualifiedName &name)
 
Ref< TypeGetTypeByRef (Ref< NamedTypeReference > name)
 
Ref< TypeGetTypeById (const std::string &id)
 
std::string GetTypeId (const QualifiedName &name)
 
QualifiedName GetTypeNameById (const std::string &id)
 
bool IsTypeAutoDefined (const QualifiedName &name)
 
QualifiedName DefineType (const std::string &id, const QualifiedName &defaultName, Ref< Type > type)
 
void DefineTypes (const std::vector< std::pair< std::string, QualifiedNameAndType > > &types, std::function< bool(size_t, size_t)> progress={})
 
void DefineUserType (const QualifiedName &name, Ref< Type > type)
 
void DefineUserTypes (const std::vector< QualifiedNameAndType > &types, std::function< bool(size_t, size_t)> progress={})
 
void DefineUserTypes (const std::vector< ParsedType > &types, std::function< bool(size_t, size_t)> progress={})
 
void UndefineType (const std::string &id)
 
void UndefineUserType (const QualifiedName &name)
 
void RenameType (const QualifiedName &oldName, const QualifiedName &newName)
 
void RegisterPlatformTypes (Platform *platform)
 
std::optional< std::pair< Ref< Platform >, QualifiedName > > LookupImportedTypePlatform (const QualifiedName &name)
 Gives you details of which platform and name was imported to result in the given type name. More...
 
void AddTypeLibrary (TypeLibrary *lib)
 Make the contents of a type library available for type/import resolution. More...
 
Ref< TypeLibraryGetTypeLibrary (const std::string &name)
 Get the type library with the given name. More...
 
std::vector< Ref< TypeLibrary > > GetTypeLibraries ()
 Get the list of imported type libraries. More...
 
Ref< TypeImportTypeLibraryType (Ref< TypeLibrary > &lib, const QualifiedName &name)
 Recursively imports a type from the specified type library, or, if no library was explicitly provided, the first type library associated with the current BinaryView that provides the name requested. More...
 
Ref< TypeImportTypeLibraryObject (Ref< TypeLibrary > &lib, const QualifiedName &name)
 Recursively imports an object from the specified type library, or, if no library was explicitly provided, the first type library associated with the current BinaryView that provides the name requested. More...
 
void ExportTypeToTypeLibrary (TypeLibrary *lib, const QualifiedName &name, Type *type)
 Recursively exports type into lib as a type with name name More...
 
void ExportObjectToTypeLibrary (TypeLibrary *lib, const QualifiedName &name, Type *type)
 Recursively exports type into lib as an object with name name More...
 
void RecordImportedObjectLibrary (Platform *tgtPlatform, uint64_t tgtAddr, TypeLibrary *lib, const QualifiedName &name)
 Should be called by custom BinaryView implementations when they have successfully imported an object from a type library (eg a symbol's type). More...
 
std::optional< std::pair< Ref< TypeLibrary >, QualifiedName > > LookupImportedObjectLibrary (Platform *tgtPlatform, uint64_t tgtAddr)
 Gives you details of which type library and name was used to determine the type of a symbol at a given address. More...
 
std::optional< std::pair< Ref< TypeLibrary >, QualifiedName > > LookupImportedTypeLibrary (const QualifiedName &name)
 Gives you details of which type library and name was imported to result in the given type name. More...
 
bool FindNextData (uint64_t start, const DataBuffer &data, uint64_t &result, BNFindFlag flags=FindCaseSensitive)
 
bool FindNextText (uint64_t start, const std::string &data, uint64_t &result, Ref< DisassemblySettings > settings, BNFindFlag flags=FindCaseSensitive, BNFunctionGraphType graph=NormalFunctionGraph)
 
bool FindNextConstant (uint64_t start, uint64_t constant, uint64_t &result, Ref< DisassemblySettings > settings, BNFunctionGraphType graph=NormalFunctionGraph)
 
bool FindNextData (uint64_t start, uint64_t end, const DataBuffer &data, uint64_t &addr, BNFindFlag flags, const std::function< bool(size_t current, size_t total)> &progress)
 
bool FindNextText (uint64_t start, uint64_t end, const std::string &data, uint64_t &addr, Ref< DisassemblySettings > settings, BNFindFlag flags, BNFunctionGraphType graph, const std::function< bool(size_t current, size_t total)> &progress)
 
bool FindNextConstant (uint64_t start, uint64_t end, uint64_t constant, uint64_t &addr, Ref< DisassemblySettings > settings, BNFunctionGraphType graph, const std::function< bool(size_t current, size_t total)> &progress)
 
bool FindAllData (uint64_t start, uint64_t end, const DataBuffer &data, BNFindFlag flags, const std::function< bool(size_t current, size_t total)> &progress, const std::function< bool(uint64_t addr, const DataBuffer &match)> &matchCallback)
 
bool FindAllText (uint64_t start, uint64_t end, const std::string &data, Ref< DisassemblySettings > settings, BNFindFlag flags, BNFunctionGraphType graph, const std::function< bool(size_t current, size_t total)> &progress, const std::function< bool(uint64_t addr, const std::string &match, const LinearDisassemblyLine &line)> &matchCallback)
 
bool FindAllConstant (uint64_t start, uint64_t end, uint64_t constant, Ref< DisassemblySettings > settings, BNFunctionGraphType graph, const std::function< bool(size_t current, size_t total)> &progress, const std::function< bool(uint64_t addr, const LinearDisassemblyLine &line)> &matchCallback)
 
void Reanalyze ()
 
Ref< WorkflowGetWorkflow () const
 
void ShowPlainTextReport (const std::string &title, const std::string &contents)
 Displays contents to the user in the UI or on the command-line. More...
 
void ShowMarkdownReport (const std::string &title, const std::string &contents, const std::string &plainText)
 Displays markdown contents to the user in the UI or on the command-line. More...
 
void ShowHTMLReport (const std::string &title, const std::string &contents, const std::string &plainText)
 Displays HTML contents to the user in the UI or on the command-line. More...
 
void ShowGraphReport (const std::string &title, FlowGraph *graph)
 Displays a flow graph in UI applications and nothing in command-line applications. More...
 
bool GetAddressInput (uint64_t &result, const std::string &prompt, const std::string &title)
 Prompts the user to input an unsigned integer with the given prompt and title. More...
 
bool GetAddressInput (uint64_t &result, const std::string &prompt, const std::string &title, uint64_t currentAddress)
 Prompts the user to input an unsigned integer with the given prompt and title. More...
 
void AddAutoSegment (uint64_t start, uint64_t length, uint64_t dataOffset, uint64_t dataLength, uint32_t flags)
 Add an analysis segment that specifies how data from the raw file is mapped into a virtual address space. More...
 
void RemoveAutoSegment (uint64_t start, uint64_t length)
 Removes an automatically generated segment from the current segment mapping. More...
 
void AddUserSegment (uint64_t start, uint64_t length, uint64_t dataOffset, uint64_t dataLength, uint32_t flags)
 Creates a user-defined segment that specifies how data from the raw file is mapped into a virtual address space. More...
 
void RemoveUserSegment (uint64_t start, uint64_t length)
 Removes a user-defined segment from th current segment mapping. More...
 
std::vector< Ref< Segment > > GetSegments ()
 Get the list of registered Segments. More...
 
Ref< SegmentGetSegmentAt (uint64_t addr)
 Gets the Segment a given virtual address is located in. More...
 
bool GetAddressForDataOffset (uint64_t offset, uint64_t &addr)
 Retrieves the virtual addreses that maps to the given file offset, if possible. More...
 
void AddAutoSection (const std::string &name, uint64_t start, uint64_t length, BNSectionSemantics semantics=DefaultSectionSemantics, const std::string &type="", uint64_t align=1, uint64_t entrySize=0, const std::string &linkedSection="", const std::string &infoSection="", uint64_t infoData=0)
 Creates an analysis-defined section that can help inform analysis by clarifying what types of data exist in what ranges. More...
 
void RemoveAutoSection (const std::string &name)
 Remove an automatically defined section by name. More...
 
void AddUserSection (const std::string &name, uint64_t start, uint64_t length, BNSectionSemantics semantics=DefaultSectionSemantics, const std::string &type="", uint64_t align=1, uint64_t entrySize=0, const std::string &linkedSection="", const std::string &infoSection="", uint64_t infoData=0)
 Creates a user-defined section that can help inform analysis by clarifying what types of data exist in what ranges. More...
 
void RemoveUserSection (const std::string &name)
 Remove a user defined section by name. More...
 
std::vector< Ref< Section > > GetSections ()
 Get the list of defined sections. More...
 
std::vector< Ref< Section > > GetSectionsAt (uint64_t addr)
 Get the list of sections containing addr. More...
 
Ref< SectionGetSectionByName (const std::string &name)
 Get a Section by name. More...
 
std::vector< std::string > GetUniqueSectionNames (const std::vector< std::string > &names)
 Create unique names for all items in the input list, modifying them if they are not unique. More...
 
std::string GetCommentForAddress (uint64_t addr) const
 Get the comment placed at an address. More...
 
std::vector< uint64_t > GetCommentedAddresses () const
 Get the list of commented addresses. More...
 
void SetCommentForAddress (uint64_t addr, const std::string &comment)
 Set the comment at an address. More...
 
std::vector< BNAddressRangeGetAllocatedRanges ()
 Get the list of allocated ranges. More...
 
void StoreMetadata (const std::string &key, Ref< Metadata > value, bool isAuto=false)
 
Ref< MetadataQueryMetadata (const std::string &key)
 
void RemoveMetadata (const std::string &key)
 
std::string GetStringMetadata (const std::string &key)
 
std::vector< uint8_t > GetRawMetadata (const std::string &key)
 
uint64_t GetUIntMetadata (const std::string &key)
 
std::vector< std::string > GetLoadSettingsTypeNames ()
 
Ref< SettingsGetLoadSettings (const std::string &typeName)
 
void SetLoadSettings (const std::string &typeName, Ref< Settings > settings)
 
BNAnalysisParameters GetParametersForAnalysis ()
 
void SetParametersForAnalysis (BNAnalysisParameters params)
 
uint64_t GetMaxFunctionSizeForAnalysis ()
 
void SetMaxFunctionSizeForAnalysis (uint64_t size)
 
bool GetNewAutoFunctionAnalysisSuppressed ()
 
void SetNewAutoFunctionAnalysisSuppressed (bool suppress)
 
std::set< NameSpaceGetNameSpaces () const
 Returns a list of namespaces for the current BinaryView. More...
 
bool HasSymbols () const
 Check whether this BinaryView has any defined symbols. More...
 
bool HasDataVariables () const
 Check whether this BinaryView has any defined DataVariables. More...
 
Ref< StructureCreateStructureFromOffsetAccess (const QualifiedName &type, bool *newMemberAdded) const
 
Confidence< Ref< Type > > CreateStructureMemberFromAccess (const QualifiedName &name, uint64_t offset) const
 
Ref< LoggerCreateLogger (const std::string &name)
 Create a logger with a session ID tied to this BinaryView. More...
 
void AddExpressionParserMagicValue (const std::string &name, uint64_t value)
 Add a magic value to the expression parser. More...
 
void RemoveExpressionParserMagicValue (const std::string &name)
 Remove a magic value from the expression parser. More...
 
void AddExpressionParserMagicValues (const std::vector< std::string > &names, const std::vector< uint64_t > &values)
 Add a list of magic value to the expression parser. More...
 
void RemoveExpressionParserMagicValues (const std::vector< std::string > &names)
 Remove a list of magic value from the expression parser. More...
 
bool GetExpressionParserMagicValue (const std::string &name, uint64_t *value)
 Get the value of an expression parser magic value. More...
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNBinaryView, BNNewViewReference, BNFreeBinaryView >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNBinaryView * GetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Static Public Member Functions

static NameSpace GetInternalNameSpace ()
 Internal namespace for the current BinaryView. More...
 
static NameSpace GetExternalNameSpace ()
 External namespace for the current BinaryView. More...
 
static bool ParseExpression (Ref< BinaryView > view, const std::string &expression, uint64_t &offset, uint64_t here, std::string &errorString)
 Evaluates a string expression to an integer value. More...
 
- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNBinaryView, BNNewViewReference, BNFreeBinaryView >
static BNBinaryView * GetObject (CoreRefCountObject *obj)
 
static BNBinaryView * GetObject (const CoreRefCountObject *obj)
 

Protected Member Functions

 BinaryView (const std::string &typeName, FileMetadata *file, BinaryView *parentView=nullptr)
 BinaryView constructor. More...
 
virtual size_t PerformRead (void *dest, uint64_t offset, size_t len)
 PerformRead provides a mapping between the flat file and virtual offsets in the file. More...
 
virtual size_t PerformWrite (uint64_t offset, const void *data, size_t len)
 PerformWrite provides a mapping between the flat file and virtual offsets in the file. More...
 
virtual size_t PerformInsert (uint64_t offset, const void *data, size_t len)
 PerformInsert provides a mapping between the flat file and virtual offsets in the file, inserting len bytes from data to virtual address offset More...
 
virtual size_t PerformRemove (uint64_t offset, uint64_t len)
 PerformRemove provides a mapping between the flat file and virtual offsets in the file, removing len bytes from virtual address offset More...
 
virtual BNModificationStatus PerformGetModification (uint64_t offset)
 PerformGetModification implements a query as to whether the virtual address offset is modified. More...
 
virtual bool PerformIsValidOffset (uint64_t offset)
 PerformIsValidOffset implements a check as to whether a virtual address offset is valid. More...
 
virtual bool PerformIsOffsetReadable (uint64_t offset)
 PerformIsOffsetReadable implements a check as to whether a virtual address is readable. More...
 
virtual bool PerformIsOffsetWritable (uint64_t offset)
 PerformIsOffsetWritable implements a check as to whether a virtual address is writable. More...
 
virtual bool PerformIsOffsetExecutable (uint64_t offset)
 PerformIsOffsetExecutable implements a check as to whether a virtual address is executable. More...
 
virtual bool PerformIsOffsetBackedByFile (uint64_t offset)
 PerformIsOffsetBackedByFile implements a check as to whether a virtual address is backed by a file. More...
 
virtual uint64_t PerformGetNextValidOffset (uint64_t offset)
 PerformGetNextValidOffset implements a query for the next valid readable, writable, or executable virtual memory address after offset More...
 
virtual uint64_t PerformGetStart () const
 PerformGetStart implements a query for the first readable, writable, or executable virtual address in the BinaryView. More...
 
virtual uint64_t PerformGetLength () const
 
virtual uint64_t PerformGetEntryPoint () const
 
virtual bool PerformIsExecutable () const
 PerformIsExecutable implements a check which returns true if the BinaryView is executable. More...
 
virtual BNEndianness PerformGetDefaultEndianness () const
 PerformGetDefaultEndianness implements a check which returns the Endianness of the BinaryView. More...
 
virtual bool PerformIsRelocatable () const
 PerformIsRelocatable implements a check which returns true if the BinaryView is relocatable. More...
 
virtual size_t PerformGetAddressSize () const
 PerformGetAddressSize implements a query for the address size for this BinaryView. More...
 
virtual bool PerformSave (FileAccessor *file)
 
void PerformDefineRelocation (Architecture *arch, BNRelocationInfo &info, uint64_t target, uint64_t reloc)
 
void PerformDefineRelocation (Architecture *arch, BNRelocationInfo &info, Ref< Symbol > sym, uint64_t reloc)
 
void NotifyDataWritten (uint64_t offset, size_t len)
 
void NotifyDataInserted (uint64_t offset, size_t len)
 
void NotifyDataRemoved (uint64_t offset, uint64_t len)
 

Protected Attributes

Ref< FileMetadatam_file
 The underlying file. More...
 

Additional Inherited Members

- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNBinaryView, BNNewViewReference, BNFreeBinaryView >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNBinaryView * m_object
 

Constructor & Destructor Documentation

◆ BinaryView() [1/2]

BinaryView::BinaryView ( const std::string &  typeName,
FileMetadata file,
BinaryView parentView = nullptr 
)
protected

BinaryView constructor.

Parameters
typeNamename of the BinaryView (e.g. ELF, PE, Mach-O, ...)
filea file to create a view from
parentViewoptional view that contains the raw data used by this view

◆ BinaryView() [2/2]

BinaryView::BinaryView ( BNBinaryView *  view)

Member Function Documentation

◆ PerformRead()

virtual size_t BinaryNinja::BinaryView::PerformRead ( void *  dest,
uint64_t  offset,
size_t  len 
)
inlineprotectedvirtual

PerformRead provides a mapping between the flat file and virtual offsets in the file.

Note
This method may be overridden by custom BinaryViews. Use AddAutoSegment to provide data without overriding this method.
Warning
This method must not be called directly.
Parameters
destthe address to write len number of bytes.
offsetthe virtual offset to find and read len bytes from
lenthe number of bytes to read from offset and write to dest

◆ PerformWrite()

virtual size_t BinaryNinja::BinaryView::PerformWrite ( uint64_t  offset,
const void *  data,
size_t  len 
)
inlineprotectedvirtual

PerformWrite provides a mapping between the flat file and virtual offsets in the file.

Note
This method may be overridden by custom BinaryViews. Use AddAutoSegment to provide data without overriding this method.
Warning
This method must not be called directly.
Parameters
offsetthe virtual offset to find and write len bytes to
datathe address to read len number of bytes from
lenthe number of bytes to read from data and write to offset
Returns
length of data written, 0 on error

◆ PerformInsert()

virtual size_t BinaryNinja::BinaryView::PerformInsert ( uint64_t  offset,
const void *  data,
size_t  len 
)
inlineprotectedvirtual

PerformInsert provides a mapping between the flat file and virtual offsets in the file, inserting len bytes from data to virtual address offset

Note
This method may be overridden by custom BinaryViews.
Warning
This method must not be called directly.
Parameters
offsetthe virtual offset to find and insert len bytes into
datathe address to read len number of bytes from
lenthe number of bytes to read from data and insert at offset
Returns
length of data inserted, 0 on error

◆ PerformRemove()

virtual size_t BinaryNinja::BinaryView::PerformRemove ( uint64_t  offset,
uint64_t  len 
)
inlineprotectedvirtual

PerformRemove provides a mapping between the flat file and virtual offsets in the file, removing len bytes from virtual address offset

Note
This method may be overridden by custom BinaryViews.
Warning
This method must not be called directly.
Parameters
offsetthe virtual offset to find and remove bytes from
lenthe number of bytes to be removed
Returns
length of data removed, 0 on error

◆ PerformGetModification()

virtual BNModificationStatus BinaryNinja::BinaryView::PerformGetModification ( uint64_t  offset)
inlineprotectedvirtual

PerformGetModification implements a query as to whether the virtual address offset is modified.

Note
This method may be overridden by custom BinaryViews.
Warning
This method must not be called directly.
Parameters
offseta virtual address to be checked
Returns
one of Original, Changed, Inserted

◆ PerformIsValidOffset()

bool BinaryView::PerformIsValidOffset ( uint64_t  offset)
protectedvirtual

PerformIsValidOffset implements a check as to whether a virtual address offset is valid.

Note
This method may be overridden by custom BinaryViews.
Warning
This method must not be called directly.
Parameters
offsetthe virtual address to check
Returns
whether the offset is valid

◆ PerformIsOffsetReadable()

bool BinaryView::PerformIsOffsetReadable ( uint64_t  offset)
protectedvirtual

PerformIsOffsetReadable implements a check as to whether a virtual address is readable.

Note
This method may be overridden by custom BinaryViews.
Warning
This method must not be called directly.
Parameters
offsetthe virtual address to check
Returns
whether the offset is readable

◆ PerformIsOffsetWritable()

bool BinaryView::PerformIsOffsetWritable ( uint64_t  offset)
protectedvirtual

PerformIsOffsetWritable implements a check as to whether a virtual address is writable.

Note
This method may be overridden by custom BinaryViews.
Warning
This method must not be called directly.
Parameters
offsetthe virtual address to check
Returns
whether the offset is writable

◆ PerformIsOffsetExecutable()

bool BinaryView::PerformIsOffsetExecutable ( uint64_t  offset)
protectedvirtual

PerformIsOffsetExecutable implements a check as to whether a virtual address is executable.

Note
This method may be overridden by custom BinaryViews.
Warning
This method must not be called directly.
Parameters
offsetthe virtual address to check
Returns
whether the offset is executable

◆ PerformIsOffsetBackedByFile()

bool BinaryView::PerformIsOffsetBackedByFile ( uint64_t  offset)
protectedvirtual

PerformIsOffsetBackedByFile implements a check as to whether a virtual address is backed by a file.

Parameters
offsetthe virtual address to check
Returns
whether the offset is backed by a file

◆ PerformGetNextValidOffset()

uint64_t BinaryView::PerformGetNextValidOffset ( uint64_t  offset)
protectedvirtual

PerformGetNextValidOffset implements a query for the next valid readable, writable, or executable virtual memory address after offset

Note
This method may be overridden by custom BinaryViews.
Warning
This method must not be called directly.
Parameters
offseta virtual address to start checking from
Returns
the next valid address

◆ PerformGetStart()

virtual uint64_t BinaryNinja::BinaryView::PerformGetStart ( ) const
inlineprotectedvirtual

PerformGetStart implements a query for the first readable, writable, or executable virtual address in the BinaryView.

Note
This method may be overridden by custom BinaryViews.
Warning
This method must not be called directly.
Returns
the first virtual address in the BinaryView

◆ PerformGetLength()

virtual uint64_t BinaryNinja::BinaryView::PerformGetLength ( ) const
inlineprotectedvirtual

◆ PerformGetEntryPoint()

virtual uint64_t BinaryNinja::BinaryView::PerformGetEntryPoint ( ) const
inlineprotectedvirtual

◆ PerformIsExecutable()

virtual bool BinaryNinja::BinaryView::PerformIsExecutable ( ) const
inlineprotectedvirtual

PerformIsExecutable implements a check which returns true if the BinaryView is executable.

Note
This method may be overridden by custom BinaryViews.
Warning
This method must not be called directly.
Returns
whether the BinaryView is executable

◆ PerformGetDefaultEndianness()

BNEndianness BinaryView::PerformGetDefaultEndianness ( ) const
protectedvirtual

PerformGetDefaultEndianness implements a check which returns the Endianness of the BinaryView.

Note
This method may be overridden by custom BinaryViews.
Warning
This method must not be called directly.
Returns
either LittleEndian or BigEndian

◆ PerformIsRelocatable()

bool BinaryView::PerformIsRelocatable ( ) const
protectedvirtual

PerformIsRelocatable implements a check which returns true if the BinaryView is relocatable.

Note
This method may be overridden by custom BinaryViews.
Warning
This method must not be called directly.
Returns
whether the BinaryView is relocatable

◆ PerformGetAddressSize()

size_t BinaryView::PerformGetAddressSize ( ) const
protectedvirtual

PerformGetAddressSize implements a query for the address size for this BinaryView.

Note
This method may be overridden by custom BinaryViews.
Warning
This method must not be called directly.
Returns
the address size for this BinaryView

◆ PerformSave()

bool BinaryView::PerformSave ( FileAccessor file)
protectedvirtual

◆ PerformDefineRelocation() [1/2]

void BinaryView::PerformDefineRelocation ( Architecture arch,
BNRelocationInfo info,
uint64_t  target,
uint64_t  reloc 
)
protected

◆ PerformDefineRelocation() [2/2]

void BinaryView::PerformDefineRelocation ( Architecture arch,
BNRelocationInfo info,
Ref< Symbol sym,
uint64_t  reloc 
)
protected

◆ NotifyDataWritten()

void BinaryView::NotifyDataWritten ( uint64_t  offset,
size_t  len 
)
protected

◆ NotifyDataInserted()

void BinaryView::NotifyDataInserted ( uint64_t  offset,
size_t  len 
)
protected

◆ NotifyDataRemoved()

void BinaryView::NotifyDataRemoved ( uint64_t  offset,
uint64_t  len 
)
protected

◆ Init()

virtual bool BinaryNinja::BinaryView::Init ( )
inlinevirtual

◆ GetFile()

FileMetadata * BinaryNinja::BinaryView::GetFile ( ) const
inline
Returns
FileMetadata for this BinaryView

◆ GetParentView()

Ref< BinaryView > BinaryView::GetParentView ( ) const
Returns
View that contains the raw data used by this view

◆ GetTypeName()

string BinaryView::GetTypeName ( ) const

◆ IsModified()

bool BinaryView::IsModified ( ) const
Returns
Whether the file has unsaved modifications

◆ IsAnalysisChanged()

bool BinaryView::IsAnalysisChanged ( ) const
Returns
Whether auto-analysis results have changed.

◆ CreateDatabase() [1/2]

bool BinaryNinja::BinaryView::CreateDatabase ( const std::string &  path,
Ref< SaveSettings settings = new SaveSettings() 
)

Writes the current database (.bndb) out to the specified file.

Parameters
pathpath and filename to write the bndb to. Should have ".bndb" appended to it.
settingsSpecial save options
Returns
Whether the save was successful

◆ CreateDatabase() [2/2]

bool BinaryNinja::BinaryView::CreateDatabase ( const std::string &  path,
const std::function< bool(size_t progress, size_t total)> &  progressCallback,
Ref< SaveSettings settings = new SaveSettings() 
)

Writes the current database (.bndb) out to the specified file.

Parameters
pathpath and filename to write the bndb to. Should have ".bndb" appended to it.
progressCallbackcallback function to send save progress to.
settingsSpecial save options
Returns
Whether the save was successful

◆ SaveAutoSnapshot() [1/2]

bool BinaryView::SaveAutoSnapshot ( Ref< SaveSettings settings = new SaveSettings())

◆ SaveAutoSnapshot() [2/2]

bool BinaryNinja::BinaryView::SaveAutoSnapshot ( const std::function< bool(size_t progress, size_t total)> &  progressCallback,
Ref< SaveSettings settings = new SaveSettings() 
)

◆ BeginUndoActions()

void BinaryView::BeginUndoActions ( )

Start recording actions taken so they can be undone at some point.

◆ AddUndoAction()

void BinaryNinja::BinaryView::AddUndoAction ( UndoAction action)

◆ CommitUndoActions()

void BinaryView::CommitUndoActions ( )

Commit the actions taken since the last commit to the undo database.

◆ CanUndo()

bool BinaryView::CanUndo ( )
Returns
Whether it is possible to perform an Undo

◆ Undo()

bool BinaryView::Undo ( )

Undo the last committed action in the undo database.

◆ CanRedo()

bool BinaryView::CanRedo ( )
Returns
Whether it is possible to perform a Redo

◆ Redo()

bool BinaryView::Redo ( )

Redo the last committed action in the undo database.

◆ GetCurrentView()

string BinaryView::GetCurrentView ( )

Get the current View name, e.g.

Linear:ELF, Graph:PE

Returns
The current view name

◆ GetCurrentOffset()

uint64_t BinaryView::GetCurrentOffset ( )

Get the current offset in the current view.

Returns
The current offset

◆ Navigate()

bool BinaryView::Navigate ( const std::string &  view,
uint64_t  offset 
)

Navigate to the specified virtual address in the specified view.

Parameters
viewView name. e.g. Linear:ELF, Graph:PE
offsetVirtual address to navigate to
Returns
Whether the navigation was successful.

◆ Read()

size_t BinaryView::Read ( void *  dest,
uint64_t  offset,
size_t  len 
)

Read writes len bytes at virtual address offset to address dest

Parameters
destVirtual address to write to
offsetvirtual address to read from
lennumber of bytes to read
Returns
amount of bytes read

◆ ReadBuffer()

DataBuffer BinaryView::ReadBuffer ( uint64_t  offset,
size_t  len 
)

ReadBuffer reads len bytes from a virtual address into a DataBuffer.

Parameters
offsetvirtual address to read from
lennumber of bytes to read
Returns
DataBuffer containing the read bytes

◆ Write()

size_t BinaryView::Write ( uint64_t  offset,
const void *  data,
size_t  len 
)

Write writes len bytes data at address dest to virtual address offset

Parameters
offsetvirtual address to write to
dataaddress to read from
lennumber of bytes to write
Returns
amount of bytes written

◆ WriteBuffer()

size_t BinaryView::WriteBuffer ( uint64_t  offset,
const DataBuffer data 
)

WriteBuffer writes the contents of a DataBuffer into a virtual address.

Parameters
offsetvirtual address to write to
dataDataBuffer containing the bytes to write
Returns
amount of bytes written

◆ Insert()

size_t BinaryView::Insert ( uint64_t  offset,
const void *  data,
size_t  len 
)

Insert inserts len bytes data at address dest starting from virtual address offset

Parameters
offsetvirtual address to start inserting from
dataaddress to read from
lennumber of bytes to write
Returns
amount of bytes written

◆ InsertBuffer()

size_t BinaryView::InsertBuffer ( uint64_t  offset,
const DataBuffer data 
)

InsertBuffer inserts the contents of a DataBuffer starting from a virtual address.

Parameters
offsetvirtual address to start inserting from
dataDataBuffer containing the bytes to write
Returns
amount of bytes written

◆ Remove()

size_t BinaryView::Remove ( uint64_t  offset,
uint64_t  len 
)

PerformRemove removes len bytes from virtual address offset

Parameters
offsetthe virtual offset to find and remove bytes from
lenthe number of bytes to be removed
Returns
length of data removed, 0 on error

◆ GetEntropy()

vector< float > BinaryView::GetEntropy ( uint64_t  offset,
size_t  len,
size_t  blockSize 
)

◆ GetModification() [1/2]

BNModificationStatus BinaryView::GetModification ( uint64_t  offset)

GetModification checks whether the virtual address offset is modified.

Parameters
offseta virtual address to be checked
Returns
one of Original, Changed, Inserted

◆ GetModification() [2/2]

vector< BNModificationStatus > BinaryView::GetModification ( uint64_t  offset,
size_t  len 
)

◆ IsValidOffset()

bool BinaryView::IsValidOffset ( uint64_t  offset) const

IsValidOffset checks whether a virtual address offset is valid.

Parameters
offsetthe virtual address to check
Returns
whether the offset is valid

◆ IsOffsetReadable()

bool BinaryView::IsOffsetReadable ( uint64_t  offset) const

IsOffsetReadable checks whether a virtual address is readable.

Parameters
offsetthe virtual address to check
Returns
whether the offset is readable

◆ IsOffsetWritable()

bool BinaryView::IsOffsetWritable ( uint64_t  offset) const

IsOffsetWritable checks whether a virtual address is writable.

Parameters
offsetthe virtual address to check
Returns
whether the offset is writable

◆ IsOffsetExecutable()

bool BinaryView::IsOffsetExecutable ( uint64_t  offset) const

IsOffsetExecutable checks whether a virtual address is executable.

Parameters
offsetthe virtual address to check
Returns
whether the offset is executable

◆ IsOffsetBackedByFile()

bool BinaryView::IsOffsetBackedByFile ( uint64_t  offset) const

IsOffsetBackedByFile checks whether a virtual address is backed by a file.

Parameters
offsetthe virtual address to check
Returns
whether the offset is backed by a file

◆ IsOffsetCodeSemantics()

bool BinaryView::IsOffsetCodeSemantics ( uint64_t  offset) const

◆ IsOffsetWritableSemantics()

bool BinaryView::IsOffsetWritableSemantics ( uint64_t  offset) const

◆ IsOffsetExternSemantics()

bool BinaryView::IsOffsetExternSemantics ( uint64_t  offset) const

◆ GetNextValidOffset()

uint64_t BinaryView::GetNextValidOffset ( uint64_t  offset) const

GetNextValidOffset implements a query for the next valid readable, writable, or executable virtual memory address after offset

Parameters
offseta virtual address to start checking from
Returns
the next valid address

◆ GetStart()

uint64_t BinaryView::GetStart ( ) const

GetStart queries for the first valid virtual address in the BinaryView.

Returns
the start of the BinaryView

◆ GetEnd()

uint64_t BinaryView::GetEnd ( ) const

GetEnd queries for the first valid virtual address in the BinaryView.

Returns
the end of the BinaryView

◆ GetLength()

uint64_t BinaryView::GetLength ( ) const

GetLength queries for the total length of the BinaryView from start to end.

Returns
the length of the BinaryView

◆ GetEntryPoint()

uint64_t BinaryView::GetEntryPoint ( ) const

GetEntryPoint returns the entry point of the executable in the BinaryView.

Returns
the entry point

◆ GetDefaultArchitecture()

Ref< Architecture > BinaryView::GetDefaultArchitecture ( ) const

GetDefaultArchitecture returns the current "default architecture" for the BinaryView.

Returns
the current default architecture

◆ SetDefaultArchitecture()

void BinaryView::SetDefaultArchitecture ( Architecture arch)

SetDefaultArchitecture allows setting the default architecture for the BinaryView.

Parameters
archthe new default architecture

◆ GetDefaultPlatform()

Ref< Platform > BinaryView::GetDefaultPlatform ( ) const

GetDefaultPlatform returns the current default platform for the BinaryView.

Returns
the current default Platform

◆ SetDefaultPlatform()

void BinaryView::SetDefaultPlatform ( Platform platform)

SetDefaultPlatform allows setting the default platform for the BinaryView.

Parameters
archthe new default platform

◆ GetDefaultEndianness()

BNEndianness BinaryView::GetDefaultEndianness ( ) const

GetDefaultEndianness returns the default endianness for the BinaryView.

Returns
the current default Endianness, one of LittleEndian, BigEndian

◆ IsRelocatable()

bool BinaryView::IsRelocatable ( ) const

Whether the binary is relocatable.

Returns
Whether the binary is relocatable

◆ GetAddressSize()

size_t BinaryView::GetAddressSize ( ) const

Address size of the binary.

Returns
Address size of the binary

◆ IsExecutable()

bool BinaryView::IsExecutable ( ) const

Whether the binary is an executable.

Returns
Whether the binary is an executable

◆ Save() [1/2]

bool BinaryView::Save ( FileAccessor file)

Save the original binary file to a FileAccessor.

Parameters
filea FileAccessor pointing to the location to save the binary
Returns
Whether the save was successful

◆ Save() [2/2]

bool BinaryNinja::BinaryView::Save ( const std::string &  path)

Save the original binary file to the provided destination.

Parameters
pathdestination path and filename of the file to be written
Returns
Whether the save was successful

◆ DefineRelocation() [1/2]

void BinaryView::DefineRelocation ( Architecture arch,
BNRelocationInfo info,
uint64_t  target,
uint64_t  reloc 
)

◆ DefineRelocation() [2/2]

void BinaryView::DefineRelocation ( Architecture arch,
BNRelocationInfo info,
Ref< Symbol target,
uint64_t  reloc 
)

◆ GetRelocationRanges()

vector< pair< uint64_t, uint64_t > > BinaryView::GetRelocationRanges ( ) const

◆ GetRelocationRangesAtAddress()

vector< pair< uint64_t, uint64_t > > BinaryView::GetRelocationRangesAtAddress ( uint64_t  addr) const

◆ RangeContainsRelocation()

bool BinaryView::RangeContainsRelocation ( uint64_t  addr,
size_t  size 
) const

◆ RegisterNotification()

void BinaryView::RegisterNotification ( BinaryDataNotification notify)

Provides a mechanism for receiving callbacks for various analysis events.

Parameters
notifyAn instance of a class Subclassing BinaryDataNotification

◆ UnregisterNotification()

void BinaryView::UnregisterNotification ( BinaryDataNotification notify)

Unregister a notification passed to RegisterNotification.

Parameters
notifyAn instance of a class Subclassing BinaryDataNotification

◆ AddAnalysisOption()

void BinaryView::AddAnalysisOption ( const std::string &  name)

Adds an analysis option.

Analysis options elaborate the analysis phase. The user must start analysis by calling either UpdateAnalysis or UpdateAnalysisAndWait

Parameters
nameName of the analysis option. Available options are "linearsweep" and "signaturematcher"

◆ AddFunctionForAnalysis()

Ref< Function > BinaryView::AddFunctionForAnalysis ( Platform platform,
uint64_t  addr,
bool  autoDiscovered = false,
Type type = nullptr 
)

Add a new function of the given platform at the virtual address.

Parameters
platformPlatform for the function to be loaded
addrVirtual adddress of the function to be loaded
autoDiscoveredtrue if function was automatically discovered, false if created by user
typeoptional function type

◆ AddEntryPointForAnalysis()

void BinaryView::AddEntryPointForAnalysis ( Platform platform,
uint64_t  start 
)

adds an virtual address to start analysis from for a given platform

Parameters
platformPlatform for the entry point analysis
startvirtual address to start analysis from

◆ RemoveAnalysisFunction()

void BinaryView::RemoveAnalysisFunction ( Function func,
bool  updateRefs = false 
)

removes a function from the list of functions

Parameters
funcFunction to be removed
updateRefsautomatically update other functions that were referenced

◆ CreateUserFunction()

void BinaryView::CreateUserFunction ( Platform platform,
uint64_t  start 
)

Add a new user function of the given platform at the virtual address.

Parameters
platformPlatform for the function to be loaded
addrVirtual adddress of the function to be loaded

◆ RemoveUserFunction()

void BinaryView::RemoveUserFunction ( Function func)

removes a user function from the list of functions

Parameters
funcFunction to be removed

◆ HasInitialAnalysis()

bool BinaryView::HasInitialAnalysis ( )

check for the presence of an initial analysis in this BinaryView.

Returns
Whether the BinaryView has an initial analysis

◆ SetAnalysisHold()

void BinaryView::SetAnalysisHold ( bool  enable)

Controls the analysis hold for this BinaryView.

Enabling analysis hold defers all future analysis updates, therefore causing UpdateAnalysis and UpdateAnalysisAndWait to take no action.

Parameters
enableWhether to enable or disable the analysis hold

◆ UpdateAnalysisAndWait()

void BinaryView::UpdateAnalysisAndWait ( )

start the analysis running and dont return till it is complete

Analysis of BinaryViews does not occur automatically, the user must start analysis by calling either UpdateAnalysis or UpdateAnalysisAndWait. An analysis update must be run after changes are made which could change analysis results such as adding functions.

◆ UpdateAnalysis()

void BinaryView::UpdateAnalysis ( )

asynchronously starts the analysis running and returns immediately.

Analysis of BinaryViews does not occur automatically, the user must start analysis by calling either UpdateAnalysis or UpdateAnalysisAndWait. An analysis update must be run after changes are made which could change analysis results such as adding functions.

◆ AbortAnalysis()

void BinaryView::AbortAnalysis ( )

Abort the currently running analysis.

This method should be considered non-recoverable and generally only used when shutdown is imminent after stopping.

◆ DefineDataVariable()

void BinaryView::DefineDataVariable ( uint64_t  addr,
const Confidence< Ref< Type > > &  type 
)

Define a DataVariable at a given address with a set type.

Parameters
addrvirtual address to define the DataVariable at
typeType for the DataVariable

◆ DefineUserDataVariable()

void BinaryView::DefineUserDataVariable ( uint64_t  addr,
const Confidence< Ref< Type > > &  type 
)

Define a user DataVariable at a given address with a set type.

Parameters
addrvirtual address to define the DataVariable at
typeType for the DataVariable

◆ UndefineDataVariable()

void BinaryView::UndefineDataVariable ( uint64_t  addr)

Undefine a DataVariable at a given address.

Parameters
addrvirtual address of the DataVariable

◆ UndefineUserDataVariable()

void BinaryView::UndefineUserDataVariable ( uint64_t  addr)

Undefine a user DataVariable at a given address.

Parameters
addrvirtual address of the DataVariable

◆ GetDataVariables()

map< uint64_t, DataVariable > BinaryView::GetDataVariables ( )

Get a map of DataVariables defined in the current BinaryView.

Returns
A map of addresses to the DataVariables defined at them

◆ GetDataVariableAtAddress()

bool BinaryView::GetDataVariableAtAddress ( uint64_t  addr,
DataVariable var 
)

Get a DataVariable at a given address.

Parameters
addrAddress for the DataVariable
varReference to a DataVariable class to write to
Returns
Whether a DataVariable was successfully retrieved

◆ GetAnalysisFunctionList()

vector< Ref< Function > > BinaryView::GetAnalysisFunctionList ( )

Get a list of functions within this BinaryView.

Returns
vector of Functions within the BinaryView

◆ HasFunctions()

bool BinaryView::HasFunctions ( ) const

Check whether the BinaryView has any functions defined.

Returns
Whether the BinaryView has any functions defined

◆ GetAnalysisFunction()

Ref< Function > BinaryView::GetAnalysisFunction ( Platform platform,
uint64_t  addr 
)

Gets a function object for the function starting at a virtual address.

Parameters
platformPlatform for the desired function
addrStarting virtual address for the function
Returns
the Function, if it exists

◆ GetRecentAnalysisFunctionForAddress()

Ref< Function > BinaryView::GetRecentAnalysisFunctionForAddress ( uint64_t  addr)

Get the most recently used Function starting at a virtual address.

Parameters
addrStarting virtual address for the function
Returns
the Function, if it exists

◆ GetAnalysisFunctionsForAddress()

vector< Ref< Function > > BinaryView::GetAnalysisFunctionsForAddress ( uint64_t  addr)

Get a list of functions defined at an address.

Parameters
addrStarting virtual address for the function
Returns
vector of functions

◆ GetAnalysisFunctionsContainingAddress()

vector< Ref< Function > > BinaryView::GetAnalysisFunctionsContainingAddress ( uint64_t  addr)

Get a list of functions containing an address.

Parameters
addrAddress to check
Returns
vector of Functions

◆ GetAnalysisEntryPoint()

Ref< Function > BinaryView::GetAnalysisEntryPoint ( )

Get the function defined as the Analysis entry point for the view.

Returns
The analysis entry point function

◆ GetRecentBasicBlockForAddress()

Ref< BasicBlock > BinaryView::GetRecentBasicBlockForAddress ( uint64_t  addr)

Get most recently used Basic Block containing a virtual address.

Parameters
addrAddress within the BasicBlock
Returns
The BasicBlock if it exists

◆ GetBasicBlocksForAddress()

vector< Ref< BasicBlock > > BinaryView::GetBasicBlocksForAddress ( uint64_t  addr)

Get a list of Basic Blocks containing a virtual address.

Parameters
addrAddress to check
Returns
vector of basic blocks containing that address

◆ GetBasicBlocksStartingAtAddress()

vector< Ref< BasicBlock > > BinaryView::GetBasicBlocksStartingAtAddress ( uint64_t  addr)

Get a list of basic blocks starting at a virtual address.

Parameters
addrAddress to check
Returns
vector of basic blocks starting at that address

◆ GetCodeReferences() [1/2]

vector< ReferenceSource > BinaryView::GetCodeReferences ( uint64_t  addr)

Get a list of references made from code (instructions) to a virtual address.

Parameters
addrAddress to check
Returns
vector of ReferenceSources referencing the virtual address

◆ GetCodeReferences() [2/2]

vector< ReferenceSource > BinaryView::GetCodeReferences ( uint64_t  addr,
uint64_t  len 
)

Get a list of references from code (instructions) to a range of addresses.

Parameters
addrAddress to check
lenLength of query
Returns
vector of ReferenceSources referencing the virtual address range

◆ GetCodeReferencesFrom() [1/2]

vector< uint64_t > BinaryView::GetCodeReferencesFrom ( ReferenceSource  src)

Get code references made by a particular "ReferenceSource".

A ReferenceSource contains a given function, architecture of that function, and an address within it.

Parameters
srcreference source
Returns
List of virtual addresses referenced by this source

◆ GetCodeReferencesFrom() [2/2]

vector< uint64_t > BinaryView::GetCodeReferencesFrom ( ReferenceSource  src,
uint64_t  len 
)

Get code references from a range of addresses.

A ReferenceSource contains a given function, architecture of that function, and an address within it.

The 2nd parameter is the length of the range. The start of the range is set in ReferenceSource::addr

Parameters
srcreference source
lenLength of query
Returns
List of virtual addresses referenced by this source

◆ GetDataReferences() [1/2]

vector< uint64_t > BinaryView::GetDataReferences ( uint64_t  addr)

Get references made by data ('DataVariables') to a virtual address.

Parameters
addrAddress to check
Returns
vector of virtual addresses referencing the virtual address

◆ GetDataReferences() [2/2]

vector< uint64_t > BinaryView::GetDataReferences ( uint64_t  addr,
uint64_t  len 
)

Get references made by data ('DataVariables') in a given range, to a virtual address.

Parameters
addrAddress to check
lenLength of query
Returns
vector of virtual addresses referencing the virtual address range

◆ GetDataReferencesFrom() [1/2]

vector< uint64_t > BinaryView::GetDataReferencesFrom ( uint64_t  addr)

Get references made by data ('DataVariables') located at a virtual address.

Parameters
srcreference source
Returns
List of virtual addresses referenced by this address

◆ GetDataReferencesFrom() [2/2]

vector< uint64_t > BinaryView::GetDataReferencesFrom ( uint64_t  addr,
uint64_t  len 
)

Get references made by data ('DataVariables') located in a range of virtual addresses.

Parameters
srcreference source
lenLength of query
Returns
List of virtual addresses referenced by this address

◆ AddUserDataReference()

void BinaryView::AddUserDataReference ( uint64_t  fromAddr,
uint64_t  toAddr 
)

Add a user Data Reference from a virtual address to another virtual address.

Parameters
fromAddrAddress referencing the toAddr value
toAddrvirtual address being referenced

◆ RemoveUserDataReference()

void BinaryView::RemoveUserDataReference ( uint64_t  fromAddr,
uint64_t  toAddr 
)

Remove a user Data Reference from a virtual address to another virtual address.

Parameters
fromAddrAddress referencing the toAddr value
toAddrvirtual address being referenced

◆ GetCodeReferencesForType()

vector< ReferenceSource > BinaryView::GetCodeReferencesForType ( const QualifiedName type)

Get code references to a Type.

Parameters
typeQualifiedName for a Type
Returns
vector of ReferenceSources

◆ GetDataReferencesForType()

vector< uint64_t > BinaryView::GetDataReferencesForType ( const QualifiedName type)

Get data references to a Type.

Parameters
typeQualifiedName for a Type
Returns
vector of virtual addresses referencing this Type

◆ GetTypeReferencesForType()

vector< TypeReferenceSource > BinaryView::GetTypeReferencesForType ( const QualifiedName type)

Get Type references to a Type.

Parameters
typeQualifiedName for a Type
Returns
vector of TypeReferenceSources to this Type

◆ GetCodeReferencesForTypeField()

vector< TypeFieldReference > BinaryView::GetCodeReferencesForTypeField ( const QualifiedName type,
uint64_t  offset 
)

Returns a list of references to a specific type field.

Parameters
typeQualifiedName of the type
offsetOffset of the field, relative to the start of the type
Returns
vector of TypeFieldReferences

◆ GetDataReferencesForTypeField()

vector< uint64_t > BinaryView::GetDataReferencesForTypeField ( const QualifiedName type,
uint64_t  offset 
)

Returns a list of virtual addresses of data which references the type type .

Note, the returned addresses are the actual start of the queried type field. For example, suppose there is a DataVariable at 0x1000 that has type A , and type A contains type B at offset 0x10 . Then GetDataReferencesForTypeField(bQualifiedName, 0x8) will return 0x1018 for it.

Parameters
typeQualifiedName of the type
offsetOffset of the field, relative to the start of the type
Returns
List of DataVariable start addresses containing references to the type field

◆ GetDataReferencesFromForTypeField()

vector< uint64_t > BinaryView::GetDataReferencesFromForTypeField ( const QualifiedName type,
uint64_t  offset 
)

Returns a list of virtual addresses of data which are referenced from the type type .

Only data referenced by structures with the __data_var_refs attribute are included.

Parameters
typeQualifiedName of the type
offsetOffset of the field, relative to the start of the type
Returns
List of addresses referenced from the type field

◆ GetTypeReferencesForTypeField()

vector< TypeReferenceSource > BinaryView::GetTypeReferencesForTypeField ( const QualifiedName type,
uint64_t  offset 
)

Returns a list of type references to a specific type field.

Parameters
typeQualifiedName of the type
offsetOffset of the field, relative to the start of the type
Returns
vector of TypeReferenceSources

◆ GetCodeReferencesForTypeFrom() [1/2]

vector< TypeReferenceSource > BinaryView::GetCodeReferencesForTypeFrom ( ReferenceSource  src)

Returns a list of types referenced by code at ReferenceSource src.

If no function is specified, references from all functions and containing the address will be returned. If no architecture is specified, the architecture of the function will be used.

Parameters
srcSource of the reference to check
Returns
vector of TypeReferenceSources

◆ GetCodeReferencesForTypeFrom() [2/2]

vector< TypeReferenceSource > BinaryView::GetCodeReferencesForTypeFrom ( ReferenceSource  src,
uint64_t  len 
)

Returns a list of types referenced by code at ReferenceSource src.

If no function is specified, references from all functions and containing the address will be returned. If no architecture is specified, the architecture of the function will be used.

Parameters
srcSource location to check
lenLength of the query
Returns
vector of TypeReferenceSources

◆ GetCodeReferencesForTypeFieldFrom() [1/2]

vector< TypeReferenceSource > BinaryView::GetCodeReferencesForTypeFieldFrom ( ReferenceSource  src)

Returns a list of type fields referenced by code at ReferenceSource src.

If no function is specified, references from all functions and containing the address will be returned. If no architecture is specified, the architecture of the function will be used.

Parameters
srcSource location to check
Returns
vector of TypeReferenceSources

◆ GetCodeReferencesForTypeFieldFrom() [2/2]

vector< TypeReferenceSource > BinaryView::GetCodeReferencesForTypeFieldFrom ( ReferenceSource  src,
uint64_t  len 
)

Returns a list of type fields referenced by code at ReferenceSource src.

If no function is specified, references from all functions and containing the address will be returned. If no architecture is specified, the architecture of the function will be used.

Parameters
srcSource location to check
lenLength of the query
Returns
vector of TypeReferenceSources

◆ GetAllFieldsReferenced()

vector< uint64_t > BinaryView::GetAllFieldsReferenced ( const QualifiedName type)

Returns a list of offsets in the QualifiedName specified by name, which are referenced by code.

Parameters
typeName of type to query for references
Returns
List of offsets

◆ GetAllSizesReferenced()

std::map< uint64_t, std::vector< size_t > > BinaryView::GetAllSizesReferenced ( const QualifiedName type)

Returns a map from field offset to a list of sizes of the accesses to the specified type.

Parameters
typeName of type to query for references
Returns
A map from field offset to the size of the code accesses to it

◆ GetAllTypesReferenced()

std::map< uint64_t, std::vector< Confidence< Ref< Type > > > > BinaryView::GetAllTypesReferenced ( const QualifiedName type)

Returns a map from field offset to a list of incoming types written to the specified type.

Parameters
typeName of type to query for references
Returns
A map from field offset to a list of incoming types written to it

◆ GetSizesReferenced()

std::vector< size_t > BinaryView::GetSizesReferenced ( const QualifiedName type,
uint64_t  offset 
)

Returns a list of types related to the type field access.

Parameters
typeName of type to query for references
offsetOffset of the field, relative to the start of the type
Returns
A list of sizes of accesses to the type

◆ GetTypesReferenced()

std::vector< Confidence< Ref< Type > > > BinaryView::GetTypesReferenced ( const QualifiedName type,
uint64_t  offset 
)

Returns a list of types referenced by a particular type field.

Parameters
typeName of type to query for references
offsetOffset of the field, relative to the start of the type
Returns
A list of types referenced

◆ CreateStructureBasedOnFieldAccesses()

Ref< Structure > BinaryNinja::BinaryView::CreateStructureBasedOnFieldAccesses ( const QualifiedName type)

◆ GetCallees()

vector< uint64_t > BinaryView::GetCallees ( ReferenceSource  addr)

Returns a list of virtual addresses called by the call site in the ReferenceSource.

If no function is specified, call sites from all functions and containing the address will be considered. If no architecture is specified, the architecture of the function will be used.

Parameters
addrReferenceSource to get callees to
Returns
A list of addresses referencing the ReferenceSource

◆ GetCallers()

vector< ReferenceSource > BinaryView::GetCallers ( uint64_t  addr)

Returns a list of ReferenceSource objects (xrefs or cross-references) that call the provided virtual address.

In this case, tail calls, jumps, and ordinary calls are considered.

Parameters
addrAddress to check callers for
Returns
A list of ReferenceSources calling this address

◆ GetSymbolByAddress()

Ref< Symbol > BinaryView::GetSymbolByAddress ( uint64_t  addr,
const NameSpace nameSpace = NameSpace() 
)

Returns the Symbol at the provided virtual address.

Parameters
addrVirtual address to query for symbol
nameSpaceThe optional namespace of the symbols to retrieve
Returns
The symbol located at that address

◆ GetSymbolByRawName()

Ref< Symbol > BinaryView::GetSymbolByRawName ( const std::string &  name,
const NameSpace nameSpace = NameSpace() 
)

Retrieves a Symbol object for the given a raw (mangled) name.

Parameters
nameRaw (mangled) name of the symbol
nameSpaceThe optional namespace of the symbols to retrieve
Returns
The symbol with that raw name

◆ GetSymbolsByName()

vector< Ref< Symbol > > BinaryView::GetSymbolsByName ( const std::string &  name,
const NameSpace nameSpace = NameSpace() 
)

Retrieves a list of symbols with a given name.

Parameters
nameName to search for
nameSpaceThe optional namespace of the symbols to retrieve
Returns
List of symbols with that name

◆ GetSymbolsByRawName()

vector< Ref< Symbol > > BinaryView::GetSymbolsByRawName ( const std::string &  name,
const NameSpace nameSpace = NameSpace() 
)

Retrieves the list of all Symbol objects with a given raw name.

Parameters
nameRawName to search for
nameSpaceThe optional namespace of the symbols to retrieve
Returns
A list of symbols

◆ GetSymbols() [1/2]

vector< Ref< Symbol > > BinaryView::GetSymbols ( const NameSpace nameSpace = NameSpace())

Retrieves the list of all Symbol objects.

Parameters
nameSpaceThe optional namespace of the symbols to retrieve
Returns
A list of symbols

◆ GetSymbols() [2/2]

vector< Ref< Symbol > > BinaryView::GetSymbols ( uint64_t  start,
uint64_t  len,
const NameSpace nameSpace = NameSpace() 
)

Retrieves a list of symbols in a given range.

Parameters
startVirtual address start of the range
lenLength of the range
nameSpaceThe optional namespace of the symbols to retrieve
Returns
A list of symbols for a given type

◆ GetSymbolsOfType() [1/2]

vector< Ref< Symbol > > BinaryView::GetSymbolsOfType ( BNSymbolType  type,
const NameSpace nameSpace = NameSpace() 
)

Retrieves a list of all Symbol objects of the provided symbol type.

Parameters
typeThe symbol type
nameSpaceThe optional namespace of the symbols to retrieve
Returns
A list of symbols for a given type

◆ GetSymbolsOfType() [2/2]

vector< Ref< Symbol > > BinaryView::GetSymbolsOfType ( BNSymbolType  type,
uint64_t  start,
uint64_t  len,
const NameSpace nameSpace = NameSpace() 
)

Retrieves a list of all Symbol objects of the provided symbol type in the given range.

Parameters
typeThe symbol type
startVirtual address start of the range
lenLength of the range
nameSpaceThe optional namespace of the symbols to retrieve
Returns
A list of symbols for a given type in the given range

◆ GetVisibleSymbols()

std::vector< Ref< Symbol > > BinaryView::GetVisibleSymbols ( const NameSpace nameSpace = NameSpace())

Get the list of visible symbols.

Parameters
nameSpaceThe optional namespace of the symbols to retrieve
Returns
A list of visible symbols

◆ DefineAutoSymbol()

void BinaryView::DefineAutoSymbol ( Ref< Symbol sym)

Adds a symbol to the internal list of automatically discovered Symbol objects in a given namespace.

Warning
If multiple symbols for the same address are defined, only the most recent symbol will ever be used.
Parameters
symSymbol to define

◆ DefineAutoSymbolAndVariableOrFunction()

Ref< Symbol > BinaryView::DefineAutoSymbolAndVariableOrFunction ( Ref< Platform platform,
Ref< Symbol sym,
Ref< Type type 
)

Defines an "Auto" symbol, and a Variable/Function alongside it.

Parameters
platformPlatform for the Type being defined
symSymbol being definedd
typeType being defined
Returns
The defined symbol

◆ UndefineAutoSymbol()

void BinaryView::UndefineAutoSymbol ( Ref< Symbol sym)

Undefine an automatically defined symbol.

Parameters
symThe symbol to undefine

◆ DefineUserSymbol()

void BinaryView::DefineUserSymbol ( Ref< Symbol sym)

Define a user symbol.

Parameters
symSymbol to define

◆ UndefineUserSymbol()

void BinaryView::UndefineUserSymbol ( Ref< Symbol sym)

Undefine a user symbol.

Parameters
symSymbol to undefinee

◆ DefineImportedFunction()

void BinaryView::DefineImportedFunction ( Ref< Symbol importAddressSym,
Ref< Function func,
Ref< Type type = nullptr 
)

Defines an imported Function func with a ImportedFunctionSymbol type.

Parameters
importAddressSymSymbol for the imported function
funcFunction to define as an imported function
typeOptional type for the function

◆ GetDebugInfo()

Ref< DebugInfo > BinaryView::GetDebugInfo ( )

The current debug info object for this binary view.

Returns
The current debug info object for this binary view

◆ ApplyDebugInfo()

void BinaryView::ApplyDebugInfo ( Ref< DebugInfo newDebugInfo)

Sets the debug info and applies its contents to the current BinaryView.

Parameters
newDebugInfo

◆ SetDebugInfo()

void BinaryView::SetDebugInfo ( Ref< DebugInfo newDebugInfo)

Sets the debug info for the current binary view.

Parameters
newDebugInfoSets the debug info for the current binary view

◆ IsApplyingDebugInfo()

bool BinaryView::IsApplyingDebugInfo ( ) const

Determine is a debug info object is currently being applied.

Returns
True if a debug info object is currently being applied

◆ BeginBulkModifySymbols()

void BinaryView::BeginBulkModifySymbols ( )

◆ EndBulkModifySymbols()

void BinaryView::EndBulkModifySymbols ( )

◆ AddTagType()

void BinaryView::AddTagType ( Ref< TagType tagType)

Add a new TagType to this binaryview.

Parameters
tagTypeTagType to add

◆ RemoveTagType()

void BinaryView::RemoveTagType ( Ref< TagType tagType)

Remove a TagType from this binaryview.

Parameters
tagTypeTagType to remove

◆ GetTagType() [1/2]

Ref< TagType > BinaryView::GetTagType ( const std::string &  name)

Get a TagType by name.

Parameters
nameName of the TagType
Returns
The TagType, if it was found

◆ GetTagType() [2/2]

Ref< TagType > BinaryView::GetTagType ( const std::string &  name,
TagType::Type  type 
)

Get a TagType by name and TagType::Type.

Parameters
nameName of the TagType
typeType of the TagType
Returns
The TagType, if it was found

◆ GetTagTypeByName() [1/2]

Ref< TagType > BinaryView::GetTagTypeByName ( const std::string &  name)

Get a TagType by name.

Parameters
nameName of the TagType
Returns
The TagType, if it was found

◆ GetTagTypeByName() [2/2]

Ref< TagType > BinaryView::GetTagTypeByName ( const std::string &  name,
TagType::Type  type 
)

Get a TagType by name and TagType::Type.

Parameters
nameName of the TagType
typeType of the TagType
Returns
The TagType, if it was found

◆ GetTagTypeById() [1/2]

Ref< TagType > BinaryView::GetTagTypeById ( const std::string &  id)

Get a TagType by its ID.

Parameters
idID of the TagType
Returns
The TagType, if it was found

◆ GetTagTypeById() [2/2]

Ref< TagType > BinaryView::GetTagTypeById ( const std::string &  id,
TagType::Type  type 
)

Get a TagType by its ID and TagType::Type.

Parameters
idID of the TagType
typeType of the TagType
Returns
The TagType, if it was found

◆ GetTagTypes()

std::vector< Ref< TagType > > BinaryView::GetTagTypes ( )

Get the list of all defined TagTypes.

Returns
Get the list of all defined TagTypes

◆ AddTag()

void BinaryView::AddTag ( Ref< Tag tag,
bool  user = false 
)

Add a Tag.

Parameters
tagThe tag to add
userWhether this was added by a user or automatically by analysis

◆ RemoveTag()

void BinaryView::RemoveTag ( Ref< Tag tag,
bool  user = false 
)

Remove a tag.

Parameters
tagThe tag to remove
userWhether the tag being removed is a user tag

◆ GetTag()

Ref< Tag > BinaryView::GetTag ( const std::string &  tagId)

Get a tag by its ID.

Parameters
tagIdthe tag ID
Returns
The tag, if it was found

◆ GetAllTagReferences()

std::vector< TagReference > BinaryView::GetAllTagReferences ( )

◆ GetAllAddressTagReferences()

std::vector< TagReference > BinaryView::GetAllAddressTagReferences ( )

◆ GetAllFunctionTagReferences()

std::vector< TagReference > BinaryView::GetAllFunctionTagReferences ( )

◆ GetAllTagReferencesOfType()

std::vector< TagReference > BinaryView::GetAllTagReferencesOfType ( Ref< TagType tagType)

◆ GetTagReferencesOfType()

std::vector< TagReference > BinaryView::GetTagReferencesOfType ( Ref< TagType tagType)

◆ GetTagReferencesOfTypeCount()

size_t BinaryView::GetTagReferencesOfTypeCount ( Ref< TagType tagType)

◆ GetAllTagReferencesOfTypeCount()

size_t BinaryView::GetAllTagReferencesOfTypeCount ( Ref< TagType tagType)

◆ GetAllTagReferenceTypeCounts()

std::map< Ref< TagType >, size_t > BinaryView::GetAllTagReferenceTypeCounts ( )

◆ GetDataTagReferences()

std::vector< TagReference > BinaryView::GetDataTagReferences ( )

◆ GetAutoDataTagReferences()

std::vector< TagReference > BinaryView::GetAutoDataTagReferences ( )

◆ GetUserDataTagReferences()

std::vector< TagReference > BinaryView::GetUserDataTagReferences ( )

◆ GetDataTags()

std::vector< Ref< Tag > > BinaryView::GetDataTags ( uint64_t  addr)

◆ GetAutoDataTags()

std::vector< Ref< Tag > > BinaryView::GetAutoDataTags ( uint64_t  addr)

◆ GetUserDataTags()

std::vector< Ref< Tag > > BinaryView::GetUserDataTags ( uint64_t  addr)

◆ GetDataTagsOfType()

std::vector< Ref< Tag > > BinaryView::GetDataTagsOfType ( uint64_t  addr,
Ref< TagType tagType 
)

◆ GetAutoDataTagsOfType()

std::vector< Ref< Tag > > BinaryView::GetAutoDataTagsOfType ( uint64_t  addr,
Ref< TagType tagType 
)

◆ GetUserDataTagsOfType()

std::vector< Ref< Tag > > BinaryView::GetUserDataTagsOfType ( uint64_t  addr,
Ref< TagType tagType 
)

◆ GetDataTagsInRange()

std::vector< TagReference > BinaryView::GetDataTagsInRange ( uint64_t  start,
uint64_t  end 
)

◆ GetAutoDataTagsInRange()

std::vector< TagReference > BinaryView::GetAutoDataTagsInRange ( uint64_t  start,
uint64_t  end 
)

◆ GetUserDataTagsInRange()

std::vector< TagReference > BinaryView::GetUserDataTagsInRange ( uint64_t  start,
uint64_t  end 
)

◆ AddAutoDataTag()

void BinaryView::AddAutoDataTag ( uint64_t  addr,
Ref< Tag tag 
)

◆ RemoveAutoDataTag()

void BinaryView::RemoveAutoDataTag ( uint64_t  addr,
Ref< Tag tag 
)

◆ RemoveAutoDataTagsOfType()

void BinaryView::RemoveAutoDataTagsOfType ( uint64_t  addr,
Ref< TagType tagType 
)

◆ AddUserDataTag()

void BinaryView::AddUserDataTag ( uint64_t  addr,
Ref< Tag tag 
)

◆ RemoveUserDataTag()

void BinaryView::RemoveUserDataTag ( uint64_t  addr,
Ref< Tag tag 
)

◆ RemoveUserDataTagsOfType()

void BinaryView::RemoveUserDataTagsOfType ( uint64_t  addr,
Ref< TagType tagType 
)

◆ RemoveTagReference()

void BinaryView::RemoveTagReference ( const TagReference ref)

◆ CreateAutoDataTag() [1/2]

Ref< Tag > BinaryView::CreateAutoDataTag ( uint64_t  addr,
const std::string &  tagTypeName,
const std::string &  data,
bool  unique = false 
)

◆ CreateUserDataTag() [1/2]

Ref< Tag > BinaryView::CreateUserDataTag ( uint64_t  addr,
const std::string &  tagTypeName,
const std::string &  data,
bool  unique = false 
)

◆ CreateAutoDataTag() [2/2]

Ref< Tag > BinaryView::CreateAutoDataTag ( uint64_t  addr,
Ref< TagType tagType,
const std::string &  data,
bool  unique = false 
)

◆ CreateUserDataTag() [2/2]

Ref< Tag > BinaryView::CreateUserDataTag ( uint64_t  addr,
Ref< TagType tagType,
const std::string &  data,
bool  unique = false 
)

◆ GetComponentByGuid()

std::optional< Ref< Component > > BinaryView::GetComponentByGuid ( std::string  guid)

Lookup a component by its GUID.

Parameters
guidGUID of the component to look up
Returns
The component with that GUID

◆ GetComponentByPath()

std::optional< Ref< Component > > BinaryView::GetComponentByPath ( std::string  path)

Lookup a component by its pathname.

Note
This is a convenience method, and for performance-sensitive lookups, GetComponentByGuid is very highly recommended.
See also
GetComponentByGuid, Component::GetGuid

All lookups are absolute from the root component, and are case-sensitive. Pathnames are delimited with "/"

Lookups are done using the display name of the component, which is liable to change when it or its siblings are moved around.

See also
Component::GetDisplayName
Parameters
pathPath of the desired component
Returns
The component at that path

◆ GetRootComponent()

Ref< Component > BinaryView::GetRootComponent ( )

Get the root component for the BinaryView (read-only)

This Component cannot be removed, and houses all unparented Components.

Returns
The Root Component

◆ CreateComponent() [1/3]

Ref< Component > BinaryView::CreateComponent ( )

Create a component.

This component will be added to the root component and initialized with the name "Component"

Returns
The created Component

◆ CreateComponent() [2/3]

Ref< Component > BinaryView::CreateComponent ( std::string  parentGUID)

Create a component as a subcomponent of the component with a given Guid.

This component will be initialized with the name "Component"

Parameters
parentGUIDGuid of the component this component will be added to
Returns
The created Component

◆ CreateComponent() [3/3]

Ref< Component > BinaryView::CreateComponent ( Ref< Component parent)

Create a component as a subcomponent of a given Component.

This component will be initialized with the name "Component"

Parameters
parentParent Component
Returns
The created Component

◆ CreateComponentWithName() [1/2]

Ref< Component > BinaryView::CreateComponentWithName ( std::string  name,
std::string  parentGUID = {} 
)

Create a component with a given name and optional parent.

Parameters
nameName to initialize the component with
parentGUIDOptional Guid of the component this component will be added to
Returns
The created Component

◆ CreateComponentWithName() [2/2]

Ref< Component > BinaryView::CreateComponentWithName ( std::string  name,
Ref< Component parent 
)

Create a component with a given name and parent.

Parameters
nameName to initialize the component with
parentGUIDGuid of the component this component will be added to
Returns
The created Component

◆ RemoveComponent() [1/2]

bool BinaryView::RemoveComponent ( Ref< Component component)

Remove a component from the tree entirely.

This will also by nature remove all subcomponents.

Parameters
componentComponent to remove
Returns
Whether removal was successful

◆ RemoveComponent() [2/2]

bool BinaryView::RemoveComponent ( std::string  guid)

Remove a component from the tree entirely.

This will also by nature remove all subcomponents.

Parameters
guidGuid of the Component to remove
Returns
Whether removal was successful

◆ GetFunctionParentComponents()

std::vector< Ref< Component > > BinaryView::GetFunctionParentComponents ( Ref< Function function) const

◆ GetDataVariableParentComponents()

std::vector< Ref< Component > > BinaryView::GetDataVariableParentComponents ( DataVariable  var) const

◆ CanAssemble()

bool BinaryView::CanAssemble ( Architecture arch)

Check whether the given architecture supports assembling instructions.

Parameters
archArchitecture to check
Returns
Whether the given architecture supports assembling instructions

◆ IsNeverBranchPatchAvailable()

bool BinaryView::IsNeverBranchPatchAvailable ( Architecture arch,
uint64_t  addr 
)

Check whether the "Never Branch" patch is available for a given architecture at a given address.

Parameters
archArchitecture to check
addrAddress of the instruction to be patched
Returns
Whether the "Never Branch" patch is available

◆ IsAlwaysBranchPatchAvailable()

bool BinaryView::IsAlwaysBranchPatchAvailable ( Architecture arch,
uint64_t  addr 
)

Check whether the "Always Branch" patch is available for a given architecture at a given address.

Parameters
archArchitecture to check
addrAddress of the instruction to be patched
Returns
Whether the "Always Branch" patch is available

◆ IsInvertBranchPatchAvailable()

bool BinaryView::IsInvertBranchPatchAvailable ( Architecture arch,
uint64_t  addr 
)

Check whether the "Invert Branch" patch is available for a given architecture at a given address.

Parameters
archArchitecture to check
addrAddress of the instruction to be patched
Returns
Whether the "Invert Branch" patch is available

◆ IsSkipAndReturnZeroPatchAvailable()

bool BinaryView::IsSkipAndReturnZeroPatchAvailable ( Architecture arch,
uint64_t  addr 
)

Check whether the "Skip and Return Zero" patch is available for a given architecture at a given address.

Parameters
archArchitecture to check
addrAddress of the instruction to be patched
Returns
Whether the "Skip and Return Zero" patch is available

◆ IsSkipAndReturnValuePatchAvailable()

bool BinaryView::IsSkipAndReturnValuePatchAvailable ( Architecture arch,
uint64_t  addr 
)

Check whether the "Skip and Return Value" patch is available for a given architecture at a given address.

Parameters
archArchitecture to check
addrAddress of the instruction to be patched
Returns
Whether the "Skip and Return Value" patch is available

◆ ConvertToNop()

bool BinaryView::ConvertToNop ( Architecture arch,
uint64_t  addr 
)

Convert the instruction at the given address to a nop.

Parameters
archArchitecture of the instruction to convert
addrAddress of the instruction to be patched
Returns
Whether the patch was successful

◆ AlwaysBranch()

bool BinaryView::AlwaysBranch ( Architecture arch,
uint64_t  addr 
)

Convert the conditional branch at the given address to always branch.

Parameters
archArchitecture of the instruction to convert
addrAddress of the instruction to be patched
Returns
Whether the patch was successful

◆ InvertBranch()

bool BinaryView::InvertBranch ( Architecture arch,
uint64_t  addr 
)

Convert the conditional branch at the given address to branch under inverted conditions.

Parameters
archArchitecture of the instruction to convert
addrAddress of the instruction to be patched
Returns
Whether the patch was successful

◆ SkipAndReturnValue()

bool BinaryView::SkipAndReturnValue ( Architecture arch,
uint64_t  addr,
uint64_t  value 
)

Convert the given instruction to skip the rest of the function and return 0.

Parameters
archArchitecture of the instruction to convert
addrAddress of the instruction to be patched
valueValue to return
Returns
Whether the patch was successful

◆ GetInstructionLength()

size_t BinaryView::GetInstructionLength ( Architecture arch,
uint64_t  addr 
)

Get the length of the instruction at a given address.

Parameters
archArchitecture of the instruction
addrAddress of the start of the instruction
Returns
The length of the instruction

◆ GetStringAtAddress()

bool BinaryView::GetStringAtAddress ( uint64_t  addr,
BNStringReference strRef 
)

Get the string at an address.

Parameters
[in]addrAddress of the string
[out]strRefReference to a StringReference the string reference will be writen to.
Returns
Whether a string was at th given address

◆ GetStrings() [1/2]

vector< BNStringReference > BinaryView::GetStrings ( )

Get the list of strings located within the view.

Returns
The list of strings

◆ GetStrings() [2/2]

vector< BNStringReference > BinaryView::GetStrings ( uint64_t  start,
uint64_t  len 
)

Get the list of strings located within a range.

Parameters
startStarting virtual address of the range
lenLength of the range
Returns
The list of strings

◆ AddAnalysisCompletionEvent()

Ref< AnalysisCompletionEvent > BinaryView::AddAnalysisCompletionEvent ( const std::function< void()> &  callback)

Sets up a call back function to be called when analysis has been completed.

This is helpful when using UpdateAnalysis which does not wait for analysis completion before returning.

The callee of this function is not responsible for maintaining the lifetime of the returned AnalysisCompletionEvent object

Parameters
callbackA function to be called with no parameters when analysis has completed.
Returns
An initialized AnalysisCompletionEvent object.

◆ GetAnalysisInfo()

AnalysisInfo BinaryView::GetAnalysisInfo ( )

◆ GetAnalysisProgress()

BNAnalysisProgress BinaryView::GetAnalysisProgress ( )

◆ GetBackgroundAnalysisTask()

Ref< BackgroundTask > BinaryView::GetBackgroundAnalysisTask ( )

◆ GetNextFunctionStartAfterAddress()

uint64_t BinaryView::GetNextFunctionStartAfterAddress ( uint64_t  addr)

Returns the virtual address of the Function that occurs after the virtual address addr

Parameters
addrAddress to start searching
Returns
Next function start

◆ GetNextBasicBlockStartAfterAddress()

uint64_t BinaryView::GetNextBasicBlockStartAfterAddress ( uint64_t  addr)

Returns the virtual address of the BasicBlock that occurs after the virtual address addr

Parameters
addrAddress to start searching
Returns
Next basic block start

◆ GetNextDataAfterAddress()

uint64_t BinaryView::GetNextDataAfterAddress ( uint64_t  addr)

Retrieves the virtual address of the next non-code byte.

Parameters
addrAddress to start searching
Returns
address of the next non-code byte

◆ GetNextDataVariableStartAfterAddress()

uint64_t BinaryView::GetNextDataVariableStartAfterAddress ( uint64_t  addr)

Retrieves the address of the next DataVariable.

Parameters
addrAddress to start searching
Returns
address of the next DataVariable

◆ GetPreviousFunctionStartBeforeAddress()

uint64_t BinaryView::GetPreviousFunctionStartBeforeAddress ( uint64_t  addr)

Returns the virtual address of the Function that occurs prior to the virtual address provided.

Parameters
addrAddress to start searching
Returns
the virtual address of the previous Function

◆ GetPreviousBasicBlockStartBeforeAddress()

uint64_t BinaryView::GetPreviousBasicBlockStartBeforeAddress ( uint64_t  addr)

Returns the virtual address of the Basic Block that occurs prior to the virtual address provided.

Parameters
addrAddress to start searching
Returns
The virtual address of the previous Basic Block

◆ GetPreviousBasicBlockEndBeforeAddress()

uint64_t BinaryView::GetPreviousBasicBlockEndBeforeAddress ( uint64_t  addr)

Returns the ending virtual address of the Basic Block that occurs prior to the virtual address provided.

Parameters
addrAddress to start searching
Returns
The ending virtual address of the previous Basic Block

◆ GetPreviousDataBeforeAddress()

uint64_t BinaryView::GetPreviousDataBeforeAddress ( uint64_t  addr)

Returns the virtual address of the previous data (non-code) byte.

Parameters
addrAddress to start searching
Returns
The virtual address of the previous non-code byte

◆ GetPreviousDataVariableStartBeforeAddress()

uint64_t BinaryView::GetPreviousDataVariableStartBeforeAddress ( uint64_t  addr)

Returns the virtual address of the previous DataVariable.

Parameters
addrAddress to start searching
Returns
The virtual address of the previous DataVariable

◆ ParsePossibleValueSet()

bool BinaryView::ParsePossibleValueSet ( const std::string &  value,
BNRegisterValueType  state,
PossibleValueSet result,
uint64_t  here,
std::string &  errors 
)

◆ ParseTypeString() [1/2]

bool BinaryNinja::BinaryView::ParseTypeString ( const std::string &  text,
QualifiedNameAndType result,
std::string &  errors,
const std::set< QualifiedName > &  typesAllowRedefinition = {} 
)

Parse a single type and name from a string containing their definition.

Parameters
[in]textText containing the type definition
[out]resultReference into which the resulting type and name will be written
[out]errorsReference to a list into which any parse errors will be written
typesAllowRedefinition
Returns
Whether parsing was successful

◆ ParseTypeString() [2/2]

bool BinaryNinja::BinaryView::ParseTypeString ( const std::string &  text,
std::map< QualifiedName, Ref< Type > > &  types,
std::map< QualifiedName, Ref< Type > > &  variables,
std::map< QualifiedName, Ref< Type > > &  functions,
std::string &  errors,
const std::set< QualifiedName > &  typesAllowRedefinition = {} 
)

Parse an entire block of source into types, variables, and functions.

Parameters
[in]textSource code to parse
[out]typesReference to a map of QualifiedNames and Types the parsed types will be writen to
[out]variablesReference to a list of QualifiedNames and Types the parsed variables will be writen to
[out]functionsReference to a list of QualifiedNames and Types the parsed functions will be writen to
[out]errorsReference to a list into which any parse errors will be written
typesAllowRedefinition
Returns
Whether parsing was successful

◆ ParseTypesFromSource()

bool BinaryView::ParseTypesFromSource ( const std::string &  text,
const std::vector< std::string > &  options,
const std::vector< std::string > &  includeDirs,
TypeParserResult result,
std::string &  errors,
const std::set< QualifiedName > &  typesAllowRedefinition = {} 
)

◆ GetTypes()

map< QualifiedName, Ref< Type > > BinaryView::GetTypes ( )

◆ GetDependencySortedTypes()

vector< pair< QualifiedName, Ref< Type > > > BinaryView::GetDependencySortedTypes ( )

List of all types, sorted such that types are after all types on which they depend.

Order is guaranteed for any collection of types with no cycles. If you have cycles in type dependencies, order for types in a cycle is not guaranteed.

Note
Dependency order is based on named type references for all non-structure types, i.e. struct Foo m_foo will induce a dependency, whereas struct Foo* m_pFoo will not.
Returns
Sorted types as defined above

◆ GetTypeNames()

vector< QualifiedName > BinaryView::GetTypeNames ( const std::string &  matching = "")

◆ GetTypeByName()

Ref< Type > BinaryView::GetTypeByName ( const QualifiedName name)

◆ GetTypeByRef()

Ref< Type > BinaryView::GetTypeByRef ( Ref< NamedTypeReference name)

◆ GetTypeById()

Ref< Type > BinaryView::GetTypeById ( const std::string &  id)

◆ GetTypeId()

string BinaryView::GetTypeId ( const QualifiedName name)

◆ GetTypeNameById()

QualifiedName BinaryView::GetTypeNameById ( const std::string &  id)

◆ IsTypeAutoDefined()

bool BinaryView::IsTypeAutoDefined ( const QualifiedName name)

◆ DefineType()

QualifiedName BinaryView::DefineType ( const std::string &  id,
const QualifiedName defaultName,
Ref< Type type 
)

◆ DefineTypes()

void BinaryView::DefineTypes ( const std::vector< std::pair< std::string, QualifiedNameAndType > > &  types,
std::function< bool(size_t, size_t)>  progress = {} 
)

◆ DefineUserType()

void BinaryView::DefineUserType ( const QualifiedName name,
Ref< Type type 
)

◆ DefineUserTypes() [1/2]

void BinaryNinja::BinaryView::DefineUserTypes ( const std::vector< QualifiedNameAndType > &  types,
std::function< bool(size_t, size_t)>  progress = {} 
)

◆ DefineUserTypes() [2/2]

void BinaryNinja::BinaryView::DefineUserTypes ( const std::vector< ParsedType > &  types,
std::function< bool(size_t, size_t)>  progress = {} 
)

◆ UndefineType()

void BinaryView::UndefineType ( const std::string &  id)

◆ UndefineUserType()

void BinaryView::UndefineUserType ( const QualifiedName name)

◆ RenameType()

void BinaryView::RenameType ( const QualifiedName oldName,
const QualifiedName newName 
)

◆ RegisterPlatformTypes()

void BinaryView::RegisterPlatformTypes ( Platform platform)

◆ LookupImportedTypePlatform()

std::optional< std::pair< Ref< Platform >, QualifiedName > > BinaryView::LookupImportedTypePlatform ( const QualifiedName name)

Gives you details of which platform and name was imported to result in the given type name.

Parameters
nameName of type in the binary view
Returns
A pair with the platform and the name of the type in the platform, or std::nullopt if it was not imported

◆ AddTypeLibrary()

void BinaryView::AddTypeLibrary ( TypeLibrary lib)

Make the contents of a type library available for type/import resolution.

Parameters
liblibrary to register with the view

◆ GetTypeLibrary()

Ref< TypeLibrary > BinaryView::GetTypeLibrary ( const std::string &  name)

Get the type library with the given name.

Parameters
nameLibrary name to lookup
Returns
The Type Library object, or nullptr if one has not been added with this name

◆ GetTypeLibraries()

std::vector< Ref< TypeLibrary > > BinaryView::GetTypeLibraries ( )

Get the list of imported type libraries.

Returns
All imported type libraries

◆ ImportTypeLibraryType()

Ref< Type > BinaryView::ImportTypeLibraryType ( Ref< TypeLibrary > &  lib,
const QualifiedName name 
)

Recursively imports a type from the specified type library, or, if no library was explicitly provided, the first type library associated with the current BinaryView that provides the name requested.

This may have the impact of loading other type libraries as dependencies on other type libraries are lazily resolved when references to types provided by them are first encountered.

Note that the name actually inserted into the view may not match the name as it exists in the type library in the event of a name conflict. To aid in this, the Type object returned is a NamedTypeReference to the deconflicted name used.

Parameters
lib
name
Returns
A NamedTypeReference to the type, taking into account any renaming performed

◆ ImportTypeLibraryObject()

Ref< Type > BinaryView::ImportTypeLibraryObject ( Ref< TypeLibrary > &  lib,
const QualifiedName name 
)

Recursively imports an object from the specified type library, or, if no library was explicitly provided, the first type library associated with the current BinaryView that provides the name requested.

This may have the impact of loading other type libraries as dependencies on other type libraries are lazily resolved when references to types provided by them are first encountered.

.. note:: If you are implementing a custom BinaryView and use this method to import object types, you should then call RecordImportedObjectLibrary with the details of where the object is located.

Parameters
lib
name
Returns
The object type, with any interior NamedTypeReferences renamed as necessary to be appropriate for the current view

◆ ExportTypeToTypeLibrary()

void BinaryView::ExportTypeToTypeLibrary ( TypeLibrary lib,
const QualifiedName name,
Type type 
)

Recursively exports type into lib as a type with name name

As other referenced types are encountered, they are either copied into the destination type library or else the type library that provided the referenced type is added as a dependency for the destination library.

Parameters
lib
name
type

◆ ExportObjectToTypeLibrary()

void BinaryView::ExportObjectToTypeLibrary ( TypeLibrary lib,
const QualifiedName name,
Type type 
)

Recursively exports type into lib as an object with name name

As other referenced types are encountered, they are either copied into the destination type library or else the type library that provided the referenced type is added as a dependency for the destination library.

Parameters
lib
name
type

◆ RecordImportedObjectLibrary()

void BinaryView::RecordImportedObjectLibrary ( Platform tgtPlatform,
uint64_t  tgtAddr,
TypeLibrary lib,
const QualifiedName name 
)

Should be called by custom BinaryView implementations when they have successfully imported an object from a type library (eg a symbol's type).

Values recorded with this function will then be queryable via LookupImportedObjectLibrary.

Parameters
tgtPlatformPlatform of symbol at import site
tgtAddrAddress of symbol at import site
libType Library containing the imported type
nameName of the object in the type library

◆ LookupImportedObjectLibrary()

std::optional< std::pair< Ref< TypeLibrary >, QualifiedName > > BinaryView::LookupImportedObjectLibrary ( Platform tgtPlatform,
uint64_t  tgtAddr 
)

Gives you details of which type library and name was used to determine the type of a symbol at a given address.

Parameters
tgtPlatformPlatform of symbol at import site
tgtAddrAddress of symbol at import site
Returns
A pair with the library and name used, or std::nullopt if it was not imported

◆ LookupImportedTypeLibrary()

std::optional< std::pair< Ref< TypeLibrary >, QualifiedName > > BinaryView::LookupImportedTypeLibrary ( const QualifiedName name)

Gives you details of which type library and name was imported to result in the given type name.

Parameters
nameName of type in the binary view
Returns
A pair with the library and the name of the type in the library, or std::nullopt if it was not imported

◆ FindNextData() [1/2]

bool BinaryView::FindNextData ( uint64_t  start,
const DataBuffer data,
uint64_t &  result,
BNFindFlag  flags = FindCaseSensitive 
)

◆ FindNextText() [1/2]

bool BinaryView::FindNextText ( uint64_t  start,
const std::string &  data,
uint64_t &  result,
Ref< DisassemblySettings settings,
BNFindFlag  flags = FindCaseSensitive,
BNFunctionGraphType  graph = NormalFunctionGraph 
)

◆ FindNextConstant() [1/2]

bool BinaryView::FindNextConstant ( uint64_t  start,
uint64_t  constant,
uint64_t &  result,
Ref< DisassemblySettings settings,
BNFunctionGraphType  graph = NormalFunctionGraph 
)

◆ FindNextData() [2/2]

bool BinaryView::FindNextData ( uint64_t  start,
uint64_t  end,
const DataBuffer data,
uint64_t &  addr,
BNFindFlag  flags,
const std::function< bool(size_t current, size_t total)> &  progress 
)

◆ FindNextText() [2/2]

bool BinaryView::FindNextText ( uint64_t  start,
uint64_t  end,
const std::string &  data,
uint64_t &  addr,
Ref< DisassemblySettings settings,
BNFindFlag  flags,
BNFunctionGraphType  graph,
const std::function< bool(size_t current, size_t total)> &  progress 
)

◆ FindNextConstant() [2/2]

bool BinaryView::FindNextConstant ( uint64_t  start,
uint64_t  end,
uint64_t  constant,
uint64_t &  addr,
Ref< DisassemblySettings settings,
BNFunctionGraphType  graph,
const std::function< bool(size_t current, size_t total)> &  progress 
)

◆ FindAllData()

bool BinaryView::FindAllData ( uint64_t  start,
uint64_t  end,
const DataBuffer data,
BNFindFlag  flags,
const std::function< bool(size_t current, size_t total)> &  progress,
const std::function< bool(uint64_t addr, const DataBuffer &match)> &  matchCallback 
)

◆ FindAllText()

bool BinaryView::FindAllText ( uint64_t  start,
uint64_t  end,
const std::string &  data,
Ref< DisassemblySettings settings,
BNFindFlag  flags,
BNFunctionGraphType  graph,
const std::function< bool(size_t current, size_t total)> &  progress,
const std::function< bool(uint64_t addr, const std::string &match, const LinearDisassemblyLine &line)> &  matchCallback 
)

◆ FindAllConstant()

bool BinaryView::FindAllConstant ( uint64_t  start,
uint64_t  end,
uint64_t  constant,
Ref< DisassemblySettings settings,
BNFunctionGraphType  graph,
const std::function< bool(size_t current, size_t total)> &  progress,
const std::function< bool(uint64_t addr, const LinearDisassemblyLine &line)> &  matchCallback 
)

◆ Reanalyze()

void BinaryView::Reanalyze ( )

◆ GetWorkflow()

Ref< Workflow > BinaryView::GetWorkflow ( ) const

◆ ShowPlainTextReport()

void BinaryView::ShowPlainTextReport ( const std::string &  title,
const std::string &  contents 
)

Displays contents to the user in the UI or on the command-line.

Note
This API functions differently on the command-line vs the UI. In the UI, it will be rendered in a new tab. From the command line, a simple text prompt is used.
Parameters
titleTitle for the report
contentsContents of the report

◆ ShowMarkdownReport()

void BinaryView::ShowMarkdownReport ( const std::string &  title,
const std::string &  contents,
const std::string &  plainText 
)

Displays markdown contents to the user in the UI or on the command-line.

Note
This API functions differently on the command-line vs the UI. In the UI, it will be rendered in a new tab. From the command line, a simple text prompt is used.
Parameters
titleTitle for the report
contentsMarkdown contents of the report
plainTextPlaintext contents of the report (used on the command line)

◆ ShowHTMLReport()

void BinaryView::ShowHTMLReport ( const std::string &  title,
const std::string &  contents,
const std::string &  plainText 
)

Displays HTML contents to the user in the UI or on the command-line.

Note
This API functions differently on the command-line vs the UI. In the UI, it will be rendered in a new tab. From the command line, a simple text prompt is used.
Parameters
titleTitle for the report
contentsHTML contents of the report
plainTextPlaintext contents of the report (used on the command line)

◆ ShowGraphReport()

void BinaryView::ShowGraphReport ( const std::string &  title,
FlowGraph graph 
)

Displays a flow graph in UI applications and nothing in command-line applications.

Note
This API has no effect outside of the UI
Parameters
titleTitle for the report
graphFlowGraph object to be rendered.

◆ GetAddressInput() [1/2]

bool BinaryNinja::BinaryView::GetAddressInput ( uint64_t &  result,
const std::string &  prompt,
const std::string &  title 
)

Prompts the user to input an unsigned integer with the given prompt and title.

Parameters
[out]resultReference to the uint64_t the result will be copied to
[in]promptPrompt for the input
[in]titleTitle for the input popup when used in UI
Returns
Whether an integer was successfully received

◆ GetAddressInput() [2/2]

bool BinaryNinja::BinaryView::GetAddressInput ( uint64_t &  result,
const std::string &  prompt,
const std::string &  title,
uint64_t  currentAddress 
)

Prompts the user to input an unsigned integer with the given prompt and title.

Parameters
[out]resultReference to the uint64_t the result will be copied to
[in]promptPrompt for the input
[in]titleTitle for the input popup when used in UI
[in]currentAddressAddress to use for relative inputs
Returns
Whether an integer was successfully received

◆ AddAutoSegment()

void BinaryView::AddAutoSegment ( uint64_t  start,
uint64_t  length,
uint64_t  dataOffset,
uint64_t  dataLength,
uint32_t  flags 
)

Add an analysis segment that specifies how data from the raw file is mapped into a virtual address space.

Parameters
startStarting virtual address
lengthLength within the virtual address space
dataOffsetData offset in the raw file
dataLengthLength of the data to map from the raw file
flagsSegment r/w/x flags

◆ RemoveAutoSegment()

void BinaryView::RemoveAutoSegment ( uint64_t  start,
uint64_t  length 
)

Removes an automatically generated segment from the current segment mapping.

Warning
This action is not persistent across saving of a BNDB and must be re-applied each time a BNDB is loaded.
Parameters
startVirtual address of the start of the segment
lengthLength of the segment

◆ AddUserSegment()

void BinaryView::AddUserSegment ( uint64_t  start,
uint64_t  length,
uint64_t  dataOffset,
uint64_t  dataLength,
uint32_t  flags 
)

Creates a user-defined segment that specifies how data from the raw file is mapped into a virtual address space.

Parameters
startStarting virtual address
lengthLength within the virtual address space
dataOffsetData offset in the raw file
dataLengthLength of the data to map from the raw file
flagsSegment r/w/x flags

◆ RemoveUserSegment()

void BinaryView::RemoveUserSegment ( uint64_t  start,
uint64_t  length 
)

Removes a user-defined segment from th current segment mapping.

Parameters
startVirtual address of the start of the segment
lengthLength of the segment

◆ GetSegments()

vector< Ref< Segment > > BinaryView::GetSegments ( )

Get the list of registered Segments.

Returns
The list of registered Segments

◆ GetSegmentAt()

Ref< Segment > BinaryView::GetSegmentAt ( uint64_t  addr)

Gets the Segment a given virtual address is located in.

Parameters
addrA virtual address
Returns
The Segment that virtual address is located im

◆ GetAddressForDataOffset()

bool BinaryView::GetAddressForDataOffset ( uint64_t  offset,
uint64_t &  addr 
)

Retrieves the virtual addreses that maps to the given file offset, if possible.

Parameters
[in]offsetRaw file offset
[out]addrReference to a uint64_t the address will be written to
Returns
Whether an address was successfully mapped

◆ AddAutoSection()

void BinaryView::AddAutoSection ( const std::string &  name,
uint64_t  start,
uint64_t  length,
BNSectionSemantics  semantics = DefaultSectionSemantics,
const std::string &  type = "",
uint64_t  align = 1,
uint64_t  entrySize = 0,
const std::string &  linkedSection = "",
const std::string &  infoSection = "",
uint64_t  infoData = 0 
)

Creates an analysis-defined section that can help inform analysis by clarifying what types of data exist in what ranges.

Note that all data specified must already be mapped by an existing segment.

Parameters
nameName of the section
startVirtual address of the start of the section
lengthLength of the section
semanticsSectionSemantics of the section
typeOptional type of the section
alignOptional byte alignment
entrySizeEntry Size of the section
linkedSectionOptional namee of a linked section
infoSectionOptional name of an associated informational section
infoDataOptional Info Data

◆ RemoveAutoSection()

void BinaryView::RemoveAutoSection ( const std::string &  name)

Remove an automatically defined section by name.

Parameters
nameName of the section

◆ AddUserSection()

void BinaryView::AddUserSection ( const std::string &  name,
uint64_t  start,
uint64_t  length,
BNSectionSemantics  semantics = DefaultSectionSemantics,
const std::string &  type = "",
uint64_t  align = 1,
uint64_t  entrySize = 0,
const std::string &  linkedSection = "",
const std::string &  infoSection = "",
uint64_t  infoData = 0 
)

Creates a user-defined section that can help inform analysis by clarifying what types of data exist in what ranges.

Note that all data specified must already be mapped by an existing segment.

Parameters
nameName of the section
startVirtual address of the start of the section
lengthLength of the section
semanticsSectionSemantics of the section
typeOptional type of the section
alignOptional byte alignment
entrySizeEntry Size of the section
linkedSectionOptional namee of a linked section
infoSectionOptional name of an associated informational section
infoDataOptional Info Data

◆ RemoveUserSection()

void BinaryView::RemoveUserSection ( const std::string &  name)

Remove a user defined section by name.

Parameters
nameName of the section to remove

◆ GetSections()

vector< Ref< Section > > BinaryView::GetSections ( )

Get the list of defined sections.

Returns
The list of defined sections

◆ GetSectionsAt()

vector< Ref< Section > > BinaryView::GetSectionsAt ( uint64_t  addr)

Get the list of sections containing addr.

Parameters
addrAddress to check
Returns
List of sections containing addr

◆ GetSectionByName()

Ref< Section > BinaryView::GetSectionByName ( const std::string &  name)

Get a Section by name.

Parameters
nameName of the Section
Returns
The Section with that name

◆ GetUniqueSectionNames()

vector< string > BinaryView::GetUniqueSectionNames ( const std::vector< std::string > &  names)

Create unique names for all items in the input list, modifying them if they are not unique.

std::vector<std::string> names = bv.GetUniqueSectionNames({"sect1", "sect1", "sect2"});
// names == {'sect1', 'sect1#1', 'sect2'}
Parameters
namesList of names
Returns
List of unique names

◆ GetCommentForAddress()

string BinaryView::GetCommentForAddress ( uint64_t  addr) const

Get the comment placed at an address.

Parameters
addrAddress at which to check for a comment
Returns
Comment at that address

◆ GetCommentedAddresses()

vector< uint64_t > BinaryView::GetCommentedAddresses ( ) const

Get the list of commented addresses.

Returns
list of addresses with comments defined at them

◆ SetCommentForAddress()

void BinaryView::SetCommentForAddress ( uint64_t  addr,
const std::string &  comment 
)

Set the comment at an address.

Parameters
addrAddress at which to place a comment
commentComment to place

◆ GetAllocatedRanges()

vector< BNAddressRange > BinaryView::GetAllocatedRanges ( )

Get the list of allocated ranges.

Returns
The list of allocated ranges

◆ StoreMetadata()

void BinaryView::StoreMetadata ( const std::string &  key,
Ref< Metadata value,
bool  isAuto = false 
)

◆ QueryMetadata()

Ref< Metadata > BinaryView::QueryMetadata ( const std::string &  key)

◆ RemoveMetadata()

void BinaryView::RemoveMetadata ( const std::string &  key)

◆ GetStringMetadata()

string BinaryView::GetStringMetadata ( const std::string &  key)

◆ GetRawMetadata()

vector< uint8_t > BinaryView::GetRawMetadata ( const std::string &  key)

◆ GetUIntMetadata()

uint64_t BinaryView::GetUIntMetadata ( const std::string &  key)

◆ GetLoadSettingsTypeNames()

vector< string > BinaryView::GetLoadSettingsTypeNames ( )

◆ GetLoadSettings()

Ref< Settings > BinaryView::GetLoadSettings ( const std::string &  typeName)

◆ SetLoadSettings()

void BinaryView::SetLoadSettings ( const std::string &  typeName,
Ref< Settings settings 
)

◆ GetParametersForAnalysis()

BNAnalysisParameters BinaryView::GetParametersForAnalysis ( )

◆ SetParametersForAnalysis()

void BinaryView::SetParametersForAnalysis ( BNAnalysisParameters  params)

◆ GetMaxFunctionSizeForAnalysis()

uint64_t BinaryView::GetMaxFunctionSizeForAnalysis ( )

◆ SetMaxFunctionSizeForAnalysis()

void BinaryView::SetMaxFunctionSizeForAnalysis ( uint64_t  size)

◆ GetNewAutoFunctionAnalysisSuppressed()

bool BinaryView::GetNewAutoFunctionAnalysisSuppressed ( )

◆ SetNewAutoFunctionAnalysisSuppressed()

void BinaryView::SetNewAutoFunctionAnalysisSuppressed ( bool  suppress)

◆ GetNameSpaces()

set< NameSpace > BinaryView::GetNameSpaces ( ) const

Returns a list of namespaces for the current BinaryView.

Returns
A list of namespaces for the current BinaryView

◆ GetInternalNameSpace()

NameSpace BinaryView::GetInternalNameSpace ( )
static

Internal namespace for the current BinaryView.

Returns
Internal namespace for the current BinaryView

◆ GetExternalNameSpace()

NameSpace BinaryView::GetExternalNameSpace ( )
static

External namespace for the current BinaryView.

Returns
External namespace for the current BinaryView

◆ ParseExpression()

bool BinaryView::ParseExpression ( Ref< BinaryView view,
const std::string &  expression,
uint64_t &  offset,
uint64_t  here,
std::string &  errorString 
)
static

Evaluates a string expression to an integer value.

The parser uses the following rules:

  • Symbols are defined by the lexer as [A-Za-z0-9_:<>][A-Za-z0-9_:$\-<>]+ or anything enclosed in either single or double quotes
  • Symbols are everything in bv.GetSymbols(), unnamed DataVariables (i.e. data_00005000), unnamed functions (i.e. sub_00005000), or section names (i.e. .text)
  • Numbers are defaulted to hexadecimal thus _printf + 10 is equivalent to printf + 0x10 If decimal numbers required use the decimal prefix.
  • Since numbers and symbols can be ambiguous its recommended that you prefix your numbers with the following:
      - ``0x`` - Hexadecimal
      - ``0n`` - Decimal
      - ``0`` - Octal
    
  • In the case of an ambiguous number/symbol (one with no prefix) for instance 12345 we will first attempt to look up the string as a symbol, if a symbol is found its address is used, otherwise we attempt to convert it to a hexadecimal number.
  • The following operations are valid: +, -, \*, /, %, (), &, \|, ^, ~
  • In addition to the above operators there are dereference operators similar to BNIL style IL:
      - ``[<expression>]`` - read the `current address size` at ``<expression>``
      - ``[<expression>].b`` - read the byte at ``<expression>``
      - ``[<expression>].w`` - read the word (2 bytes) at ``<expression>``
      - ``[<expression>].d`` - read the dword (4 bytes) at ``<expression>``
      - ``[<expression>].q`` - read the quadword (8 bytes) at ``<expression>``
    
  • The $here (or more succinctly: $) keyword can be used in calculations and is defined as the here parameter, or the currently selected address
  • The $start/$end keyword represents the address of the first/last bytes in the file respectively
Parameters
[in]viewView object for relative selections
[in]expressionExpression to parse
[out]offsetParsed expression
[in]hereThe location for $here
[out]errorStringAny errors that occurred during parsing
Returns
Whether the parsing was successful

◆ HasSymbols()

bool BinaryView::HasSymbols ( ) const

Check whether this BinaryView has any defined symbols.

Returns
Whether this BinaryView has any defined symbols

◆ HasDataVariables()

bool BinaryView::HasDataVariables ( ) const

Check whether this BinaryView has any defined DataVariables.

Returns
Whether this BinaryView has any defined DataVariables

◆ CreateStructureFromOffsetAccess()

Ref< Structure > BinaryView::CreateStructureFromOffsetAccess ( const QualifiedName type,
bool *  newMemberAdded 
) const

◆ CreateStructureMemberFromAccess()

Confidence< Ref< Type > > BinaryView::CreateStructureMemberFromAccess ( const QualifiedName name,
uint64_t  offset 
) const

◆ CreateLogger()

Ref< Logger > BinaryView::CreateLogger ( const std::string &  name)

Create a logger with a session ID tied to this BinaryView.

Whenever this logger is used, if "Log Scope" is set to "Current Tab", it will only be shown for tabs Displaying this BinaryView

See also
Logger
LogRegistry
Parameters
nameName for the logger
Returns
The created Logger

◆ AddExpressionParserMagicValue()

void BinaryView::AddExpressionParserMagicValue ( const std::string &  name,
uint64_t  value 
)

Add a magic value to the expression parser.

If the magic value already exists, its value gets updated. The magic value can be used in the expression by a $ followed by its name, e.g., $foobar. It is optional to include the $ when calling this function, i.e., calling with foobar and $foobar has the same effect.

Parameters
nameName for the magic value to add or update
valueValue for the magic value

◆ RemoveExpressionParserMagicValue()

void BinaryView::RemoveExpressionParserMagicValue ( const std::string &  name)

Remove a magic value from the expression parser.

If the magic value gets referenced after removal, an error will occur during the parsing.

Parameters
nameName for the magic value to remove
valueValue for the magic value

◆ AddExpressionParserMagicValues()

void BinaryView::AddExpressionParserMagicValues ( const std::vector< std::string > &  names,
const std::vector< uint64_t > &  values 
)

Add a list of magic value to the expression parser.

The vector names and values must have the same size. The ith name in the names will correspond to the ith value in the values.

If a magic value already exists, its value gets updated. The magic value can be used in the expression by a $ followed by its name, e.g., $foobar. It is optional to include the $ when calling this function, i.e., calling with foobar and $foobar has the same effect.

Parameters
nameNames for the magic values to add or update
valueValues for the magic value

◆ RemoveExpressionParserMagicValues()

void BinaryView::RemoveExpressionParserMagicValues ( const std::vector< std::string > &  names)

Remove a list of magic value from the expression parser.

If any of the magic values gets referenced after removal, an error will occur during the parsing.

Parameters
nameNames for the magic value to remove

◆ GetExpressionParserMagicValue()

bool BinaryView::GetExpressionParserMagicValue ( const std::string &  name,
uint64_t *  value 
)

Get the value of an expression parser magic value.

If the queried magic value exists, the function returns true and the magic value is returned in value. If the queried magic value does not exist, the function returns false.

Parameters
[in]nameName for the magic value to query
[out]valueValue for the magic value
Returns
Whether the magic value exists

Member Data Documentation

◆ m_file

Ref<FileMetadata> BinaryNinja::BinaryView::m_file
protected

The underlying file.

◆ BinaryNinja::Relocation

class BinaryNinja::Relocation

Public Member Functions

 Relocation (BNRelocation *reloc)
 
BNRelocationInfo GetInfo () const
 
ArchitectureGetArchitecture () const
 
uint64_t GetTarget () const
 
uint64_t GetAddress () const
 
Ref< SymbolGetSymbol () const
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNRelocation, BNNewRelocationReference, BNFreeRelocation >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNRelocation * GetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNRelocation, BNNewRelocationReference, BNFreeRelocation >
static BNRelocation * GetObject (CoreRefCountObject *obj)
 
static BNRelocation * GetObject (const CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNRelocation, BNNewRelocationReference, BNFreeRelocation >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNRelocation * m_object
 

Constructor & Destructor Documentation

◆ Relocation()

Relocation::Relocation ( BNRelocation *  reloc)

Member Function Documentation

◆ GetInfo()

BNRelocationInfo Relocation::GetInfo ( ) const

◆ GetArchitecture()

Architecture * Relocation::GetArchitecture ( ) const

◆ GetTarget()

uint64_t Relocation::GetTarget ( ) const

◆ GetAddress()

uint64_t Relocation::GetAddress ( ) const

◆ GetSymbol()

Ref< Symbol > Relocation::GetSymbol ( ) const

◆ BinaryNinja::BinaryData

class BinaryNinja::BinaryData

Public Member Functions

 BinaryData (FileMetadata *file)
 
 BinaryData (FileMetadata *file, const DataBuffer &data)
 
 BinaryData (FileMetadata *file, const void *data, size_t len)
 
 BinaryData (FileMetadata *file, const std::string &path)
 
 BinaryData (FileMetadata *file, FileAccessor *accessor)
 
- Public Member Functions inherited from BinaryNinja::BinaryView
 BinaryView (BNBinaryView *view)
 
virtual bool Init ()
 
FileMetadataGetFile () const
 
Ref< BinaryViewGetParentView () const
 
std::string GetTypeName () const
 
bool IsModified () const
 
bool IsAnalysisChanged () const
 
bool CreateDatabase (const std::string &path, Ref< SaveSettings > settings=new SaveSettings())
 Writes the current database (.bndb) out to the specified file. More...
 
bool CreateDatabase (const std::string &path, const std::function< bool(size_t progress, size_t total)> &progressCallback, Ref< SaveSettings > settings=new SaveSettings())
 Writes the current database (.bndb) out to the specified file. More...
 
bool SaveAutoSnapshot (Ref< SaveSettings > settings=new SaveSettings())
 
bool SaveAutoSnapshot (const std::function< bool(size_t progress, size_t total)> &progressCallback, Ref< SaveSettings > settings=new SaveSettings())
 
void BeginUndoActions ()
 Start recording actions taken so they can be undone at some point. More...
 
void AddUndoAction (UndoAction *action)
 
void CommitUndoActions ()
 Commit the actions taken since the last commit to the undo database. More...
 
bool CanUndo ()
 
bool Undo ()
 Undo the last committed action in the undo database. More...
 
bool CanRedo ()
 
bool Redo ()
 Redo the last committed action in the undo database. More...
 
std::string GetCurrentView ()
 Get the current View name, e.g. More...
 
uint64_t GetCurrentOffset ()
 Get the current offset in the current view. More...
 
bool Navigate (const std::string &view, uint64_t offset)
 Navigate to the specified virtual address in the specified view. More...
 
size_t Read (void *dest, uint64_t offset, size_t len)
 Read writes len bytes at virtual address offset to address dest More...
 
DataBuffer ReadBuffer (uint64_t offset, size_t len)
 ReadBuffer reads len bytes from a virtual address into a DataBuffer. More...
 
size_t Write (uint64_t offset, const void *data, size_t len)
 Write writes len bytes data at address dest to virtual address offset More...
 
size_t WriteBuffer (uint64_t offset, const DataBuffer &data)
 WriteBuffer writes the contents of a DataBuffer into a virtual address. More...
 
size_t Insert (uint64_t offset, const void *data, size_t len)
 Insert inserts len bytes data at address dest starting from virtual address offset More...
 
size_t InsertBuffer (uint64_t offset, const DataBuffer &data)
 InsertBuffer inserts the contents of a DataBuffer starting from a virtual address. More...
 
size_t Remove (uint64_t offset, uint64_t len)
 PerformRemove removes len bytes from virtual address offset More...
 
std::vector< float > GetEntropy (uint64_t offset, size_t len, size_t blockSize)
 
BNModificationStatus GetModification (uint64_t offset)
 GetModification checks whether the virtual address offset is modified. More...
 
std::vector< BNModificationStatusGetModification (uint64_t offset, size_t len)
 
bool IsValidOffset (uint64_t offset) const
 IsValidOffset checks whether a virtual address offset is valid. More...
 
bool IsOffsetReadable (uint64_t offset) const
 IsOffsetReadable checks whether a virtual address is readable. More...
 
bool IsOffsetWritable (uint64_t offset) const
 IsOffsetWritable checks whether a virtual address is writable. More...
 
bool IsOffsetExecutable (uint64_t offset) const
 IsOffsetExecutable checks whether a virtual address is executable. More...
 
bool IsOffsetBackedByFile (uint64_t offset) const
 IsOffsetBackedByFile checks whether a virtual address is backed by a file. More...
 
bool IsOffsetCodeSemantics (uint64_t offset) const
 
bool IsOffsetWritableSemantics (uint64_t offset) const
 
bool IsOffsetExternSemantics (uint64_t offset) const
 
uint64_t GetNextValidOffset (uint64_t offset) const
 GetNextValidOffset implements a query for the next valid readable, writable, or executable virtual memory address after offset More...
 
uint64_t GetStart () const
 GetStart queries for the first valid virtual address in the BinaryView. More...
 
uint64_t GetEnd () const
 GetEnd queries for the first valid virtual address in the BinaryView. More...
 
uint64_t GetLength () const
 GetLength queries for the total length of the BinaryView from start to end. More...
 
uint64_t GetEntryPoint () const
 GetEntryPoint returns the entry point of the executable in the BinaryView. More...
 
Ref< ArchitectureGetDefaultArchitecture () const
 GetDefaultArchitecture returns the current "default architecture" for the BinaryView. More...
 
void SetDefaultArchitecture (Architecture *arch)
 SetDefaultArchitecture allows setting the default architecture for the BinaryView. More...
 
Ref< PlatformGetDefaultPlatform () const
 GetDefaultPlatform returns the current default platform for the BinaryView. More...
 
void SetDefaultPlatform (Platform *platform)
 SetDefaultPlatform allows setting the default platform for the BinaryView. More...
 
BNEndianness GetDefaultEndianness () const
 GetDefaultEndianness returns the default endianness for the BinaryView. More...
 
bool IsRelocatable () const
 Whether the binary is relocatable. More...
 
size_t GetAddressSize () const
 Address size of the binary. More...
 
bool IsExecutable () const
 Whether the binary is an executable. More...
 
bool Save (FileAccessor *file)
 Save the original binary file to a FileAccessor. More...
 
bool Save (const std::string &path)
 Save the original binary file to the provided destination. More...
 
void DefineRelocation (Architecture *arch, BNRelocationInfo &info, uint64_t target, uint64_t reloc)
 
void DefineRelocation (Architecture *arch, BNRelocationInfo &info, Ref< Symbol > target, uint64_t reloc)
 
std::vector< std::pair< uint64_t, uint64_t > > GetRelocationRanges () const
 
std::vector< std::pair< uint64_t, uint64_t > > GetRelocationRangesAtAddress (uint64_t addr) const
 
bool RangeContainsRelocation (uint64_t addr, size_t size) const
 
void RegisterNotification (BinaryDataNotification *notify)
 Provides a mechanism for receiving callbacks for various analysis events. More...
 
void UnregisterNotification (BinaryDataNotification *notify)
 Unregister a notification passed to RegisterNotification. More...
 
void AddAnalysisOption (const std::string &name)
 Adds an analysis option. More...
 
Ref< FunctionAddFunctionForAnalysis (Platform *platform, uint64_t addr, bool autoDiscovered=false, Type *type=nullptr)