Binary Ninja API C++: BinaryView
Loading...
Searching...
No Matches
Classes related to interacting with and implementing custom BinaryViews. More...
Classes related to interacting with and implementing custom BinaryViews.
Classes | |
| class | BinaryNinja::Metadata |
| 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::TypeArchive |
| Type Archives are a collection of types which can be shared between different analysis sessions and are backed by a database file on disk. More... | |
| class | BinaryNinja::SymbolQueue |
◆ BinaryNinja::Metadata
class BinaryNinja::Metadata
Public Member Functions | |
| Metadata (BNMetadata *structuredData) | |
| Metadata (bool data) | |
| Create a new Metadata object representing a bool. | |
| Metadata (const std::string &data) | |
| Create a new Metadata object representing a string. | |
| Metadata (uint64_t data) | |
| Create a new Metadata object representing a uint64. | |
| Metadata (int64_t data) | |
| Create a new Metadata object representing an int64. | |
| Metadata (double data) | |
| Create a new Metadata object representing a double. | |
| Metadata (const std::vector< bool > &data) | |
| Create a new Metadata object representing a vector of bools. | |
| Metadata (const std::vector< std::string > &data) | |
| Create a new Metadata object representing a vector of strings. | |
| Metadata (const std::vector< uint64_t > &data) | |
| Create a new Metadata object representing a vector of uint64s. | |
| Metadata (const std::vector< int64_t > &data) | |
| Create a new Metadata object representing a vector of int64s. | |
| Metadata (const std::vector< double > &data) | |
| Create a new Metadata object representing a vector of doubles. | |
| Metadata (const std::vector< uint8_t > &data) | |
| Create a new Metadata object representing a vector of bytes to store. | |
| Metadata (const std::vector< Ref< Metadata > > &data) | |
| Create a new Metadata object representing a vector of children Metadata objects. | |
| Metadata (const std::map< std::string, Ref< Metadata > > &data) | |
| Create a new Metadata object representing a map of strings to metadata objects. | |
| Metadata (MetadataType type) | |
| virtual | ~Metadata () |
| bool | operator== (const Metadata &rhs) |
| Ref< Metadata > | operator[] (const std::string &key) |
| Ref< Metadata > | operator[] (size_t idx) |
| MetadataType | GetType () const |
| bool | GetBoolean () const |
| std::string | GetString () const |
| uint64_t | GetUnsignedInteger () const |
| int64_t | GetSignedInteger () const |
| double | GetDouble () const |
| std::vector< bool > | GetBooleanList () const |
| std::vector< std::string > | GetStringList () const |
| std::vector< uint64_t > | GetUnsignedIntegerList () const |
| std::vector< int64_t > | GetSignedIntegerList () const |
| std::vector< double > | GetDoubleList () const |
| std::vector< uint8_t > | GetRaw () const |
| std::vector< Ref< Metadata > > | GetArray () const |
| std::map< std::string, Ref< Metadata > > | GetKeyValueStore () const |
| std::string | GetJsonString () const |
| Ref< Metadata > | Get (const std::string &key) |
| Get a Metadata object by key. | |
| bool | SetValueForKey (const std::string &key, Ref< Metadata > data) |
| Set the value mapped to by a particular string. | |
| void | RemoveKey (const std::string &key) |
| Remove a key from the map. | |
| Ref< Metadata > | Get (size_t index) |
| Get an item at a given index. | |
| bool | Append (Ref< Metadata > data) |
| Append an item to the array. | |
| void | RemoveIndex (size_t index) |
| Remove an item at a given index. | |
| size_t | Size () const |
| Get the size of the array. | |
| bool | IsBoolean () const |
| bool | IsString () const |
| bool | IsUnsignedInteger () const |
| bool | IsSignedInteger () const |
| bool | IsDouble () const |
| bool | IsBooleanList () const |
| bool | IsStringList () const |
| bool | IsUnsignedIntegerList () const |
| bool | IsSignedIntegerList () const |
| bool | IsDoubleList () const |
| bool | IsRaw () const |
| bool | IsArray () const |
| bool | IsKeyValueStore () const |
| Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNMetadata, BNNewMetadataReference, BNFreeMetadata > | |
| CoreRefCountObject () | |
| virtual | ~CoreRefCountObject () |
| BNMetadata * | GetObject () const |
| void | AddRef () |
| void | Release () |
| void | AddRefForRegistration () |
| void | ReleaseForRegistration () |
| void | AddRefForCallback () |
| void | ReleaseForCallback () |
◆ Metadata() [1/15]
|
explicit |
◆ Metadata() [2/15]
|
explicit |
◆ Metadata() [3/15]
|
explicit |
◆ Metadata() [4/15]
|
explicit |
◆ Metadata() [5/15]
|
explicit |
◆ Metadata() [6/15]
|
explicit |
◆ Metadata() [7/15]
|
explicit |
Create a new Metadata object representing a vector of bools.
Thread Safe: - Yes
- Parameters
-
data - list of bools to store
◆ Metadata() [8/15]
|
explicit |
Create a new Metadata object representing a vector of strings.
Thread Safe: - Yes
- Parameters
-
data - list of strings to store
◆ Metadata() [9/15]
|
explicit |
Create a new Metadata object representing a vector of uint64s.
Thread Safe: - Yes
- Parameters
-
data - list of uint64s to store
◆ Metadata() [10/15]
|
explicit |
Create a new Metadata object representing a vector of int64s.
Thread Safe: - Yes
- Parameters
-
data - list of int64s to store
◆ Metadata() [11/15]
|
explicit |
Create a new Metadata object representing a vector of doubles.
Thread Safe: - Yes
- Parameters
-
data - list of doubles to store
◆ Metadata() [12/15]
|
explicit |
Create a new Metadata object representing a vector of bytes to store.
Thread Safe: - Yes
- Parameters
-
data - list of bytes to store
◆ Metadata() [13/15]
|
explicit |
◆ Metadata() [14/15]
|
explicit |
Create a new Metadata object representing a map of strings to metadata objects.
Thread Safe: - Yes
- Parameters
-
data - map of strings to metadata objects
◆ Metadata() [15/15]
◆ ~Metadata()
|
inlinevirtual |
◆ operator==()
| bool Metadata::operator== | ( | const Metadata & | rhs | ) |
◆ operator[]() [1/2]
◆ operator[]() [2/2]
◆ GetType()
◆ GetBoolean()
| bool Metadata::GetBoolean | ( | ) | const |
◆ GetString()
| std::string Metadata::GetString | ( | ) | const |
◆ GetUnsignedInteger()
| uint64_t Metadata::GetUnsignedInteger | ( | ) | const |
◆ GetSignedInteger()
| int64_t Metadata::GetSignedInteger | ( | ) | const |
◆ GetDouble()
| double Metadata::GetDouble | ( | ) | const |
◆ GetBooleanList()
| std::vector< bool > Metadata::GetBooleanList | ( | ) | const |
◆ GetStringList()
| std::vector< std::string > Metadata::GetStringList | ( | ) | const |
◆ GetUnsignedIntegerList()
| std::vector< uint64_t > Metadata::GetUnsignedIntegerList | ( | ) | const |
◆ GetSignedIntegerList()
| std::vector< int64_t > Metadata::GetSignedIntegerList | ( | ) | const |
◆ GetDoubleList()
| std::vector< double > Metadata::GetDoubleList | ( | ) | const |
◆ GetRaw()
| vector< uint8_t > Metadata::GetRaw | ( | ) | const |
◆ GetArray()
◆ GetKeyValueStore()
◆ GetJsonString()
| std::string Metadata::GetJsonString | ( | ) | const |
◆ Get() [1/2]
Get a Metadata object by key.
Only for if IsKeyValueStore == true
Thread Safe: - No
- Parameters
- Returns
◆ SetValueForKey()
Set the value mapped to by a particular string.
Only for if IsKeyValueStore == true
Thread Safe: - No
- Parameters
- Returns
◆ RemoveKey()
| void Metadata::RemoveKey | ( | const std::string & | key | ) |
Remove a key from the map.
Only for if IsKeyValueStore == true
Thread Safe: - No
- Parameters
◆ Get() [2/2]
Get an item at a given index.
For array data only
Thread Safe: - No
- Parameters
-
index Index of the item to retrieve
- Returns
- Item at that index, if valid.
◆ Append()
Append an item to the array.
For array data only
Thread Safe: - No
- Parameters
- Returns
- Whether the append was successful
◆ RemoveIndex()
| void Metadata::RemoveIndex | ( | size_t | index | ) |
Remove an item at a given index.
For array data only
Thread Safe: - No
- Parameters
-
index Index of the item to remove
◆ Size()
| size_t Metadata::Size | ( | ) | const |
Get the size of the array.
For array data only
Thread Safe: - No
- Returns
- Size of the array
◆ IsBoolean()
| bool Metadata::IsBoolean | ( | ) | const |
◆ IsString()
| bool Metadata::IsString | ( | ) | const |
◆ IsUnsignedInteger()
| bool Metadata::IsUnsignedInteger | ( | ) | const |
◆ IsSignedInteger()
| bool Metadata::IsSignedInteger | ( | ) | const |
◆ IsDouble()
| bool Metadata::IsDouble | ( | ) | const |
◆ IsBooleanList()
| bool Metadata::IsBooleanList | ( | ) | const |
◆ IsStringList()
| bool Metadata::IsStringList | ( | ) | const |
◆ IsUnsignedIntegerList()
| bool Metadata::IsUnsignedIntegerList | ( | ) | const |
◆ IsSignedIntegerList()
| bool Metadata::IsSignedIntegerList | ( | ) | const |
◆ IsDoubleList()
| bool Metadata::IsDoubleList | ( | ) | const |
◆ IsRaw()
| bool Metadata::IsRaw | ( | ) | const |
◆ IsArray()
| bool Metadata::IsArray | ( | ) | const |
◆ IsKeyValueStore()
| bool Metadata::IsKeyValueStore | ( | ) | const |
◆ BinaryNinja::BinaryDataNotification
class BinaryNinja::BinaryDataNotification
Public Types | |
| enum | NotificationType : uint64_t { NotificationBarrier = 1ULL << 0 , DataWritten = 1ULL << 1 , DataInserted = 1ULL << 2 , DataRemoved = 1ULL << 3 , FunctionAdded = 1ULL << 4 , FunctionRemoved = 1ULL << 5 , FunctionUpdated = 1ULL << 6 , FunctionUpdateRequested = 1ULL << 7 , DataVariableAdded = 1ULL << 8 , DataVariableRemoved = 1ULL << 9 , DataVariableUpdated = 1ULL << 10 , DataMetadataUpdated = 1ULL << 11 , TagTypeUpdated = 1ULL << 12 , TagAdded = 1ULL << 13 , TagRemoved = 1ULL << 14 , TagUpdated = 1ULL << 15 , SymbolAdded = 1ULL << 16 , SymbolRemoved = 1ULL << 17 , SymbolUpdated = 1ULL << 18 , StringFound = 1ULL << 19 , StringRemoved = 1ULL << 20 , TypeDefined = 1ULL << 21 , TypeUndefined = 1ULL << 22 , TypeReferenceChanged = 1ULL << 23 , TypeFieldReferenceChanged = 1ULL << 24 , SegmentAdded = 1ULL << 25 , SegmentRemoved = 1ULL << 26 , SegmentUpdated = 1ULL << 27 , SectionAdded = 1ULL << 28 , SectionRemoved = 1ULL << 29 , SectionUpdated = 1ULL << 30 , ComponentNameUpdated = 1ULL << 31 , ComponentAdded = 1ULL << 32 , ComponentRemoved = 1ULL << 33 , ComponentMoved = 1ULL << 34 , ComponentFunctionAdded = 1ULL << 35 , ComponentFunctionRemoved = 1ULL << 36 , ComponentDataVariableAdded = 1ULL << 37 , ComponentDataVariableRemoved = 1ULL << 38 , ExternalLibraryAdded = 1ULL << 39 , ExternalLibraryRemoved = 1ULL << 40 , ExternalLibraryUpdated = 1ULL << 41 , ExternalLocationAdded = 1ULL << 42 , ExternalLocationRemoved = 1ULL << 43 , ExternalLocationUpdated = 1ULL << 44 , TypeArchiveAttached = 1ULL << 45 , TypeArchiveDetached = 1ULL << 46 , TypeArchiveConnected = 1ULL << 47 , TypeArchiveDisconnected = 1ULL << 48 , UndoEntryAdded = 1ULL << 49 , UndoEntryTaken = 1ULL << 50 , RedoEntryTaken = 1ULL << 51 , Rebased = 1ULL << 52 , DerivedStringFound = 1ULL << 53 , DerivedStringRemoved = 1ULL << 54 , BinaryDataUpdates = DataWritten | DataInserted | DataRemoved , FunctionLifetime = FunctionAdded | FunctionRemoved , FunctionUpdates = FunctionLifetime | FunctionUpdated , DataVariableLifetime = DataVariableAdded | DataVariableRemoved , DataVariableUpdates = DataVariableLifetime | DataVariableUpdated , TagLifetime = TagAdded | TagRemoved , TagUpdates = TagLifetime | TagUpdated , SymbolLifetime = SymbolAdded | SymbolRemoved , SymbolUpdates = SymbolLifetime | SymbolUpdated , StringUpdates = StringFound | StringRemoved | DerivedStringFound | DerivedStringRemoved , TypeLifetime = TypeDefined | TypeUndefined , TypeUpdates = TypeLifetime | TypeReferenceChanged | TypeFieldReferenceChanged , SegmentLifetime = SegmentAdded | SegmentRemoved , SegmentUpdates = SegmentLifetime | SegmentUpdated , SectionLifetime = SectionAdded | SectionRemoved , SectionUpdates = SectionLifetime | SectionUpdated , ComponentUpdates = ComponentNameUpdated | ComponentAdded | ComponentRemoved | ComponentMoved | ComponentFunctionAdded | ComponentFunctionRemoved | ComponentDataVariableAdded | ComponentDataVariableRemoved , ExternalLibraryLifetime = ExternalLibraryAdded | ExternalLibraryRemoved , ExternalLibraryUpdates = ExternalLibraryLifetime | ExternalLibraryUpdated , ExternalLocationLifetime = ExternalLocationAdded | ExternalLocationRemoved , ExternalLocationUpdates = ExternalLocationLifetime | ExternalLocationUpdated , TypeArchiveUpdates = TypeArchiveAttached | TypeArchiveDetached | TypeArchiveConnected | TypeArchiveDisconnected , UndoUpdates = UndoEntryAdded | UndoEntryTaken | RedoEntryTaken } |
| using | NotificationTypes = uint64_t |
Public Member Functions | |
| BinaryDataNotification () | |
| BinaryDataNotification (NotificationTypes notifications) | |
| virtual | ~BinaryDataNotification () |
| BNBinaryDataNotification * | GetCallbacks () |
| virtual uint64_t | OnNotificationBarrier (BinaryView *view) |
| 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 | OnTagRemoved (BinaryView *view, const TagReference &tagRef) |
| virtual void | OnTagUpdated (BinaryView *view, const TagReference &tagRef) |
| virtual void | OnSymbolAdded (BinaryView *view, Symbol *sym) |
| virtual void | OnSymbolRemoved (BinaryView *view, Symbol *sym) |
| virtual void | OnSymbolUpdated (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 | OnDerivedStringFound (BinaryView *data, const DerivedString &str) |
| virtual void | OnDerivedStringRemoved (BinaryView *data, const DerivedString &str) |
| 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 | OnSegmentRemoved (BinaryView *data, Segment *segment) |
| virtual void | OnSegmentUpdated (BinaryView *data, Segment *segment) |
| virtual void | OnSectionAdded (BinaryView *data, Section *section) |
| virtual void | OnSectionRemoved (BinaryView *data, Section *section) |
| virtual void | OnSectionUpdated (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. | |
| virtual void | OnComponentAdded (BinaryView *data, Component *component) |
| This notification is posted after a Component is added to the tree. | |
| virtual void | OnComponentRemoved (BinaryView *data, Component *formerParent, Component *component) |
| This notification is posted after a Component is removed from the tree. | |
| 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. | |
| virtual void | OnComponentFunctionAdded (BinaryView *data, Component *component, Function *function) |
| This notification is posted whenever a Function is added to a Component. | |
| virtual void | OnComponentFunctionRemoved (BinaryView *data, Component *component, Function *function) |
| This notification is posted whenever a Function is removed from a Component. | |
| virtual void | OnComponentDataVariableAdded (BinaryView *data, Component *component, const DataVariable &var) |
| This notification is posted whenever a DataVariable is added to a Component. | |
| virtual void | OnComponentDataVariableRemoved (BinaryView *data, Component *component, const DataVariable &var) |
| This notification is posted whenever a DataVariable is removed from a Component. | |
| virtual void | OnExternalLibraryAdded (BinaryView *data, ExternalLibrary *library) |
| virtual void | OnExternalLibraryRemoved (BinaryView *data, ExternalLibrary *library) |
| virtual void | OnExternalLibraryUpdated (BinaryView *data, ExternalLibrary *library) |
| virtual void | OnExternalLocationAdded (BinaryView *data, ExternalLocation *location) |
| virtual void | OnExternalLocationRemoved (BinaryView *data, ExternalLocation *location) |
| virtual void | OnExternalLocationUpdated (BinaryView *data, ExternalLocation *location) |
| virtual void | OnTypeArchiveAttached (BinaryView *data, const std::string &id, const std::string &path) |
| This notification is posted whenever a Type Archive is attached to a Binary View. | |
| virtual void | OnTypeArchiveDetached (BinaryView *data, const std::string &id, const std::string &path) |
| This notification is posted whenever a Type Archive is detached to a Binary View. | |
| virtual void | OnTypeArchiveConnected (BinaryView *data, TypeArchive *archive) |
| This notification is posted whenever a previously disconnected Type Archive attached to the Binary View is connected. | |
| virtual void | OnTypeArchiveDisconnected (BinaryView *data, TypeArchive *archive) |
| This notification is posted whenever a previously connected Type Archive attached to the Binary View is disconnected. | |
| virtual void | OnUndoEntryAdded (BinaryView *data, UndoEntry *entry) |
| This notification is posted whenever an entry is added to undo history. | |
| virtual void | OnUndoEntryTaken (BinaryView *data, UndoEntry *entry) |
| This notification is posted whenever an action is undone. | |
| virtual void | OnRedoEntryTaken (BinaryView *data, UndoEntry *entry) |
| This notification is posted whenever an action is redone. | |
| virtual void | OnRebased (BinaryView *oldView, BinaryView *newView) |
| This notification is posted whenever a binary view is rebased. | |
◆ NotificationTypes
◆ NotificationType
◆ BinaryDataNotification() [1/2]
| BinaryDataNotification::BinaryDataNotification | ( | ) |
◆ BinaryDataNotification() [2/2]
| BinaryDataNotification::BinaryDataNotification | ( | NotificationTypes | notifications | ) |
◆ ~BinaryDataNotification()
|
inlinevirtual |
◆ GetCallbacks()
◆ OnNotificationBarrier()
|
inlinevirtual |
◆ OnBinaryDataWritten()
|
inlinevirtual |
◆ OnBinaryDataInserted()
|
inlinevirtual |
◆ OnBinaryDataRemoved()
|
inlinevirtual |
◆ OnAnalysisFunctionAdded()
|
inlinevirtual |
◆ OnAnalysisFunctionRemoved()
|
inlinevirtual |
◆ OnAnalysisFunctionUpdated()
|
inlinevirtual |
◆ OnAnalysisFunctionUpdateRequested()
|
inlinevirtual |
◆ OnDataVariableAdded()
|
inlinevirtual |
◆ OnDataVariableRemoved()
|
inlinevirtual |
◆ OnDataVariableUpdated()
|
inlinevirtual |
◆ OnDataMetadataUpdated()
|
inlinevirtual |
◆ OnTagTypeUpdated()
|
inlinevirtual |
◆ OnTagAdded()
|
inlinevirtual |
◆ OnTagRemoved()
|
inlinevirtual |
◆ OnTagUpdated()
|
inlinevirtual |
◆ OnSymbolAdded()
|
inlinevirtual |
◆ OnSymbolRemoved()
|
inlinevirtual |
◆ OnSymbolUpdated()
|
inlinevirtual |
◆ OnStringFound()
|
inlinevirtual |
◆ OnStringRemoved()
|
inlinevirtual |
◆ OnDerivedStringFound()
|
inlinevirtual |
◆ OnDerivedStringRemoved()
|
inlinevirtual |
◆ OnTypeDefined()
|
inlinevirtual |
◆ OnTypeUndefined()
|
inlinevirtual |
◆ OnTypeReferenceChanged()
|
inlinevirtual |
◆ OnTypeFieldReferenceChanged()
|
inlinevirtual |
◆ OnSegmentAdded()
|
inlinevirtual |
◆ OnSegmentRemoved()
|
inlinevirtual |
◆ OnSegmentUpdated()
|
inlinevirtual |
◆ OnSectionAdded()
|
inlinevirtual |
◆ OnSectionRemoved()
|
inlinevirtual |
◆ OnSectionUpdated()
|
inlinevirtual |
◆ OnComponentNameUpdated()
|
inlinevirtual |
This notification is posted after the display name for a component is updated.
- Parameters
-
data BinaryView the Component is contained in previousName Previous name of the component component The component which was modified.
Reimplemented in NotificationsWorker.
◆ OnComponentAdded()
|
inlinevirtual |
◆ OnComponentRemoved()
|
inlinevirtual |
This notification is posted after a Component is removed from the tree.
- Parameters
-
data BinaryView the Component was removed from formerParent Former 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.
Reimplemented in NotificationsWorker.
◆ OnComponentMoved()
|
inlinevirtual |
This notification is posted whenever a component is moved from one component to another.
- Parameters
-
data BinaryView the Component was removed from formerParent Former parent of the Component newParent New parent which the Component was moved to component The component that was moved.
Reimplemented in NotificationsWorker.
◆ OnComponentFunctionAdded()
|
inlinevirtual |
◆ OnComponentFunctionRemoved()
|
inlinevirtual |
◆ OnComponentDataVariableAdded()
|
inlinevirtual |
◆ OnComponentDataVariableRemoved()
|
inlinevirtual |
◆ OnExternalLibraryAdded()
|
inlinevirtual |
◆ OnExternalLibraryRemoved()
|
inlinevirtual |
◆ OnExternalLibraryUpdated()
|
inlinevirtual |
◆ OnExternalLocationAdded()
|
inlinevirtual |
◆ OnExternalLocationRemoved()
|
inlinevirtual |
◆ OnExternalLocationUpdated()
|
inlinevirtual |
◆ OnTypeArchiveAttached()
|
inlinevirtual |
This notification is posted whenever a Type Archive is attached to a Binary View.
- Parameters
-
data BinaryView target id Id of the attached archive path Path on disk of the attached archive
Reimplemented in NotificationsWorker, and TypeBrowserModel.
◆ OnTypeArchiveDetached()
|
inlinevirtual |
This notification is posted whenever a Type Archive is detached to a Binary View.
- Parameters
-
data BinaryView target id Id of the attached archive path Path on disk of the attached archive
Reimplemented in NotificationsWorker, and TypeBrowserModel.
◆ OnTypeArchiveConnected()
|
inlinevirtual |
This notification is posted whenever a previously disconnected Type Archive attached to the Binary View is connected.
- Parameters
-
data BinaryView the archive is attached to archive Attached archive
Reimplemented in NotificationsWorker, and TypeBrowserModel.
◆ OnTypeArchiveDisconnected()
|
inlinevirtual |
This notification is posted whenever a previously connected Type Archive attached to the Binary View is disconnected.
- Parameters
-
data BinaryView the archive is attached to archive Previously attached archive
Reimplemented in NotificationsWorker, and TypeBrowserModel.
◆ OnUndoEntryAdded()
|
inlinevirtual |
This notification is posted whenever an entry is added to undo history.
- Parameters
Reimplemented in NotificationsWorker.
◆ OnUndoEntryTaken()
|
inlinevirtual |
This notification is posted whenever an action is undone.
- Parameters
-
data BinaryView the action was taken on entry UndoEntry that was undone
Reimplemented in NotificationsWorker.
◆ OnRedoEntryTaken()
|
inlinevirtual |
This notification is posted whenever an action is redone.
- Parameters
-
data BinaryView the action was taken on entry UndoEntry that was redone
Reimplemented in NotificationsWorker.
◆ OnRebased()
|
inlinevirtual |
This notification is posted whenever a binary view is rebased.
- Parameters
-
oldView BinaryView the old view newView BinaryView the new view
◆ BinaryNinja::AnalysisCompletionEvent
class BinaryNinja::AnalysisCompletionEvent
◆ BinaryNinja::ActiveAnalysisInfo
struct BinaryNinja::ActiveAnalysisInfo
Public Member Functions | |
| ActiveAnalysisInfo (Ref< Function > f, uint64_t t, size_t uc, size_t sc) | |
Public Attributes | |
| Ref< Function > | func |
| uint64_t | analysisTime |
| size_t | updateCount |
| size_t | submitCount |
◆ ActiveAnalysisInfo()
|
inline |
◆ func
◆ analysisTime
uint64_t BinaryNinja::ActiveAnalysisInfo::analysisTime
◆ updateCount
size_t BinaryNinja::ActiveAnalysisInfo::updateCount
◆ submitCount
size_t BinaryNinja::ActiveAnalysisInfo::submitCount
◆ BinaryNinja::AnalysisInfo
struct BinaryNinja::AnalysisInfo
◆ BinaryNinja::DataVariable
struct BinaryNinja::DataVariable
Public Member Functions | |
| DataVariable () | |
| DataVariable (uint64_t a, const Confidence< Ref< Type > > &t, bool d) | |
Public Attributes | |
| uint64_t | address |
| Confidence< Ref< Type > > | type |
| bool | autoDiscovered |
◆ DataVariable() [1/2]
|
inline |
◆ DataVariable() [2/2]
|
inline |
◆ address
uint64_t BinaryNinja::DataVariable::address
◆ 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 |
◆ DataVariableAndName() [1/2]
|
inline |
◆ DataVariableAndName() [2/2]
|
inline |
◆ address
uint64_t BinaryNinja::DataVariableAndName::address
◆ 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) | |
| BinaryView * | GetView () const |
| std::string | GetId () const |
| std::string | GetName () const |
| void | SetName (const std::string &name) |
| Set the name of the TagType. | |
| std::string | GetIcon () const |
| void | SetIcon (const std::string &icon) |
| Set the icon to be used for a TagType. | |
| bool | GetVisible () const |
| void | SetVisible (bool visible) |
| Set whether the tags of this type are visible. | |
| Type | GetType () const |
| One of: UserTagType, NotificationTagType, BookmarksTagType. | |
| 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 () |
◆ Type
◆ TagType() [1/3]
◆ 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 ) |
◆ 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
◆ 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 | ) |
◆ 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
-
visible Whether the tags of this type are visible
◆ GetType()
◆ SetType()
◆ BinaryNinja::TagReference
struct BinaryNinja::TagReference
Public Types | |
| typedef BNTagReferenceType | RefType |
Public Member Functions | |
| TagReference () | |
| TagReference (const BNTagReference &ref) | |
| bool | EqualsByData (const TagReference &other) const |
| bool | operator== (const TagReference &other) const |
| bool | operator!= (const TagReference &other) const |
| operator BNTagReference () const | |
Static Public Member Functions | |
| static BNTagReference * | CreateTagReferenceList (const std::vector< TagReference > &tags, size_t *count) |
| static std::vector< TagReference > | ConvertTagReferenceList (BNTagReference *tags, size_t count) |
| static void | FreeTagReferenceList (BNTagReference *tags, size_t count) |
| static std::vector< TagReference > | ConvertAndFreeTagReferenceList (BNTagReference *tags, size_t count) |
Public Attributes | |
| RefType | refType |
| bool | autoDefined |
| Ref< Tag > | tag |
| Ref< Architecture > | arch |
| Ref< Function > | func |
| uint64_t | addr |
◆ RefType
◆ TagReference() [1/2]
| TagReference::TagReference | ( | ) |
◆ TagReference() [2/2]
◆ EqualsByData()
| bool TagReference::EqualsByData | ( | const TagReference & | other | ) | const |
◆ operator==()
| bool TagReference::operator== | ( | const TagReference & | other | ) | const |
◆ operator!=()
| bool TagReference::operator!= | ( | const TagReference & | other | ) | const |
◆ operator BNTagReference()
◆ CreateTagReferenceList()
|
static |
◆ ConvertTagReferenceList()
|
static |
◆ FreeTagReferenceList()
|
static |
◆ ConvertAndFreeTagReferenceList()
|
static |
◆ refType
RefType BinaryNinja::TagReference::refType
◆ autoDefined
bool BinaryNinja::TagReference::autoDefined
◆ tag
◆ arch
◆ func
◆ addr
uint64_t BinaryNinja::TagReference::addr
◆ BinaryNinja::Segment
class BinaryNinja::Segment
◆ 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 | GetEnd () 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 () |
◆ Section() [1/2]
◆ 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 ) |
◆ GetName()
| std::string Section::GetName | ( | ) | const |
◆ GetType()
| std::string Section::GetType | ( | ) | const |
◆ GetStart()
| uint64_t Section::GetStart | ( | ) | const |
◆ GetLength()
| uint64_t Section::GetLength | ( | ) | const |
◆ GetEnd()
| uint64_t Section::GetEnd | ( | ) | 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()
◆ 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:
vector<Ref<BinaryViewType>> types = BinaryViewType::GetViewTypes()
vector<Ref<BinaryViewType>> types = BinaryViewType::GetViewTypesForData(bv);
Ref<BinaryViewType> machoType = BinaryViewType::GetByName("Mach-O");
- 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 = Load("/bin/ls");
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.RemoveUserFunctionrather thanRemoveFunction). Thus use\*User\*() methods if saving to the database is desired.
Public Member Functions | |
| void | NotifyDataWritten (uint64_t offset, size_t len) |
| void | NotifyDataInserted (uint64_t offset, size_t len) |
| void | NotifyDataRemoved (uint64_t offset, uint64_t len) |
| BinaryView (BNBinaryView *view) | |
| virtual bool | Init () |
| FileMetadata * | GetFile () const |
| Ref< BinaryView > | GetParentView () 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. | |
| bool | CreateDatabase (const std::string &path, const ProgressFunction &progressCallback, Ref< SaveSettings > settings=new SaveSettings()) |
| Writes the current database (.bndb) out to the specified file. | |
| bool | SaveAutoSnapshot (Ref< SaveSettings > settings=new SaveSettings()) |
| bool | SaveAutoSnapshot (const ProgressFunction &progressCallback, Ref< SaveSettings > settings=new SaveSettings()) |
| bool | RunUndoableTransaction (std::function< bool()> func) |
| Run a function in a context in which any changes made to analysis will be added to an undo state. | |
| std::string | BeginUndoActions (bool anonymousAllowed=true) |
| Start recording actions taken so they can be undone at some point. | |
| void | CommitUndoActions (const std::string &id) |
| Commit the actions taken since a call to BeginUndoActions. | |
| void | RevertUndoActions (const std::string &id) |
| Revert the actions taken since a call to BeginUndoActions. | |
| void | ForgetUndoActions (const std::string &id) |
| Forget the actions taken since a call to BeginUndoActions. | |
| bool | CanUndo () |
| bool | Undo () |
| Undo the last committed action in the undo database. | |
| bool | CanRedo () |
| bool | Redo () |
| Redo the last committed action in the undo database. | |
| std::string | GetCurrentView () |
| Get the current View name, e.g. | |
| uint64_t | GetCurrentOffset () |
| Get the current offset in the current view. | |
| bool | Navigate (const std::string &view, uint64_t offset) |
| Navigate to the specified virtual address in the specified view. | |
| size_t | Read (void *dest, uint64_t offset, size_t len) |
| Read writes `len` bytes at virtual address `offset` to address `dest`. | |
| DataBuffer | ReadBuffer (uint64_t offset, size_t len) |
| ReadBuffer reads len bytes from a virtual address into a DataBuffer. | |
| const uint8_t * | GetDataPointer () const |
| GetDataPointer returns a pointer to the underlying data for zero-copy access. | |
| size_t | GetDataLength () const |
| GetDataLength returns the length of the underlying data. | |
| size_t | Write (uint64_t offset, const void *data, size_t len) |
| Write writes `len` bytes data at address `dest` to virtual address `offset`. | |
| size_t | WriteBuffer (uint64_t offset, const DataBuffer &data) |
| WriteBuffer writes the contents of a DataBuffer into a virtual address. | |
| 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`. | |
| size_t | InsertBuffer (uint64_t offset, const DataBuffer &data) |
| InsertBuffer inserts the contents of a DataBuffer starting from a virtual address. | |
| size_t | Remove (uint64_t offset, uint64_t len) |
| PerformRemove removes `len` bytes from virtual address `offset`. | |
| 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. | |
| std::vector< BNModificationStatus > | GetModification (uint64_t offset, size_t len) |
| bool | IsValidOffset (uint64_t offset) const |
| IsValidOffset checks whether a virtual address `offset` is valid. | |
| bool | IsOffsetReadable (uint64_t offset) const |
| IsOffsetReadable checks whether a virtual address is readable. | |
| bool | IsOffsetWritable (uint64_t offset) const |
| IsOffsetWritable checks whether a virtual address is writable. | |
| bool | IsOffsetExecutable (uint64_t offset) const |
| IsOffsetExecutable checks whether a virtual address is executable. | |
| bool | IsOffsetBackedByFile (uint64_t offset) const |
| IsOffsetBackedByFile checks whether a virtual address is backed by a file. | |
| 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`. | |
| uint64_t | GetImageBase () const |
| GetImageBase queries for the image base in the BinaryView. | |
| uint64_t | GetOriginalImageBase () const |
| GetOriginalImageBase queries for the original image base in the BinaryView, unaffected by any rebasing operations. | |
| void | SetOriginalImageBase (uint64_t imageBase) |
| SetOriginalBase sets the original image base in the BinaryView, unaffected by any rebasing operations. | |
| uint64_t | GetOriginalBase () const |
| GetOriginalBase queries for the original image base in the BinaryView, unaffected by any rebasing operations. | |
| void | SetOriginalBase (uint64_t base) |
| SetOriginalBase sets the original image base in the BinaryView, unaffected by any rebasing operations. | |
| uint64_t | GetStart () const |
| GetStart queries for the first valid virtual address in the BinaryView. | |
| uint64_t | GetEnd () const |
| GetEnd queries for the end virtual address of the BinaryView. | |
| uint64_t | GetLength () const |
| GetLength queries for the total length of the BinaryView from start to end. | |
| uint64_t | GetEntryPoint () const |
| GetEntryPoint returns the entry point of the executable in the BinaryView. | |
| Ref< Architecture > | GetDefaultArchitecture () const |
| GetDefaultArchitecture returns the current "default architecture" for the BinaryView. | |
| void | SetDefaultArchitecture (Architecture *arch) |
| SetDefaultArchitecture allows setting the default architecture for the BinaryView. | |
| Ref< Platform > | GetDefaultPlatform () const |
| GetDefaultPlatform returns the current default platform for the BinaryView. | |
| void | SetDefaultPlatform (Platform *platform) |
| SetDefaultPlatform allows setting the default platform for the BinaryView. | |
| BNEndianness | GetDefaultEndianness () const |
| GetDefaultEndianness returns the default endianness for the BinaryView. | |
| bool | IsRelocatable () const |
| Whether the binary is relocatable. | |
| size_t | GetAddressSize () const |
| Address size of the binary. | |
| bool | IsExecutable () const |
| Whether the binary is an executable. | |
| bool | Save (FileAccessor *file) |
| Save the original binary file to a FileAccessor. | |
| bool | Save (const std::string &path) |
| Save the original binary file to the provided destination. | |
| bool | FinalizeNewSegments () |
| Performs "finalization" on segments added after initial Finalization (performed after an Init() has completed). | |
| 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 |
| std::vector< std::pair< uint64_t, uint64_t > > | GetRelocationRangesInRange (uint64_t addr, size_t size) const |
| bool | RangeContainsRelocation (uint64_t addr, size_t size) const |
| std::vector< Ref< Relocation > > | GetRelocationsAt (uint64_t addr) const |
| void | RegisterNotification (BinaryDataNotification *notify) |
| Provides a mechanism for receiving callbacks for various analysis events. | |
| void | UnregisterNotification (BinaryDataNotification *notify) |
| Unregister a notification passed to RegisterNotification. | |
| void | AddAnalysisOption (const std::string &name) |
| Adds an analysis option. | |
| Ref< Function > | AddFunctionForAnalysis (Platform *platform, uint64_t addr, bool autoDiscovered=false, Type *type=nullptr) |
| Add a new function of the given platform at the virtual address. | |
| void | AddEntryPointForAnalysis (Platform *platform, uint64_t start) |
| adds an virtual address to start analysis from for a given platform | |
| void | AddToEntryFunctions (Function *func) |
| adds an function to all entry function list | |
| void | RemoveAnalysisFunction (Function *func, bool updateRefs=false) |
| removes a function from the list of functions | |
| Ref< Function > | CreateUserFunction (Platform *platform, uint64_t start) |
| Add a new user function of the given platform at the virtual address. | |
| void | RemoveUserFunction (Function *func) |
| removes a user function from the list of functions | |
| bool | HasInitialAnalysis () |
| check for the presence of an initial analysis in this BinaryView. | |
| void | SetAnalysisHold (bool enable) |
| Controls the analysis hold for this BinaryView. | |
| bool | GetFunctionAnalysisUpdateDisabled () |
| void | SetFunctionAnalysisUpdateDisabled (bool disabled) |
| void | UpdateAnalysisAndWait () |
| start the analysis running and dont return till it is complete | |
| void | UpdateAnalysis () |
| asynchronously starts the analysis running and returns immediately. | |
| void | AbortAnalysis () |
| Abort analysis and suspend the workflow machine. | |
| bool | AnalysisIsAborted () const |
| Check whether analysis is currently running. | |
| void | DefineDataVariable (uint64_t addr, const Confidence< Ref< Type > > &type) |
| Define a DataVariable at a given address with a set type. | |
| void | DefineUserDataVariable (uint64_t addr, const Confidence< Ref< Type > > &type) |
| Define a user DataVariable at a given address with a set type. | |
| void | UndefineDataVariable (uint64_t addr, bool blacklist=true) |
| Undefine a DataVariable at a given address. | |
| void | UndefineUserDataVariable (uint64_t addr) |
| Undefine a user DataVariable at a given address. | |
| std::map< uint64_t, DataVariable > | GetDataVariables () |
| Get a map of DataVariables defined in the current BinaryView. | |
| bool | GetDataVariableAtAddress (uint64_t addr, DataVariable &var) |
| Get a DataVariable at a given address. | |
| std::vector< Ref< Function > > | GetAnalysisFunctionList () |
| Get a list of functions within this BinaryView. | |
| bool | HasFunctions () const |
| Check whether the BinaryView has any functions defined. | |
| Ref< Function > | GetAnalysisFunction (Platform *platform, uint64_t addr) |
| Gets a function object for the function starting at a virtual address. | |
| Ref< Function > | GetRecentAnalysisFunctionForAddress (uint64_t addr) |
| Get the most recently used Function starting at a virtual address. | |
| std::vector< Ref< Function > > | GetAnalysisFunctionsForAddress (uint64_t addr) |
| Get a list of functions defined at an address. | |
| std::vector< Ref< Function > > | GetAnalysisFunctionsContainingAddress (uint64_t addr) |
| Get a list of functions containing an address. | |
| Ref< Function > | GetAnalysisEntryPoint () |
| Get the function defined as the Analysis entry point for the view. | |
| std::vector< Ref< Function > > | GetAllEntryFunctions () |
| Get all entry functions (including user-defined ones). | |
| Ref< BasicBlock > | GetRecentBasicBlockForAddress (uint64_t addr) |
| Get most recently used Basic Block containing a virtual address. | |
| std::vector< Ref< BasicBlock > > | GetBasicBlocksForAddress (uint64_t addr) |
| Get a list of Basic Blocks containing a virtual address. | |
| std::vector< Ref< BasicBlock > > | GetBasicBlocksStartingAtAddress (uint64_t addr) |
| Get a list of basic blocks starting at a virtual address. | |
| std::vector< ReferenceSource > | GetCodeReferences (uint64_t addr) |
| Get a list of references made from code (instructions) to a virtual address. | |
| std::vector< ReferenceSource > | GetCodeReferences (uint64_t addr, uint64_t len) |
| Get a list of references from code (instructions) to a range of addresses. | |
| std::vector< ReferenceSource > | GetCodeReferencesWithLimit (uint64_t addr, std::optional< size_t > maxItems=std::nullopt) |
| Get a list of references made from code (instructions) to a virtual address. | |
| std::vector< ReferenceSource > | GetCodeReferencesInRangeWithLimit (uint64_t addr, uint64_t len, std::optional< size_t > maxItems=std::nullopt) |
| Get a list of references from code (instructions) to a range of addresses. | |
| std::vector< uint64_t > | GetCodeReferencesFrom (ReferenceSource src) |
| Get code references made by a particular "ReferenceSource". | |
| std::vector< uint64_t > | GetCodeReferencesFrom (ReferenceSource src, uint64_t len) |
| Get code references from a range of addresses. | |
| std::vector< uint64_t > | GetDataReferences (uint64_t addr) |
| Get references made by data ('DataVariables') to a virtual address. | |
| 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. | |
| std::vector< uint64_t > | GetDataReferencesWithLimit (uint64_t addr, std::optional< size_t > maxItems=std::nullopt) |
| Get references made by data ('DataVariables') to a virtual address. | |
| std::vector< uint64_t > | GetDataReferencesInRangeWithLimit (uint64_t addr, uint64_t len, std::optional< size_t > maxItems=std::nullopt) |
| Get references made by data ('DataVariables') in a given range, to a virtual address. | |
| std::vector< uint64_t > | GetDataReferencesFrom (uint64_t addr) |
| Get references made by data ('DataVariables') located at a virtual address. | |
| std::vector< uint64_t > | GetDataReferencesFrom (uint64_t addr, uint64_t len) |
| Get references made by data ('DataVariables') located in a range of virtual addresses. | |
| void | AddDataReference (uint64_t fromAddr, uint64_t toAddr) |
| Add an auto Data Reference from a virtual address to another virtual address. | |
| void | RemoveDataReference (uint64_t fromAddr, uint64_t toAddr) |
| Remove an auto Data Reference from a virtual address to another virtual address. | |
| void | AddUserDataReference (uint64_t fromAddr, uint64_t toAddr) |
| Add a user Data Reference from a virtual address to another virtual address. | |
| void | RemoveUserDataReference (uint64_t fromAddr, uint64_t toAddr) |
| Remove a user Data Reference from a virtual address to another virtual address. | |
| std::vector< ReferenceSource > | GetCodeReferencesForType (const QualifiedName &type, std::optional< size_t > maxItems=std::nullopt) |
| Get code references to a Type. | |
| std::vector< uint64_t > | GetDataReferencesForType (const QualifiedName &type, std::optional< size_t > maxItems=std::nullopt) |
| Get data references to a Type. | |
| std::vector< TypeReferenceSource > | GetTypeReferencesForType (const QualifiedName &type, std::optional< size_t > maxItems=std::nullopt) |
| Get Type references to a Type. | |
| std::vector< TypeFieldReference > | GetCodeReferencesForTypeField (const QualifiedName &type, uint64_t offset, std::optional< size_t > maxItems=std::nullopt) |
| Returns a list of references to a specific type field. | |
| std::vector< uint64_t > | GetDataReferencesForTypeField (const QualifiedName &type, uint64_t offset, std::optional< size_t > maxItems=std::nullopt) |
Returns a list of virtual addresses of data which references the type type . | |
| std::vector< uint64_t > | GetDataReferencesFromForTypeField (const QualifiedName &type, uint64_t offset, std::optional< size_t > maxItems=std::nullopt) |
Returns a list of virtual addresses of data which are referenced from the type type . | |
| std::vector< TypeReferenceSource > | GetTypeReferencesForTypeField (const QualifiedName &type, uint64_t offset, std::optional< size_t > maxItems=std::nullopt) |
| Returns a list of type references to a specific type field. | |
| AllTypeReferences | GetAllReferencesForType (const QualifiedName &type, std::optional< size_t > maxItems=std::nullopt) |
| Returns a all references to a specific type. | |
| AllTypeFieldReferences | GetAllReferencesForTypeField (const QualifiedName &type, uint64_t offset, std::optional< size_t > maxItems=std::nullopt) |
| Returns a all references to a specific type field. | |
| std::vector< TypeReferenceSource > | GetCodeReferencesForTypeFrom (ReferenceSource src) |
Returns a list of types referenced by code at ReferenceSource src. | |
| std::vector< TypeReferenceSource > | GetCodeReferencesForTypeFrom (ReferenceSource src, uint64_t len) |
Returns a list of types referenced by code at ReferenceSource src. | |
| std::vector< TypeReferenceSource > | GetCodeReferencesForTypeFieldFrom (ReferenceSource src) |
Returns a list of type fields referenced by code at ReferenceSource src. | |
| std::vector< TypeReferenceSource > | GetCodeReferencesForTypeFieldFrom (ReferenceSource src, uint64_t len) |
Returns a list of type fields referenced by code at ReferenceSource src. | |
| std::vector< uint64_t > | GetAllFieldsReferenced (const QualifiedName &type) |
| Returns a list of offsets in the QualifiedName specified by name, which are referenced by code. | |
| 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. | |
| 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. | |
| std::vector< size_t > | GetSizesReferenced (const QualifiedName &type, uint64_t offset) |
| Returns a list of types related to the type field access. | |
| std::vector< Confidence< Ref< Type > > > | GetTypesReferenced (const QualifiedName &type, uint64_t offset) |
| Returns a list of types referenced by a particular type field. | |
| std::unordered_set< QualifiedName > | GetOutgoingDirectTypeReferences (const QualifiedName &type) |
| std::unordered_set< QualifiedName > | GetOutgoingRecursiveTypeReferences (const QualifiedName &type) |
| std::unordered_set< QualifiedName > | GetOutgoingRecursiveTypeReferences (const std::unordered_set< QualifiedName > &types) |
| std::unordered_set< QualifiedName > | GetIncomingDirectTypeReferences (const QualifiedName &type) |
| std::unordered_set< QualifiedName > | GetIncomingRecursiveTypeReferences (const QualifiedName &type) |
| std::unordered_set< QualifiedName > | GetIncomingRecursiveTypeReferences (const std::unordered_set< QualifiedName > &types) |
| Ref< Structure > | CreateStructureBasedOnFieldAccesses (const QualifiedName &type) |
| std::vector< uint64_t > | GetCallees (ReferenceSource addr) |
| Returns a list of virtual addresses called by the call site in the ReferenceSource. | |
| std::vector< ReferenceSource > | GetCallers (uint64_t addr) |
| Returns a list of ReferenceSource objects (xrefs or cross-references) that call the provided virtual address. | |
| Ref< Symbol > | GetSymbolByAddress (uint64_t addr, const NameSpace &nameSpace=NameSpace()) |
| Returns the Symbol at the provided virtual address. | |
| Ref< Symbol > | GetSymbolByRawName (const std::string &name, const NameSpace &nameSpace=NameSpace()) |
| Retrieves a Symbol object for the given a raw (mangled) name. | |
| std::vector< Ref< Symbol > > | GetSymbolsByName (const std::string &name, const NameSpace &nameSpace=NameSpace()) |
| Retrieves a list of symbols with a given name. | |
| 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. | |
| std::vector< Ref< Symbol > > | GetSymbols (const NameSpace &nameSpace=NameSpace()) |
| Retrieves the list of all Symbol objects. | |
| std::vector< Ref< Symbol > > | GetSymbols (uint64_t start, uint64_t len, const NameSpace &nameSpace=NameSpace()) |
| Retrieves a list of symbols in a given range. | |
| std::vector< Ref< Symbol > > | GetSymbolsOfType (BNSymbolType type, const NameSpace &nameSpace=NameSpace()) |
| Retrieves a list of all Symbol objects of the provided symbol type. | |
| 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. | |
| std::vector< Ref< Symbol > > | GetVisibleSymbols (const NameSpace &nameSpace=NameSpace()) |
| Get the list of visible symbols. | |
| void | DefineAutoSymbol (Ref< Symbol > sym) |
| Adds a symbol to the internal list of automatically discovered Symbol objects in a given namespace. | |
| Ref< Symbol > | DefineAutoSymbolAndVariableOrFunction (Ref< Platform > platform, Ref< Symbol > sym, const Confidence< Ref< Type > > &type) |
| Defines an "Auto" symbol, and a Variable/Function alongside it. | |
| void | UndefineAutoSymbol (Ref< Symbol > sym) |
| Undefine an automatically defined symbol. | |
| void | DefineUserSymbol (Ref< Symbol > sym) |
| Define a user symbol. | |
| void | UndefineUserSymbol (Ref< Symbol > sym) |
| Undefine a user symbol. | |
| void | DefineImportedFunction (Ref< Symbol > importAddressSym, Ref< Function > func, Ref< Type > type=nullptr) |
Defines an imported Function func with a ImportedFunctionSymbol type. | |
| Ref< DebugInfo > | GetDebugInfo () |
| The current debug info object for this binary view. | |
| void | ApplyDebugInfo (Ref< DebugInfo > newDebugInfo) |
| Sets the debug info and applies its contents to the current BinaryView. | |
| void | SetDebugInfo (Ref< DebugInfo > newDebugInfo) |
| Sets the debug info for the current binary view. | |
| bool | IsApplyingDebugInfo () const |
| Determine is a debug info object is currently being applied. | |
| void | BeginBulkModifySymbols () |
| void | EndBulkModifySymbols () |
| void | AddTagType (Ref< TagType > tagType) |
| Add a new TagType to this binaryview. | |
| void | RemoveTagType (Ref< TagType > tagType) |
| Remove a TagType from this binaryview. | |
| Ref< TagType > | GetTagType (const std::string &name) |
| Get a TagType by name. | |
| Ref< TagType > | GetTagType (const std::string &name, TagType::Type type) |
| Get a TagType by name and TagType::Type. | |
| Ref< TagType > | GetTagTypeByName (const std::string &name) |
| Get a TagType by name. | |
| Ref< TagType > | GetTagTypeByName (const std::string &name, TagType::Type type) |
| Get a TagType by name and TagType::Type. | |
| Ref< TagType > | GetTagTypeById (const std::string &id) |
| Get a TagType by its ID. | |
| Ref< TagType > | GetTagTypeById (const std::string &id, TagType::Type type) |
| Get a TagType by its ID and TagType::Type. | |
| std::vector< Ref< TagType > > | GetTagTypes () |
| Get the list of all defined TagTypes. | |
| void | AddTag (Ref< Tag > tag, bool user=false) |
| Add a Tag. | |
| void | RemoveTag (Ref< Tag > tag, bool user=false) |
| Remove a tag. | |
| Ref< Tag > | GetTag (const std::string &tagId) |
| Get a tag by its ID. | |
| std::vector< TagReference > | GetAllTagReferences () |
| std::vector< TagReference > | GetAllAddressTagReferences () |
| std::vector< TagReference > | GetAllFunctionTagReferences () |
| std::vector< TagReference > | GetAllTagReferencesOfType (Ref< TagType > tagType) |
| std::vector< TagReference > | GetTagReferencesOfType (Ref< TagType > tagType) |
| size_t | GetTagReferencesOfTypeCount (Ref< TagType > tagType) |
| size_t | GetAllTagReferencesOfTypeCount (Ref< TagType > tagType) |
| std::map< Ref< TagType >, size_t > | GetAllTagReferenceTypeCounts () |
| std::vector< TagReference > | GetDataTagReferences () |
| std::vector< TagReference > | GetAutoDataTagReferences () |
| std::vector< TagReference > | GetUserDataTagReferences () |
| 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< TagReference > | GetDataTagsInRange (uint64_t start, uint64_t end) |
| std::vector< TagReference > | GetAutoDataTagsInRange (uint64_t start, uint64_t end) |
| std::vector< TagReference > | GetUserDataTagsInRange (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< Tag > | CreateAutoDataTag (uint64_t addr, const std::string &tagTypeName, const std::string &data, bool unique=false) |
| Ref< Tag > | CreateUserDataTag (uint64_t addr, const std::string &tagTypeName, const std::string &data, bool unique=false) |
| Ref< Tag > | CreateAutoDataTag (uint64_t addr, Ref< TagType > tagType, const std::string &data, bool unique=false) |
| Ref< Tag > | CreateUserDataTag (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. | |
| std::optional< Ref< Component > > | GetComponentByPath (std::string path) |
| Lookup a component by its pathname. | |
| Ref< Component > | GetRootComponent () |
| Get the root component for the BinaryView (read-only). | |
| Ref< Component > | CreateComponent () |
| Create a component. | |
| Ref< Component > | CreateComponent (std::string parentGUID) |
| Create a component as a subcomponent of the component with a given Guid. | |
| Ref< Component > | CreateComponent (Ref< Component > parent) |
| Create a component as a subcomponent of a given Component. | |
| Ref< Component > | CreateComponentWithName (std::string name, std::string parentGUID={}) |
| Create a component with a given name and optional parent. | |
| Ref< Component > | CreateComponentWithName (std::string name, Ref< Component > parent) |
| Create a component with a given name and parent. | |
| bool | RemoveComponent (Ref< Component > component) |
| Remove a component from the tree entirely. | |
| bool | RemoveComponent (std::string guid) |
| Remove a component from the tree entirely. | |
| std::vector< Ref< Component > > | GetFunctionParentComponents (Ref< Function > function) const |
| std::vector< Ref< Component > > | GetDataVariableParentComponents (DataVariable var) const |
| std::optional< BNStringType > | CheckForStringAnnotationType (uint64_t addr, std::string &value, bool allowShortStrings, bool allowLargeStrings, size_t childWidth) |
| Heuristically determine if a string exists at the given address. | |
| bool | CanAssemble (Architecture *arch) |
| Check whether the given architecture supports assembling instructions. | |
| bool | IsNeverBranchPatchAvailable (Architecture *arch, uint64_t addr) |
| Check whether the "Never Branch" patch is available for a given architecture at a given address. | |
| bool | IsAlwaysBranchPatchAvailable (Architecture *arch, uint64_t addr) |
| Check whether the "Always Branch" patch is available for a given architecture at a given address. | |
| bool | IsInvertBranchPatchAvailable (Architecture *arch, uint64_t addr) |
| Check whether the "Invert Branch" patch is available for a given architecture at a given address. | |
| 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. | |
| 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. | |
| bool | ConvertToNop (Architecture *arch, uint64_t addr) |
| Convert the instruction at the given address to a nop. | |
| bool | AlwaysBranch (Architecture *arch, uint64_t addr) |
| Convert the conditional branch at the given address to always branch. | |
| bool | InvertBranch (Architecture *arch, uint64_t addr) |
| Convert the conditional branch at the given address to branch under inverted conditions. | |
| bool | SkipAndReturnValue (Architecture *arch, uint64_t addr, uint64_t value) |
| Convert the given instruction to skip the rest of the function and return 0. | |
| size_t | GetInstructionLength (Architecture *arch, uint64_t addr) |
| Get the length of the instruction at a given address. | |
| bool | GetStringAtAddress (uint64_t addr, BNStringReference &strRef) |
| Get the string at an address. | |
| std::vector< BNStringReference > | GetStrings () |
| Get the list of strings located within the view. | |
| std::vector< BNStringReference > | GetStrings (uint64_t start, uint64_t len) |
| Get the list of strings located within a range. | |
| std::vector< DerivedString > | GetDerivedStrings () |
| std::vector< ReferenceSource > | GetDerivedStringCodeReferences (const DerivedString &str, std::optional< size_t > maxItems=std::nullopt) |
| Ref< AnalysisCompletionEvent > | AddAnalysisCompletionEvent (const std::function< void()> &callback) |
| Sets up a call back function to be called when analysis has been completed. | |
| AnalysisInfo | GetAnalysisInfo () |
| BNAnalysisProgress | GetAnalysisProgress () |
| BNAnalysisState | GetAnalysisState () |
| Ref< BackgroundTask > | GetBackgroundAnalysisTask () |
| uint64_t | GetNextFunctionStartAfterAddress (uint64_t addr) |
| Returns the virtual address of the Function that occurs after the virtual address `addr`. | |
| uint64_t | GetNextBasicBlockStartAfterAddress (uint64_t addr) |
| Returns the virtual address of the BasicBlock that occurs after the virtual address `addr`. | |
| uint64_t | GetNextDataAfterAddress (uint64_t addr) |
| Retrieves the virtual address of the next non-code byte. | |
| uint64_t | GetNextDataVariableStartAfterAddress (uint64_t addr) |
| Retrieves the address of the next DataVariable. | |
| uint64_t | GetPreviousFunctionStartBeforeAddress (uint64_t addr) |
| Returns the virtual address of the Function that occurs prior to the virtual address provided. | |
| uint64_t | GetPreviousBasicBlockStartBeforeAddress (uint64_t addr) |
| Returns the virtual address of the Basic Block that occurs prior to the virtual address provided. | |
| uint64_t | GetPreviousBasicBlockEndBeforeAddress (uint64_t addr) |
| Returns the ending virtual address of the Basic Block that occurs prior to the virtual address provided. | |
| uint64_t | GetPreviousDataBeforeAddress (uint64_t addr) |
| Returns the virtual address of the previous data (non-code) byte. | |
| uint64_t | GetPreviousDataVariableStartBeforeAddress (uint64_t addr) |
| Returns the virtual address of the previous DataVariable. | |
| 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={}, bool importDependencies=true) |
| Parse a single type and name from a string containing their definition. | |
| 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={}, bool importDependencies=true) |
| Parse an entire block of source into types, variables, and functions. | |
| 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={}, bool importDependencies=true) |
| Parse an entire block of source into a structure containing types, variables, and functions. | |
| class TypeContainer | GetTypeContainer () |
| Type Container for all types (user and auto) in the BinaryView. | |
| class TypeContainer | GetAutoTypeContainer () |
| Type Container for ONLY auto types in the BinaryView. | |
| class TypeContainer | GetUserTypeContainer () |
| Type Container for ONLY user types in the BinaryView. | |
| 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. | |
| std::vector< QualifiedName > | GetTypeNames (const std::string &matching="") |
| Ref< Type > | GetTypeByName (const QualifiedName &name) |
| Ref< Type > | GetTypeByRef (Ref< NamedTypeReference > name) |
| Ref< Type > | GetTypeById (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) |
| std::unordered_map< std::string, QualifiedName > | DefineTypes (const std::vector< std::pair< std::string, QualifiedNameAndType > > &types, ProgressFunction progress={}) |
| void | DefineUserType (const QualifiedName &name, Ref< Type > type) |
| void | DefineUserTypes (const std::vector< QualifiedNameAndType > &types, ProgressFunction progress={}) |
| void | DefineUserTypes (const std::vector< ParsedType > &types, ProgressFunction progress={}) |
| void | UndefineType (const std::string &id) |
| void | UndefineUserType (const QualifiedName &name) |
| void | RenameType (const QualifiedName &oldName, const QualifiedName &newName) |
| Ref< Type > | GetSystemCallType (Platform *platform, uint32_t id) |
| std::string | GetSystemCallName (Platform *platform, uint32_t id) |
| 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. | |
| void | AddTypeLibrary (TypeLibrary *lib) |
| Make the contents of a type library available for type/import resolution. | |
| Ref< TypeLibrary > | GetTypeLibrary (const std::string &name) |
| Get the type library with the given name. | |
| std::vector< Ref< TypeLibrary > > | GetTypeLibraries () |
| Get the list of imported type libraries. | |
| Ref< Type > | 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. | |
| Ref< Type > | 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. | |
| Ref< Type > | ImportTypeLibraryTypeByGuid (const std::string &guid) |
| Recursively imports a type by guid from the current BinaryView's set of type libraries. | |
| std::optional< QualifiedName > | GetTypeNameByGuid (const std::string &guid) |
| void | ExportTypeToTypeLibrary (TypeLibrary *lib, const QualifiedName &name, Type *type) |
| Recursively exports ``type`` into ``lib`` as a type with name ``name``. | |
| void | ExportObjectToTypeLibrary (TypeLibrary *lib, const QualifiedName &name, Type *type) |
| Recursively exports ``type`` into ``lib`` as an object with name ``name``. | |
| 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). | |
| 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. | |
| 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. | |
| Ref< TypeArchive > | AttachTypeArchive (const std::string &id, const std::string &path) |
| Attach a given type archive to the binary view. | |
| void | DetachTypeArchive (const std::string &id) |
| Detach from a type archive, breaking all associations to types with the archive. | |
| Ref< TypeArchive > | GetTypeArchive (const std::string &id) const |
| Look up a connected archive by its id. | |
| std::unordered_map< std::string, std::string > | GetTypeArchives () const |
| Get all attached type archives. | |
| std::optional< std::string > | GetTypeArchivePath (const std::string &id) const |
| Look up the path for an attached (but not necessarily connected) type archive by its id. | |
| std::unordered_map< QualifiedName, std::map< std::string, std::string > > | GetTypeArchiveTypeNames () const |
| Get a list of all available type names in all connected archives, and their archive/type id pair. | |
| std::unordered_map< std::string, std::pair< std::string, std::string > > | GetAssociatedTypeArchiveTypes () const |
| Get a list of all types in the analysis that are associated with a specific type archive. | |
| std::unordered_map< std::string, std::string > | GetAssociatedTypesFromArchive (const std::string &archive) const |
| Get a list of all types in the analysis that are associated with a specific type archive. | |
| std::optional< std::pair< std::string, std::string > > | GetAssociatedTypeArchiveTypeTarget (const std::string &id) const |
| Determine the target archive / type id of a given analysis type. | |
| std::optional< std::string > | GetAssociatedTypeArchiveTypeSource (const std::string &archiveId, const std::string &archiveTypeId) const |
| Determine the local source type for a given archive type. | |
| BNSyncStatus | GetTypeArchiveSyncStatus (const std::string &typeId) const |
| Get the current status of any changes pending in a given type. | |
| bool | DisassociateTypeArchiveType (const std::string &typeId) |
| Disassociate an associated type, so that it will no longer receive updates from its connected type archive. | |
| bool | PullTypeArchiveTypes (const std::string &archiveId, const std::unordered_set< std::string > &archiveTypeIds, std::unordered_map< std::string, std::string > &updatedTypes) |
| Pull a collection of types from a type archive, associating with them and any dependencies. | |
| bool | PushTypeArchiveTypes (const std::string &archiveId, const std::unordered_set< std::string > &typeIds, std::unordered_map< std::string, std::string > &updatedTypes) |
| Push a collection of types, and all their dependencies, into a type archive. | |
| 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, const FunctionViewType &viewType=NormalFunctionGraph) |
| bool | FindNextConstant (uint64_t start, uint64_t constant, uint64_t &result, Ref< DisassemblySettings > settings, const FunctionViewType &viewType=NormalFunctionGraph) |
| bool | FindNextData (uint64_t start, uint64_t end, const DataBuffer &data, uint64_t &addr, BNFindFlag flags, const ProgressFunction &progress) |
| bool | FindNextText (uint64_t start, uint64_t end, const std::string &data, uint64_t &addr, Ref< DisassemblySettings > settings, BNFindFlag flags, const FunctionViewType &viewType, const ProgressFunction &progress) |
| bool | FindNextConstant (uint64_t start, uint64_t end, uint64_t constant, uint64_t &addr, Ref< DisassemblySettings > settings, const FunctionViewType &viewType, const ProgressFunction &progress) |
| bool | FindAllData (uint64_t start, uint64_t end, const DataBuffer &data, BNFindFlag flags, const ProgressFunction &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, const FunctionViewType &viewType, const ProgressFunction &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, const FunctionViewType &viewType, const ProgressFunction &progress, const std::function< bool(uint64_t addr, const LinearDisassemblyLine &line)> &matchCallback) |
| std::string | DetectSearchMode (const std::string &query) |
| bool | Search (const std::string &query, const ProgressFunction &progressCallback, const std::function< bool(uint64_t addr, const DataBuffer &buffer)> &matchCallback) |
| void | Reanalyze () |
| Ref< Workflow > | GetWorkflow () |
| void | ShowPlainTextReport (const std::string &title, const std::string &contents) |
| Displays contents to the user in the UI or on the command-line. | |
| 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. | |
| 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. | |
| void | ShowGraphReport (const std::string &title, FlowGraph *graph) |
| Displays a flow graph in UI applications and nothing in command-line applications. | |
| 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. | |
| 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. | |
| MemoryMap * | GetMemoryMap () |
| A mock object that is a placeholder during development of this feature. | |
| void | BeginBulkAddSegments () |
| Begin a bulk segment addition operation. | |
| void | EndBulkAddSegments () |
| Finalize and apply all queued segments (auto and user) added during a bulk segment addition operation. | |
| void | CancelBulkAddSegments () |
| Cancel a bulk segment addition operation. | |
| 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. | |
| void | AddAutoSegments (const std::vector< BNSegmentInfo > &segments) |
| Add analysis segments that specify how data from the raw file is mapped into a virtual address space. | |
| void | RemoveAutoSegment (uint64_t start, uint64_t length) |
| Removes an automatically generated segment from the current segment mapping. | |
| 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. | |
| void | AddUserSegments (const std::vector< BNSegmentInfo > &segments) |
| Creates user-defined segments that specify how data from the raw file is mapped into a virtual address space. | |
| void | RemoveUserSegment (uint64_t start, uint64_t length) |
| Removes a user-defined segment from th current segment mapping. | |
| std::vector< Ref< Segment > > | GetSegments () |
| Get the list of registered Segments. | |
| Ref< Segment > | GetSegmentAt (uint64_t addr) |
| Gets the Segment a given virtual address is located in. | |
| bool | GetAddressForDataOffset (uint64_t offset, uint64_t &addr) |
| Retrieves the virtual addreses that maps to the given file offset, if possible. | |
| bool | GetDataOffsetForAddress (uint64_t addr, uint64_t &offset) |
| 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. | |
| void | RemoveAutoSection (const std::string &name) |
| Remove an automatically defined section by name. | |
| 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. | |
| void | RemoveUserSection (const std::string &name) |
| Remove a user defined section by name. | |
| std::vector< Ref< Section > > | GetSections () |
| Get the list of defined sections. | |
| std::vector< Ref< Section > > | GetSectionsAt (uint64_t addr) |
Get the list of sections containing addr. | |
| Ref< Section > | GetSectionByName (const std::string &name) |
| Get a Section by name. | |
| 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. | |
| std::vector< BNAddressRange > | GetAllocatedRanges () |
| Get the list of allocated ranges. | |
| std::vector< BNAddressRange > | GetMappedAddressRanges () |
| Get the list of ranges mapped into the address space. | |
| std::vector< BNAddressRange > | GetBackedAddressRanges () |
| Get the list of ranges that are mapped into the address space and are backed by a target object. | |
| std::string | GetCommentForAddress (uint64_t addr) const |
| Get the comment placed at an address. | |
| std::vector< uint64_t > | GetCommentedAddresses () const |
| Get the list of commented addresses. | |
| void | SetCommentForAddress (uint64_t addr, const std::string &comment) |
| Set the comment at an address. | |
| void | StoreMetadata (const std::string &key, Ref< Metadata > value, bool isAuto=false) |
| Ref< Metadata > | QueryMetadata (const std::string &key) |
| void | RemoveMetadata (const std::string &key) |
| Ref< Metadata > | GetMetadata () |
| Ref< Metadata > | GetAutoMetadata () |
| 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< Settings > | GetLoadSettings (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) |
| bool | ShouldSkipTargetAnalysis (const ArchAndAddr &source, Ref< Function > sourceFunc, uint64_t sourceEnd, const ArchAndAddr &target) |
| Determine whether the target analysis should be skipped for a given source function and target address. | |
| std::set< NameSpace > | GetNameSpaces () const |
| Returns a list of namespaces for the current BinaryView. | |
| bool | HasSymbols () const |
| Check whether this BinaryView has any defined symbols. | |
| bool | HasDataVariables () const |
| Check whether this BinaryView has any defined DataVariables. | |
| Ref< Structure > | CreateStructureFromOffsetAccess (const QualifiedName &type, bool *newMemberAdded) const |
| Confidence< Ref< Type > > | CreateStructureMemberFromAccess (const QualifiedName &name, uint64_t offset) const |
| Ref< Logger > | CreateLogger (const std::string &name) |
| Create a logger with a session ID tied to this BinaryView. | |
| void | AddExpressionParserMagicValue (const std::string &name, uint64_t value) |
| Add a magic value to the expression parser. | |
| void | RemoveExpressionParserMagicValue (const std::string &name) |
| Remove a magic value from the expression parser. | |
| void | AddExpressionParserMagicValues (const std::vector< std::string > &names, const std::vector< uint64_t > &values) |
| Add a list of magic value to the expression parser. | |
| void | RemoveExpressionParserMagicValues (const std::vector< std::string > &names) |
| Remove a list of magic value from the expression parser. | |
| bool | GetExpressionParserMagicValue (const std::string &name, uint64_t *value) |
| Get the value of an expression parser magic value. | |
| Ref< ExternalLibrary > | AddExternalLibrary (const std::string &name, Ref< ProjectFile > backingFile, bool isAuto=false) |
| void | RemoveExternalLibrary (const std::string &name) |
| Ref< ExternalLibrary > | GetExternalLibrary (const std::string &name) |
| std::vector< Ref< ExternalLibrary > > | GetExternalLibraries () |
| Ref< ExternalLocation > | AddExternalLocation (Ref< Symbol > sourceSymbol, Ref< ExternalLibrary > library, std::optional< std::string > targetSymbol, std::optional< uint64_t > targetAddress, bool isAuto=false) |
| void | RemoveExternalLocation (Ref< Symbol > sourceSymbol) |
| Ref< ExternalLocation > | GetExternalLocation (Ref< Symbol > sourceSymbol) |
| std::vector< Ref< ExternalLocation > > | GetExternalLocations () |
| Confidence< RegisterValue > | GetGlobalPointerValue () const |
| bool | UserGlobalPointerValueSet () const |
| void | ClearUserGlobalPointerValue () |
| void | SetUserGlobalPointerValue (const Confidence< RegisterValue > &value) |
| std::optional< std::pair< std::string, BNStringType > > | StringifyUnicodeData (Architecture *arch, const DataBuffer &buffer, bool nullTerminates=true, bool allowShortStrings=false) |
| 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. | |
| static NameSpace | GetExternalNameSpace () |
| External namespace for the current BinaryView. | |
| 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. | |
Protected Member Functions | |
| BinaryView (const std::string &typeName, FileMetadata *file, BinaryView *parentView=nullptr) | |
| BinaryView constructor. | |
| 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. | |
| 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. | |
| 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`. | |
| 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`. | |
| virtual BNModificationStatus | PerformGetModification (uint64_t offset) |
| PerformGetModification implements a query as to whether the virtual address `offset` is modified. | |
| virtual bool | PerformIsValidOffset (uint64_t offset) |
| PerformIsValidOffset implements a check as to whether a virtual address `offset` is valid. | |
| virtual bool | PerformIsOffsetReadable (uint64_t offset) |
| PerformIsOffsetReadable implements a check as to whether a virtual address is readable. | |
| virtual bool | PerformIsOffsetWritable (uint64_t offset) |
| PerformIsOffsetWritable implements a check as to whether a virtual address is writable. | |
| virtual bool | PerformIsOffsetExecutable (uint64_t offset) |
| PerformIsOffsetExecutable implements a check as to whether a virtual address is executable. | |
| virtual bool | PerformIsOffsetBackedByFile (uint64_t offset) |
| PerformIsOffsetBackedByFile implements a check as to whether a virtual address is backed by a file. | |
| virtual uint64_t | PerformGetNextValidOffset (uint64_t offset) |
| PerformGetNextValidOffset implements a query for the next valid readable, writable, or executable virtual memory address after `offset`. | |
| virtual uint64_t | PerformGetStart () const |
| PerformGetStart implements a query for the first readable, writable, or executable virtual address in the BinaryView. | |
| 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. | |
| virtual BNEndianness | PerformGetDefaultEndianness () const |
| PerformGetDefaultEndianness implements a check which returns the Endianness of the BinaryView. | |
| virtual bool | PerformIsRelocatable () const |
| PerformIsRelocatable implements a check which returns true if the BinaryView is relocatable. | |
| virtual size_t | PerformGetAddressSize () const |
| PerformGetAddressSize implements a query for the address size for this BinaryView. | |
| 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) |
Protected Attributes | |
| Ref< FileMetadata > | m_file |
| The underlying file. | |
|
protected |
BinaryView constructor.
- Parameters
-
typeName name of the BinaryView (e.g. ELF, PE, Mach-O, ...) file a file to create a view from parentView optional view that contains the raw data used by this view
◆ BinaryView() [2/2]
◆ PerformRead()
|
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
-
dest the address to write len number of bytes. offset the virtual offset to find and read len bytes from len the number of bytes to read from offset and write to dest
◆ PerformWrite()
|
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
-
offset the virtual offset to find and write len bytes to data the address to read len number of bytes from len the number of bytes to read from data and write to offset
- Returns
- length of data written, 0 on error
◆ PerformInsert()
|
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
-
offset the virtual offset to find and insert len bytes into data the address to read len number of bytes from len the number of bytes to read from data and insert at offset
- Returns
- length of data inserted, 0 on error
◆ PerformRemove()
|
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
-
offset the virtual offset to find and remove bytes from len the number of bytes to be removed
- Returns
- length of data removed, 0 on error
◆ PerformGetModification()
|
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
-
offset a virtual address to be checked
- Returns
- one of Original, Changed, Inserted
◆ PerformIsValidOffset()
|
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
-
offset the virtual address to check
- Returns
- whether the offset is valid
◆ PerformIsOffsetReadable()
|
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
-
offset the virtual address to check
- Returns
- whether the offset is readable
◆ PerformIsOffsetWritable()
|
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
-
offset the virtual address to check
- Returns
- whether the offset is writable
◆ PerformIsOffsetExecutable()
|
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
-
offset the virtual address to check
- Returns
- whether the offset is executable
◆ PerformIsOffsetBackedByFile()
|
protectedvirtual |
PerformIsOffsetBackedByFile implements a check as to whether a virtual address is backed by a file.
- Parameters
-
offset the virtual address to check
- Returns
- whether the offset is backed by a file
◆ PerformGetNextValidOffset()
|
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
-
offset a virtual address to start checking from
- Returns
- the next valid address
◆ PerformGetStart()
|
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()
|
inlineprotectedvirtual |
◆ PerformGetEntryPoint()
|
inlineprotectedvirtual |
◆ PerformIsExecutable()
|
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()
|
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()
|
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()
|
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()
|
protectedvirtual |
◆ PerformDefineRelocation() [1/2]
◆ PerformDefineRelocation() [2/2]
◆ NotifyDataWritten()
| void BinaryView::NotifyDataWritten | ( | uint64_t | offset, |
| size_t | len ) |
◆ NotifyDataInserted()
| void BinaryView::NotifyDataInserted | ( | uint64_t | offset, |
| size_t | len ) |
◆ NotifyDataRemoved()
| void BinaryView::NotifyDataRemoved | ( | uint64_t | offset, |
| uint64_t | len ) |
◆ Init()
|
inlinevirtual |
◆ GetFile()
|
inline |
◆ 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]
Writes the current database (.bndb) out to the specified file.
- Parameters
-
path path and filename to write the bndb to. Should have ".bndb" appended to it. settings Special save options
- Returns
- Whether the save was successful
◆ CreateDatabase() [2/2]
Writes the current database (.bndb) out to the specified file.
- Parameters
-
path path and filename to write the bndb to. Should have ".bndb" appended to it. progressCallback callback function to send save progress to. settings Special save options
- Returns
- Whether the save was successful
◆ SaveAutoSnapshot() [1/2]
◆ SaveAutoSnapshot() [2/2]
◆ RunUndoableTransaction()
| bool BinaryView::RunUndoableTransaction | ( | std::function< bool()> | func | ) |
Run a function in a context in which any changes made to analysis will be added to an undo state.
If the function returns false or throws an exception, any changes made within will be reverted.
- Parameters
- Returns
- Return status of function
- Exceptions
-
std::exception If the called function throws an exception
◆ BeginUndoActions()
|
nodiscard |
Start recording actions taken so they can be undone at some point.
- Parameters
-
anonymousAllowed Legacy interop: prevent empty calls to CommitUndoActions from affecting this undo state. Specifically for RunUndoableTransaction.
- Returns
- Id of UndoEntry created, for passing to either CommitUndoActions or RevertUndoActions
◆ CommitUndoActions()
| void BinaryView::CommitUndoActions | ( | const std::string & | id | ) |
Commit the actions taken since a call to BeginUndoActions.
- Parameters
-
id Id of UndoEntry created by BeginUndoActions
◆ RevertUndoActions()
| void BinaryView::RevertUndoActions | ( | const std::string & | id | ) |
Revert the actions taken since a call to BeginUndoActions.
- Parameters
-
id Id of UndoEntry created by BeginUndoActions
◆ ForgetUndoActions()
| void BinaryView::ForgetUndoActions | ( | const std::string & | id | ) |
Forget the actions taken since a call to BeginUndoActions.
- Parameters
-
id Id of UndoEntry created by BeginUndoActions
◆ 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 | ( | ) |
◆ 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
-
view View name. e.g. ``Linear:ELF``, ``Graph:PE`` offset Virtual 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
-
dest Virtual address to write to offset virtual address to read from len number 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
-
offset virtual address to read from len number of bytes to read
- Returns
- DataBuffer containing the read bytes
◆ GetDataPointer()
| const uint8_t * BinaryView::GetDataPointer | ( | ) | const |
GetDataPointer returns a pointer to the underlying data for zero-copy access.
- Returns
- pointer to data if available for zero-copy access, nullptr otherwise
◆ GetDataLength()
| size_t BinaryView::GetDataLength | ( | ) | const |
GetDataLength returns the length of the underlying data.
- Returns
- length of data if available for zero-copy access, 0 otherwise
◆ 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
-
offset virtual address to write to data address to read from len number 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
-
offset virtual address to write to data DataBuffer 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
-
offset virtual address to start inserting from data address to read from len number 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
-
offset virtual address to start inserting from data DataBuffer 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
-
offset the virtual offset to find and remove bytes from len the 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]
GetModification checks whether the virtual address `offset` is modified.
- Parameters
-
offset a virtual address to be checked
- Returns
- one of Original, Changed, Inserted
◆ GetModification() [2/2]
◆ IsValidOffset()
| bool BinaryView::IsValidOffset | ( | uint64_t | offset | ) | const |
IsValidOffset checks whether a virtual address `offset` is valid.
- Parameters
-
offset the 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
-
offset the 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
-
offset the 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
-
offset the 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
-
offset the 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
-
offset a virtual address to start checking from
- Returns
- the next valid address
◆ GetImageBase()
| uint64_t BinaryView::GetImageBase | ( | ) | const |
GetImageBase queries for the image base in the BinaryView.
- Returns
- the image base of the BinaryView
◆ GetOriginalImageBase()
| uint64_t BinaryView::GetOriginalImageBase | ( | ) | const |
GetOriginalImageBase queries for the original image base in the BinaryView, unaffected by any rebasing operations.
- Returns
- the original image base of the BinaryView
◆ SetOriginalImageBase()
| void BinaryView::SetOriginalImageBase | ( | uint64_t | imageBase | ) |
SetOriginalBase sets the original image base in the BinaryView, unaffected by any rebasing operations.
This is only intended to be used by Binary View implementations to provide this value. Regular users should NOT change this value.
- Parameters
-
imageBase the original image base of the binary view
◆ GetOriginalBase()
| uint64_t BinaryView::GetOriginalBase | ( | ) | const |
GetOriginalBase queries for the original image base in the BinaryView, unaffected by any rebasing operations.
- Deprecated
- This API has been deprecated in favor of GetOriginalImageBase in 4.1.5902
- Returns
- the original image base of the BinaryView
◆ SetOriginalBase()
| void BinaryView::SetOriginalBase | ( | uint64_t | base | ) |
SetOriginalBase sets the original image base in the BinaryView, unaffected by any rebasing operations.
This is only intended to be used by Binary View implementations to provide this value. Regular users should NOT change this value.
- Deprecated
- This API has been deprecated in favor of SetOriginalImageBase in 4.1.5902
- Parameters
-
base the original image base of the binary view
◆ 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 end virtual address of 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()
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
-
arch the new default architecture
◆ GetDefaultPlatform()
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
-
arch the new default platform
◆ GetDefaultEndianness()
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]
Save the original binary file to a FileAccessor.
- Parameters
-
file a 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
-
path destination path and filename of the file to be written
- Returns
- Whether the save was successful
◆ FinalizeNewSegments()
| bool BinaryView::FinalizeNewSegments | ( | ) |
Performs "finalization" on segments added after initial Finalization (performed after an Init() has completed).
Finalizing a segment involves optimizing the relocation info stored in that segment, so if a segment is added and relocations are defined for that segment by some automated process, this function should be called afterwards.
An example of this can be seen in the KernelCache plugin, in `KernelCache::LoadImageWithInstallName`. After we load an image, map new segments, and define relocations for all of them, we call this function to let core know it is now safe to finalize the new segments
- Returns
- Whether finalization was successful.
◆ DefineRelocation() [1/2]
◆ DefineRelocation() [2/2]
◆ GetRelocationRanges()
| vector< pair< uint64_t, uint64_t > > BinaryView::GetRelocationRanges | ( | ) | const |
◆ GetRelocationRangesAtAddress()
| vector< pair< uint64_t, uint64_t > > BinaryView::GetRelocationRangesAtAddress | ( | uint64_t | addr | ) | const |
◆ GetRelocationRangesInRange()
| vector< pair< uint64_t, uint64_t > > BinaryView::GetRelocationRangesInRange | ( | uint64_t | addr, |
| size_t | size ) const |
◆ RangeContainsRelocation()
| bool BinaryView::RangeContainsRelocation | ( | uint64_t | addr, |
| size_t | size ) const |
◆ GetRelocationsAt()
| std::vector< Ref< Relocation > > BinaryView::GetRelocationsAt | ( | uint64_t | addr | ) | const |
◆ RegisterNotification()
| void BinaryView::RegisterNotification | ( | BinaryDataNotification * | notify | ) |
Provides a mechanism for receiving callbacks for various analysis events.
- Parameters
-
notify An instance of a class Subclassing BinaryDataNotification
◆ UnregisterNotification()
| void BinaryView::UnregisterNotification | ( | BinaryDataNotification * | notify | ) |
Unregister a notification passed to RegisterNotification.
- Parameters
-
notify An 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
-
name Name 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
-
platform Platform for the function to be loaded addr Virtual adddress of the function to be loaded autoDiscovered true if function was automatically discovered, false if created by user type optional function type
◆ AddEntryPointForAnalysis()
| void BinaryView::AddEntryPointForAnalysis | ( | Platform * | platform, |
| uint64_t | start ) |
adds an virtual address to start analysis from for a given platform
- Parameters
-
platform Platform for the entry point analysis start virtual address to start analysis from
◆ AddToEntryFunctions()
| void BinaryView::AddToEntryFunctions | ( | Function * | func | ) |
adds an function to all entry function list
- Parameters
◆ RemoveAnalysisFunction()
| void BinaryView::RemoveAnalysisFunction | ( | Function * | func, |
| bool | updateRefs = false ) |
removes a function from the list of functions
- Parameters
-
func Function to be removed updateRefs automatically update other functions that were referenced
◆ CreateUserFunction()
Add a new user function of the given platform at the virtual address.
- Parameters
-
platform Platform for the function to be loaded addr Virtual adddress of the function to be loaded
◆ RemoveUserFunction()
| void BinaryView::RemoveUserFunction | ( | Function * | func | ) |
removes a user function from the list of functions
- Parameters
◆ 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
-
enable Whether to enable or disable the analysis hold
◆ GetFunctionAnalysisUpdateDisabled()
| bool BinaryView::GetFunctionAnalysisUpdateDisabled | ( | ) |
◆ SetFunctionAnalysisUpdateDisabled()
| void BinaryView::SetFunctionAnalysisUpdateDisabled | ( | bool | disabled | ) |
◆ 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 analysis and suspend the workflow machine.
Stops analysis and transitions the workflow machine to the Suspend state. This operation is recoverable, and the workflow machine can be re-enabled via the WorkflowMachine Enable API.
◆ AnalysisIsAborted()
| bool BinaryView::AnalysisIsAborted | ( | ) | const |
Check whether analysis is currently running.
- Returns
- true if analysis is aborted, false otherwise
◆ DefineDataVariable()
| void BinaryView::DefineDataVariable | ( | uint64_t | addr, |
| const Confidence< Ref< Type > > & | type ) |
Define a DataVariable at a given address with a set type.
- Parameters
-
addr virtual address to define the DataVariable at type Type 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
-
addr virtual address to define the DataVariable at type Type for the DataVariable
◆ UndefineDataVariable()
| void BinaryView::UndefineDataVariable | ( | uint64_t | addr, |
| bool | blacklist = true ) |
Undefine a DataVariable at a given address.
- Parameters
-
addr virtual address of the DataVariable blacklist whether to add the address to the data variable black list so that the auto analysis would not recreate the variable on re-analysis
◆ UndefineUserDataVariable()
| void BinaryView::UndefineUserDataVariable | ( | uint64_t | addr | ) |
Undefine a user DataVariable at a given address.
- Parameters
-
addr virtual 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
-
addr Address for the DataVariable var Reference to a DataVariable class to write to
- Returns
- Whether a DataVariable was successfully retrieved
◆ 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()
Gets a function object for the function starting at a virtual address.
- Parameters
-
platform Platform for the desired function addr Starting virtual address for the function
- Returns
- the Function, if it exists
◆ GetRecentAnalysisFunctionForAddress()
◆ GetAnalysisFunctionsForAddress()
Get a list of functions defined at an address.
- Parameters
-
addr Starting virtual address for the function
- Returns
- vector of functions
◆ GetAnalysisFunctionsContainingAddress()
Get a list of functions containing an address.
- Parameters
- Returns
- vector of Functions
◆ GetAnalysisEntryPoint()
Get the function defined as the Analysis entry point for the view.
- Returns
- The analysis entry point function
◆ GetAllEntryFunctions()
Get all entry functions (including user-defined ones).
- Returns
- vector of Functions
◆ GetRecentBasicBlockForAddress()
| Ref< BasicBlock > BinaryView::GetRecentBasicBlockForAddress | ( | uint64_t | addr | ) |
Get most recently used Basic Block containing a virtual address.
- Parameters
- 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
- 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
- Returns
- vector of basic blocks starting at that address
◆ GetCodeReferences() [1/2]
Get a list of references made from code (instructions) to a virtual address.
- Parameters
- 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
-
addr Address to check len Length of query
- Returns
- vector of ReferenceSources referencing the virtual address range
◆ GetCodeReferencesWithLimit()
| vector< ReferenceSource > BinaryView::GetCodeReferencesWithLimit | ( | uint64_t | addr, |
| std::optional< size_t > | maxItems = std::nullopt ) |
Get a list of references made from code (instructions) to a virtual address.
- Parameters
-
addr Address to check maxItems Optional maximum number of items to fetch
- Returns
- vector of ReferenceSources referencing the virtual address
◆ GetCodeReferencesInRangeWithLimit()
| vector< ReferenceSource > BinaryView::GetCodeReferencesInRangeWithLimit | ( | uint64_t | addr, |
| uint64_t | len, | ||
| std::optional< size_t > | maxItems = std::nullopt ) |
Get a list of references from code (instructions) to a range of addresses.
- Parameters
-
addr Address to check len Length of query maxItems Optional maximum number of items to fetch
- 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
- 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
-
src reference source len Length 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
- 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
-
addr Address to check len Length of query
- Returns
- vector of virtual addresses referencing the virtual address range
◆ GetDataReferencesWithLimit()
| vector< uint64_t > BinaryView::GetDataReferencesWithLimit | ( | uint64_t | addr, |
| std::optional< size_t > | maxItems = std::nullopt ) |
Get references made by data ('DataVariables') to a virtual address.
- Parameters
-
addr Address to check maxItems Optional maximum number of items to fetch
- Returns
- vector of virtual addresses referencing the virtual address
◆ GetDataReferencesInRangeWithLimit()
| vector< uint64_t > BinaryView::GetDataReferencesInRangeWithLimit | ( | uint64_t | addr, |
| uint64_t | len, | ||
| std::optional< size_t > | maxItems = std::nullopt ) |
Get references made by data ('DataVariables') in a given range, to a virtual address.
- Parameters
-
addr Address to check len Length of query maxItems Optional maximum number of items to fetch
- 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
- 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
-
src reference source len Length of query
- Returns
- List of virtual addresses referenced by this address
◆ AddDataReference()
| void BinaryView::AddDataReference | ( | uint64_t | fromAddr, |
| uint64_t | toAddr ) |
Add an auto Data Reference from a virtual address to another virtual address.
- Parameters
-
fromAddr Address referencing the toAddr value toAddr virtual address being referenced
◆ RemoveDataReference()
| void BinaryView::RemoveDataReference | ( | uint64_t | fromAddr, |
| uint64_t | toAddr ) |
Remove an auto Data Reference from a virtual address to another virtual address.
- Parameters
-
fromAddr Address referencing the toAddr value toAddr virtual address being referenced
◆ AddUserDataReference()
| void BinaryView::AddUserDataReference | ( | uint64_t | fromAddr, |
| uint64_t | toAddr ) |
Add a user Data Reference from a virtual address to another virtual address.
- Parameters
-
fromAddr Address referencing the toAddr value toAddr virtual 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
-
fromAddr Address referencing the toAddr value toAddr virtual address being referenced
◆ GetCodeReferencesForType()
| vector< ReferenceSource > BinaryView::GetCodeReferencesForType | ( | const QualifiedName & | type, |
| std::optional< size_t > | maxItems = std::nullopt ) |
◆ GetDataReferencesForType()
| vector< uint64_t > BinaryView::GetDataReferencesForType | ( | const QualifiedName & | type, |
| std::optional< size_t > | maxItems = std::nullopt ) |
◆ GetTypeReferencesForType()
◆ GetCodeReferencesForTypeField()
| vector< TypeFieldReference > BinaryView::GetCodeReferencesForTypeField | ( | const QualifiedName & | type, |
| uint64_t | offset, | ||
| std::optional< size_t > | maxItems = std::nullopt ) |
Returns a list of references to a specific type field.
- Parameters
-
type QualifiedName of the type offset Offset of the field, relative to the start of the type maxItems Optional maximum number of items to fetch
- Returns
- vector of TypeFieldReferences
◆ GetDataReferencesForTypeField()
| vector< uint64_t > BinaryView::GetDataReferencesForTypeField | ( | const QualifiedName & | type, |
| uint64_t | offset, | ||
| std::optional< size_t > | maxItems = std::nullopt ) |
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
-
type QualifiedName of the type offset Offset of the field, relative to the start of the type maxItems Optional maximum number of items to fetch
- Returns
- List of DataVariable start addresses containing references to the type field
◆ GetDataReferencesFromForTypeField()
| vector< uint64_t > BinaryView::GetDataReferencesFromForTypeField | ( | const QualifiedName & | type, |
| uint64_t | offset, | ||
| std::optional< size_t > | maxItems = std::nullopt ) |
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
-
type QualifiedName of the type offset Offset of the field, relative to the start of the type maxItems Optional maximum number of items to fetch
- Returns
- List of addresses referenced from the type field
◆ GetTypeReferencesForTypeField()
| vector< TypeReferenceSource > BinaryView::GetTypeReferencesForTypeField | ( | const QualifiedName & | type, |
| uint64_t | offset, | ||
| std::optional< size_t > | maxItems = std::nullopt ) |
Returns a list of type references to a specific type field.
- Parameters
-
type QualifiedName of the type offset Offset of the field, relative to the start of the type maxItems Optional maximum number of items to fetch
- Returns
- vector of TypeReferenceSources
◆ GetAllReferencesForType()
Returns a all references to a specific type.
This includes code, data, and type references.
- Parameters
-
type QualifiedName of the type maxItems Optional maximum number of items to fetch
- Returns
- AllTypeReferences structure with all references
◆ GetAllReferencesForTypeField()
Returns a all references to a specific type field.
This includes code, data, and type references.
- Parameters
-
type QualifiedName of the type offset Offset of the field, relative to the start of the type maxItems Optional maximum number of items to fetch
- Returns
- AllTypeFieldReferences structure with all references
◆ GetCodeReferencesForTypeFrom() [1/2]
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
-
src Source of the reference to check
- Returns
- vector of TypeReferenceSources
◆ GetCodeReferencesForTypeFrom() [2/2]
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
-
src Source location to check len Length of the query
- Returns
- vector of TypeReferenceSources
◆ GetCodeReferencesForTypeFieldFrom() [1/2]
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
-
src Source location to check
- Returns
- vector of TypeReferenceSources
◆ GetCodeReferencesForTypeFieldFrom() [2/2]
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
-
src Source location to check len Length 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
-
type Name 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
-
type Name of type to query for references
- Returns
- A map from field offset to the size of the code accesses to it
◆ GetAllTypesReferenced()
Returns a map from field offset to a list of incoming types written to the specified type.
- Parameters
-
type Name 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
-
type Name of type to query for references offset Offset of the field, relative to the start of the type
- Returns
- A list of sizes of accesses to the type
◆ GetTypesReferenced()
Returns a list of types referenced by a particular type field.
- Parameters
-
type Name of type to query for references offset Offset of the field, relative to the start of the type
- Returns
- A list of types referenced
◆ GetOutgoingDirectTypeReferences()
◆ GetOutgoingRecursiveTypeReferences() [1/2]
◆ GetOutgoingRecursiveTypeReferences() [2/2]
| std::unordered_set< QualifiedName > BinaryNinja::BinaryView::GetOutgoingRecursiveTypeReferences | ( | const std::unordered_set< QualifiedName > & | types | ) |
◆ GetIncomingDirectTypeReferences()
◆ GetIncomingRecursiveTypeReferences() [1/2]
◆ GetIncomingRecursiveTypeReferences() [2/2]
| std::unordered_set< QualifiedName > BinaryNinja::BinaryView::GetIncomingRecursiveTypeReferences | ( | const std::unordered_set< QualifiedName > & | types | ) |
◆ CreateStructureBasedOnFieldAccesses()
◆ GetCallees()
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
- Returns
- A list of addresses referencing the ReferenceSource
◆ GetCallers()
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
-
addr Address to check callers for
- Returns
- A list of ReferenceSources calling this address
◆ GetSymbolByAddress()
Returns the Symbol at the provided virtual address.
- Parameters
-
addr Virtual address to query for symbol nameSpace The optional namespace of the symbols to retrieve
- Returns
- The symbol located at that address
◆ GetSymbolByRawName()
Retrieves a Symbol object for the given a raw (mangled) name.
- Parameters
-
name Raw (mangled) name of the symbol nameSpace The optional namespace of the symbols to retrieve
- Returns
- The symbol with that raw name
◆ GetSymbolsByName()
Retrieves a list of symbols with a given name.
- Parameters
-
name Name to search for nameSpace The optional namespace of the symbols to retrieve
- Returns
- List of symbols with that name
◆ GetSymbolsByRawName()
Retrieves the list of all Symbol objects with a given raw name.
- Parameters
-
name RawName to search for nameSpace The optional namespace of the symbols to retrieve
- Returns
- A list of symbols
◆ GetSymbols() [1/2]
Retrieves the list of all Symbol objects.
- Parameters
-
nameSpace The optional namespace of the symbols to retrieve
- Returns
- A list of symbols
◆ GetSymbols() [2/2]
Retrieves a list of symbols in a given range.
- Parameters
-
start Virtual address start of the range len Length of the range nameSpace The optional namespace of the symbols to retrieve
- Returns
- A list of symbols for a given type
◆ GetSymbolsOfType() [1/2]
Retrieves a list of all Symbol objects of the provided symbol type.
- Parameters
-
type The symbol type nameSpace The optional namespace of the symbols to retrieve
- Returns
- A list of symbols for a given type
◆ GetSymbolsOfType() [2/2]
Retrieves a list of all Symbol objects of the provided symbol type in the given range.
- Parameters
-
type The symbol type start Virtual address start of the range len Length of the range nameSpace The optional namespace of the symbols to retrieve
- Returns
- A list of symbols for a given type in the given range
◆ GetVisibleSymbols()
Get the list of visible symbols.
- Parameters
-
nameSpace The optional namespace of the symbols to retrieve
- Returns
- A list of visible symbols
◆ DefineAutoSymbol()
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, the symbol with the highest confidence and lowest `BNSymbolType` value will be used. Ties are broken by symbol name.
- Parameters
◆ DefineAutoSymbolAndVariableOrFunction()
Defines an "Auto" symbol, and a Variable/Function alongside it.
- Warning
- If multiple symbols for the same address are defined, the symbol with the highest confidence and lowest `BNSymbolType` value will be used. Ties are broken by symbol name.
- Parameters
- Returns
- The defined symbol
◆ UndefineAutoSymbol()
Undefine an automatically defined symbol.
- Parameters
-
sym The symbol to undefine
◆ DefineUserSymbol()
Define a user symbol.
- Warning
- If multiple symbols for the same address are defined, the symbol with the highest confidence and lowest `BNSymbolType` value will be used. Ties are broken by symbol name.
- Parameters
◆ UndefineUserSymbol()
◆ DefineImportedFunction()
Defines an imported Function func with a ImportedFunctionSymbol type.
◆ GetDebugInfo()
The current debug info object for this binary view.
- Returns
- The current debug info object for this binary view
◆ ApplyDebugInfo()
Sets the debug info and applies its contents to the current BinaryView.
- Parameters
◆ SetDebugInfo()
Sets the debug info for the current binary view.
- Parameters
-
newDebugInfo Sets 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()
Add a new TagType to this binaryview.
- Parameters
◆ RemoveTagType()
Remove a TagType from this binaryview.
- Parameters
◆ GetTagType() [1/2]
◆ GetTagType() [2/2]
Get a TagType by name and TagType::Type.
- Returns
- The TagType, if it was found
◆ GetTagTypeByName() [1/2]
◆ GetTagTypeByName() [2/2]
| Ref< TagType > BinaryView::GetTagTypeByName | ( | const std::string & | name, |
| TagType::Type | type ) |
◆ GetTagTypeById() [1/2]
◆ GetTagTypeById() [2/2]
Get a TagType by its ID and TagType::Type.
- Returns
- The TagType, if it was found
◆ GetTagTypes()
Get the list of all defined TagTypes.
- Returns
- Get the list of all defined TagTypes
◆ AddTag()
Add a Tag.
- Parameters
-
tag The tag to add user Whether this was added by a user or automatically by analysis
◆ RemoveTag()
Remove a tag.
- Parameters
-
tag The tag to remove user Whether the tag being removed is a user tag
◆ GetTag()
Get a tag by its ID.
- Parameters
- 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()
◆ GetAllTagReferencesOfTypeCount()
◆ GetAllTagReferenceTypeCounts()
◆ GetDataTagReferences()
| std::vector< TagReference > BinaryView::GetDataTagReferences | ( | ) |
◆ GetAutoDataTagReferences()
| std::vector< TagReference > BinaryView::GetAutoDataTagReferences | ( | ) |
◆ GetUserDataTagReferences()
| std::vector< TagReference > BinaryView::GetUserDataTagReferences | ( | ) |
◆ GetDataTags()
◆ GetAutoDataTags()
◆ GetUserDataTags()
◆ GetDataTagsOfType()
◆ 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()
◆ RemoveAutoDataTag()
◆ RemoveAutoDataTagsOfType()
◆ AddUserDataTag()
◆ RemoveUserDataTag()
◆ RemoveUserDataTagsOfType()
◆ 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()
Lookup a component by its GUID.
- Parameters
-
guid GUID of the component to look up
- Returns
- The component with that GUID
◆ GetComponentByPath()
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
-
path Path of the desired component
- Returns
- The component at that path
◆ 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]
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]
Create a component as a subcomponent of the component with a given Guid.
This component will be initialized with the name "Component"
- Parameters
-
parentGUID Guid of the component this component will be added to
- Returns
- The created Component
◆ CreateComponent() [3/3]
Create a component as a subcomponent of a given Component.
This component will be initialized with the name "Component"
- Parameters
- 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
-
name Name to initialize the component with parentGUID Optional Guid of the component this component will be added to
- Returns
- The created Component
◆ CreateComponentWithName() [2/2]
Create a component with a given name and parent.
- Parameters
-
name Name to initialize the component with parentGUID Guid of the component this component will be added to
- Returns
- The created Component
◆ RemoveComponent() [1/2]
Remove a component from the tree entirely.
This will also by nature remove all subcomponents.
- Parameters
- 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
- Returns
- Whether removal was successful
◆ GetFunctionParentComponents()
◆ GetDataVariableParentComponents()
| std::vector< Ref< Component > > BinaryView::GetDataVariableParentComponents | ( | DataVariable | var | ) | const |
◆ CheckForStringAnnotationType()
| std::optional< BNStringType > BinaryView::CheckForStringAnnotationType | ( | uint64_t | addr, |
| std::string & | value, | ||
| bool | allowShortStrings, | ||
| bool | allowLargeStrings, | ||
| size_t | childWidth ) |
Heuristically determine if a string exists at the given address.
This API checks for the following settings: "analysis.unicode.utf8" - default true enables UTF-8 string detection "analysis.unicode.utf16" - default true enables UTF-16 string detection "analysis.unicode.utf32" - default true enables UTF-32 string detection "analysis.unicode.blocks" - selects the Unicode blocks to use for detection
- Parameters
-
addr Address to check value String value to populate allowShortStrings Whether to allow short strings < 4 characters allowLargeStrings If false strings must be less than "rendering.strings.maxAnnotationLength" (default 32) If true strings must be less than "analysis.limits.maxStringLength" (default 16384) childWidth Width of the characters
- Returns
- The type of string annotation found
◆ CanAssemble()
Check whether the given architecture supports assembling instructions.
- Parameters
- 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
-
arch Architecture to check addr Address 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
-
arch Architecture to check addr Address 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
-
arch Architecture to check addr Address 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
-
arch Architecture to check addr Address 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
-
arch Architecture to check addr Address 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
-
arch Architecture of the instruction to convert addr Address 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
-
arch Architecture of the instruction to convert addr Address 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
-
arch Architecture of the instruction to convert addr Address 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
-
arch Architecture of the instruction to convert addr Address of the instruction to be patched value Value 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
-
arch Architecture of the instruction addr Address of the start of the instruction
- Returns
- The length of the instruction
◆ GetStringAtAddress()
Get the string at an address.
- Parameters
-
[in] addr Address of the string [out] strRef Reference to a StringReference the string reference will be writen to.
- Returns
- Whether a string was at th given address
◆ GetStrings() [1/2]
Get the list of strings located within the view.
- Returns
- The list of strings
◆ GetStrings() [2/2]
Get the list of strings located within a range.
- Parameters
-
start Starting virtual address of the range len Length of the range
- Returns
- The list of strings
◆ GetDerivedStrings()
◆ GetDerivedStringCodeReferences()
| vector< ReferenceSource > BinaryView::GetDerivedStringCodeReferences | ( | const DerivedString & | str, |
| std::optional< size_t > | maxItems = std::nullopt ) |
◆ 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
-
callback A function to be called with no parameters when analysis has completed.
- Returns
- An initialized AnalysisCompletionEvent object.
◆ GetAnalysisInfo()
| AnalysisInfo BinaryView::GetAnalysisInfo | ( | ) |
◆ GetAnalysisProgress()
◆ GetAnalysisState()
◆ GetBackgroundAnalysisTask()
◆ GetNextFunctionStartAfterAddress()
| uint64_t BinaryView::GetNextFunctionStartAfterAddress | ( | uint64_t | addr | ) |
Returns the virtual address of the Function that occurs after the virtual address `addr`.
- Parameters
-
addr Address 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
-
addr Address 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
-
addr Address 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
-
addr Address to start searching
- Returns
- address of the next DataVariable
◆ GetPreviousFunctionStartBeforeAddress()
| uint64_t BinaryView::GetPreviousFunctionStartBeforeAddress | ( | uint64_t | addr | ) |
◆ 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
-
addr Address 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
-
addr Address 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
-
addr Address 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
-
addr Address to start searching
- Returns
- The virtual address of the previous DataVariable
◆ ParsePossibleValueSet()
◆ ParseTypeString() [1/2]
| bool BinaryNinja::BinaryView::ParseTypeString | ( | const std::string & | text, |
| QualifiedNameAndType & | result, | ||
| std::string & | errors, | ||
| const std::set< QualifiedName > & | typesAllowRedefinition = {}, | ||
| bool | importDependencies = true ) |
Parse a single type and name from a string containing their definition.
- Parameters
-
[in] text Text containing the type definition [out] result Reference into which the resulting type and name will be written [out] errors Reference to a list into which any parse errors will be written [in] typesAllowRedefinition List of types whose names are allowed to be overwritten (legacy cruft?) [in] importDependencies If Type Library / Type Archive types should be imported during parsing
- Returns
- Whether parsing was successful
◆ ParseTypeString() [2/2]
Parse an entire block of source into types, variables, and functions.
- Parameters
-
[in] text Source code to parse [out] types Reference to a map of QualifiedNames and Types the parsed types will be writen to [out] variables Reference to a list of QualifiedNames and Types the parsed variables will be writen to [out] functions Reference to a list of QualifiedNames and Types the parsed functions will be writen to [out] errors Reference to a list into which any parse errors will be written [in] typesAllowRedefinition List of types whose names are allowed to be overwritten (legacy cruft?) [in] importDependencies If Type Library / Type Archive types should be imported during parsing
- 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 = {}, | ||
| bool | importDependencies = true ) |
Parse an entire block of source into a structure containing types, variables, and functions.
- Parameters
-
[in] text Source code to parse [out] result Reference to a TypeParserResult structure into which types, variables, and functions will be written [out] errors Reference to a list into which any parse errors will be written [in] typesAllowRedefinition List of types whose names are allowed to be overwritten (legacy cruft?) [in] importDependencies If Type Library / Type Archive types should be imported during parsing
- Returns
- Whether parsing was successful
◆ GetTypeContainer()
Type Container for all types (user and auto) in the BinaryView.
Any auto types modified through the Type Container will be converted into user types.
- Returns
- Full view Type Container
◆ GetAutoTypeContainer()
Type Container for ONLY auto types in the BinaryView.
Any changes to types will NOT promote auto types to user types.
- Returns
- Auto types only Type Container
◆ GetUserTypeContainer()
Type Container for ONLY user types in the BinaryView.
◆ GetTypes()
◆ 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()
◆ GetTypeByRef()
◆ GetTypeById()
◆ GetTypeId()
◆ GetTypeNameById()
| QualifiedName BinaryView::GetTypeNameById | ( | const std::string & | id | ) |
◆ IsTypeAutoDefined()
◆ DefineType()
◆ DefineTypes()
◆ DefineUserType()
◆ DefineUserTypes() [1/2]
◆ DefineUserTypes() [2/2]
◆ UndefineType()
| void BinaryView::UndefineType | ( | const std::string & | id | ) |
◆ UndefineUserType()
◆ RenameType()
◆ GetSystemCallType()
◆ GetSystemCallName()
| std::string BinaryView::GetSystemCallName | ( | Platform * | platform, |
| uint32_t | id ) |
◆ RegisterPlatformTypes()
| void BinaryView::RegisterPlatformTypes | ( | Platform * | platform | ) |
◆ LookupImportedTypePlatform()
Gives you details of which platform and name was imported to result in the given type name.
- Parameters
-
name Name 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()
Make the contents of a type library available for type/import resolution.
- Parameters
-
lib library to register with the view
◆ GetTypeLibrary()
| Ref< TypeLibrary > BinaryView::GetTypeLibrary | ( | const std::string & | name | ) |
Get the type library with the given name.
- Parameters
-
name Library name to lookup
- Returns
- The Type Library object, or nullptr if one has not been added with this name
◆ GetTypeLibraries()
Get the list of imported type libraries.
- Returns
- All imported type libraries
◆ ImportTypeLibraryType()
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
- Returns
- A `NamedTypeReference` to the type, taking into account any renaming performed
◆ ImportTypeLibraryObject()
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
- Returns
- The object type, with any interior `NamedTypeReferences` renamed as necessary to be appropriate for the current view
◆ ImportTypeLibraryTypeByGuid()
Recursively imports a type by guid from the current BinaryView's set of type libraries.
This API is dependent on the set of TypeLibraries for the current BinaryView's Platform, having appropriate metadata to resolve the type by guid. The key "type_guids" must contain a map(string(guid), string(type_name)) or map(string(guid), tuple(sting(type_name), string(library_name))).
- Parameters
- Returns
- The type, or nullptr if it was not found
◆ GetTypeNameByGuid()
| std::optional< QualifiedName > BinaryView::GetTypeNameByGuid | ( | const std::string & | guid | ) |
◆ ExportTypeToTypeLibrary()
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
◆ ExportObjectToTypeLibrary()
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
◆ RecordImportedObjectLibrary()
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``.
◆ LookupImportedObjectLibrary()
Gives you details of which type library and name was used to determine the type of a symbol at a given address.
- Parameters
-
tgtPlatform Platform of symbol at import site tgtAddr Address of symbol at import site
- Returns
- A pair with the library and name used, or std::nullopt if it was not imported
◆ LookupImportedTypeLibrary()
Gives you details of which type library and name was imported to result in the given type name.
- Parameters
-
name Name 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
◆ AttachTypeArchive()
| Ref< TypeArchive > BinaryView::AttachTypeArchive | ( | const std::string & | id, |
| const std::string & | path ) |
Attach a given type archive to the binary view.
No types will actually be associated by calling this, just they will become available.
- Parameters
-
id Expected id of archive path Path to archive
◆ DetachTypeArchive()
| void BinaryView::DetachTypeArchive | ( | const std::string & | id | ) |
Detach from a type archive, breaking all associations to types with the archive.
- Parameters
-
id Id of archive to detach
◆ GetTypeArchive()
| Ref< TypeArchive > BinaryView::GetTypeArchive | ( | const std::string & | id | ) | const |
Look up a connected archive by its id.
- Parameters
- Returns
- Archive, if one exists with that id. Otherwise nullptr
◆ GetTypeArchives()
| std::unordered_map< std::string, std::string > BinaryView::GetTypeArchives | ( | ) | const |
Get all attached type archives.
- Returns
- All attached archive (id, path) pairs
◆ GetTypeArchivePath()
| std::optional< std::string > BinaryView::GetTypeArchivePath | ( | const std::string & | id | ) | const |
Look up the path for an attached (but not necessarily connected) type archive by its id.
- Parameters
- Returns
- Archive path, if it is attached. Otherwise nullopt.
◆ GetTypeArchiveTypeNames()
| std::unordered_map< QualifiedName, std::map< std::string, std::string > > BinaryView::GetTypeArchiveTypeNames | ( | ) | const |
Get a list of all available type names in all connected archives, and their archive/type id pair.
- Returns
- All type names in a map
◆ GetAssociatedTypeArchiveTypes()
| std::unordered_map< std::string, std::pair< std::string, std::string > > BinaryView::GetAssociatedTypeArchiveTypes | ( | ) | const |
Get a list of all types in the analysis that are associated with a specific type archive.
- Returns
- Map of all analysis types to their corresponding archive id
◆ GetAssociatedTypesFromArchive()
| std::unordered_map< std::string, std::string > BinaryView::GetAssociatedTypesFromArchive | ( | const std::string & | archive | ) | const |
Get a list of all types in the analysis that are associated with a specific type archive.
- Returns
- Map of all analysis types to their corresponding archive id
◆ GetAssociatedTypeArchiveTypeTarget()
| std::optional< std::pair< std::string, std::string > > BinaryView::GetAssociatedTypeArchiveTypeTarget | ( | const std::string & | id | ) | const |
Determine the target archive / type id of a given analysis type.
- Parameters
- Returns
- Pair of archive id and archive type id, if this type is associated. std::nullopt otherwise.
◆ GetAssociatedTypeArchiveTypeSource()
| std::optional< std::string > BinaryView::GetAssociatedTypeArchiveTypeSource | ( | const std::string & | archiveId, |
| const std::string & | archiveTypeId ) const |
Determine the local source type for a given archive type.
- Parameters
-
archiveId Id of target archive archiveTypeId Id of target archive type
- Returns
- Id of source analysis type, if this type is associated. std::nullopt otherwise.
◆ GetTypeArchiveSyncStatus()
| BNSyncStatus BinaryView::GetTypeArchiveSyncStatus | ( | const std::string & | typeId | ) | const |
Get the current status of any changes pending in a given type.
- Parameters
- Returns
- Status of type
◆ DisassociateTypeArchiveType()
| bool BinaryView::DisassociateTypeArchiveType | ( | const std::string & | typeId | ) |
Disassociate an associated type, so that it will no longer receive updates from its connected type archive.
- Parameters
-
typeId Id of type in analysis
- Returns
- True if successful
◆ PullTypeArchiveTypes()
| bool BinaryView::PullTypeArchiveTypes | ( | const std::string & | archiveId, |
| const std::unordered_set< std::string > & | archiveTypeIds, | ||
| std::unordered_map< std::string, std::string > & | updatedTypes ) |
Pull a collection of types from a type archive, associating with them and any dependencies.
- Parameters
-
[in] archiveId Id of archive [in] archiveTypeIds Ids of desired types [out] updatedTypes List of types that were updated
- Returns
- True if successful
◆ PushTypeArchiveTypes()
| bool BinaryView::PushTypeArchiveTypes | ( | const std::string & | archiveId, |
| const std::unordered_set< std::string > & | typeIds, | ||
| std::unordered_map< std::string, std::string > & | updatedTypes ) |
Push a collection of types, and all their dependencies, into a type archive.
- Parameters
-
[in] archiveId Id of archive [in] typeIds List of ids of types in analysis [out] updatedTypes List of types that were updated
- Returns
- True if successful
◆ FindNextData() [1/2]
◆ FindNextText() [1/2]
◆ FindNextConstant() [1/2]
◆ FindNextData() [2/2]
◆ FindNextText() [2/2]
◆ FindNextConstant() [2/2]
◆ FindAllData()
◆ FindAllText()
◆ FindAllConstant()
◆ DetectSearchMode()
| string BinaryView::DetectSearchMode | ( | const std::string & | query | ) |
◆ Search()
| bool BinaryView::Search | ( | const std::string & | query, |
| const ProgressFunction & | progressCallback, | ||
| const std::function< bool(uint64_t addr, const DataBuffer &buffer)> & | matchCallback ) |
◆ Reanalyze()
| void BinaryView::Reanalyze | ( | ) |
◆ GetWorkflow()
◆ 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
-
title Title for the report contents Contents 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
-
title Title for the report contents Markdown contents of the report plainText Plaintext 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
-
title Title for the report contents HTML contents of the report plainText Plaintext 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
-
title Title for the report graph FlowGraph 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] result Reference to the uint64_t the result will be copied to [in] prompt Prompt for the input [in] title Title 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] result Reference to the uint64_t the result will be copied to [in] prompt Prompt for the input [in] title Title for the input popup when used in UI [in] currentAddress Address to use for relative inputs
- Returns
- Whether an integer was successfully received
◆ GetMemoryMap()
|
inline |
A mock object that is a placeholder during development of this feature.
- Returns
- MemoryMap object
◆ BeginBulkAddSegments()
| void BinaryView::BeginBulkAddSegments | ( | ) |
Begin a bulk segment addition operation.
This function prepares the `BinaryView` for bulk addition of both auto and user-defined segments. During the bulk operation, segments can be added using `AddAutoSegment`, `AddAutoSegments`, `AddUserSegment`, or `AddUserSegments` without immediately triggering the MemoryMap update process. The queued segments will not take effect until `EndBulkAddSegments` is called.
◆ EndBulkAddSegments()
| void BinaryView::EndBulkAddSegments | ( | ) |
Finalize and apply all queued segments (auto and user) added during a bulk segment addition operation.
This function commits all segments that were queued since the last call to `BeginBulkAddSegments`. The MemoryMap update process is executed at this point, applying all changes in one batch for improved performance.
- Note
- This function must be called after `BeginBulkAddSegments` to apply the queued segments.
◆ CancelBulkAddSegments()
| void BinaryView::CancelBulkAddSegments | ( | ) |
Cancel a bulk segment addition operation.
This function discards all auto and user segments that were queued since the last call to `BeginBulkAddSegments` without applying them. It allows you to abandon the changes in case they are no longer needed.
- Note
- If no bulk operation is in progress, calling this function has no effect.
◆ 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.
Note that the segment added may have different size attributes than requested
- Parameters
-
start Starting virtual address length Length within the virtual address space dataOffset Data offset in the raw file dataLength Length of the data to map from the raw file flags Segment r/w/x flags
◆ AddAutoSegments()
| void BinaryView::AddAutoSegments | ( | const std::vector< BNSegmentInfo > & | segments | ) |
Add analysis segments that specify how data from the raw file is mapped into a virtual address space.
- Parameters
-
segments Segments to add to the BinaryView
Note that the segments added may have different size attributes than requested
◆ 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
-
start Virtual address of the start of the segment length Length 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
-
start Starting virtual address length Length within the virtual address space dataOffset Data offset in the raw file dataLength Length of the data to map from the raw file flags Segment r/w/x flags
◆ AddUserSegments()
| void BinaryView::AddUserSegments | ( | const std::vector< BNSegmentInfo > & | segments | ) |
Creates user-defined segments that specify how data from the raw file is mapped into a virtual address space.
- Parameters
-
segments Segments to add to the BinaryView
◆ RemoveUserSegment()
| void BinaryView::RemoveUserSegment | ( | uint64_t | start, |
| uint64_t | length ) |
Removes a user-defined segment from th current segment mapping.
- Parameters
-
start Virtual address of the start of the segment length Length of the segment
◆ GetSegments()
Get the list of registered Segments.
- Returns
- The list of registered Segments
◆ GetSegmentAt()
◆ 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] offset Raw file offset [out] addr Reference to a uint64_t the address will be written to
- Returns
- Whether an address was successfully mapped
◆ GetDataOffsetForAddress()
| bool BinaryView::GetDataOffsetForAddress | ( | uint64_t | addr, |
| uint64_t & | offset ) |
◆ 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
-
name Name of the section start Virtual address of the start of the section length Length of the section semantics SectionSemantics of the section type Optional type of the section align Optional byte alignment entrySize Entry Size of the section linkedSection Optional namee of a linked section infoSection Optional name of an associated informational section infoData Optional Info Data
◆ RemoveAutoSection()
| void BinaryView::RemoveAutoSection | ( | const std::string & | name | ) |
Remove an automatically defined section by name.
- Parameters
◆ 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
-
name Name of the section start Virtual address of the start of the section length Length of the section semantics SectionSemantics of the section type Optional type of the section align Optional byte alignment entrySize Entry Size of the section linkedSection Optional namee of a linked section infoSection Optional name of an associated informational section infoData Optional Info Data
◆ RemoveUserSection()
| void BinaryView::RemoveUserSection | ( | const std::string & | name | ) |
Remove a user defined section by name.
- Parameters
-
name Name of the section to remove
◆ GetSections()
Get the list of defined sections.
- Returns
- The list of defined sections
◆ GetSectionsAt()
Get the list of sections containing addr.
- Parameters
- Returns
- List of sections containing
addr
◆ GetSectionByName()
◆ 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"});
- Parameters
- Returns
- List of unique names
◆ GetAllocatedRanges()
Get the list of allocated ranges.
- Deprecated
- This API has been deprecated in favor of GetMappedAddressRanges in 4.1.5902
- Returns
- The list of allocated ranges
◆ GetMappedAddressRanges()
Get the list of ranges mapped into the address space.
- Returns
- The list of mapped ranges
◆ GetBackedAddressRanges()
Get the list of ranges that are mapped into the address space and are backed by a target object.
- Returns
- The list of backed ranges
◆ GetCommentForAddress()
| string BinaryView::GetCommentForAddress | ( | uint64_t | addr | ) | const |
Get the comment placed at an address.
- Parameters
-
addr Address 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
-
addr Address at which to place a comment comment Comment to place
◆ StoreMetadata()
| void BinaryView::StoreMetadata | ( | const std::string & | key, |
| Ref< Metadata > | value, | ||
| bool | isAuto = false ) |
◆ QueryMetadata()
◆ RemoveMetadata()
| void BinaryView::RemoveMetadata | ( | const std::string & | key | ) |
◆ GetMetadata()
◆ GetAutoMetadata()
◆ 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()
◆ SetLoadSettings()
◆ GetParametersForAnalysis()
◆ SetParametersForAnalysis()
◆ GetMaxFunctionSizeForAnalysis()
| uint64_t BinaryView::GetMaxFunctionSizeForAnalysis | ( | ) |
◆ SetMaxFunctionSizeForAnalysis()
| void BinaryView::SetMaxFunctionSizeForAnalysis | ( | uint64_t | size | ) |
◆ GetNewAutoFunctionAnalysisSuppressed()
| bool BinaryView::GetNewAutoFunctionAnalysisSuppressed | ( | ) |
◆ SetNewAutoFunctionAnalysisSuppressed()
| void BinaryView::SetNewAutoFunctionAnalysisSuppressed | ( | bool | suppress | ) |
◆ ShouldSkipTargetAnalysis()
Determine whether the target analysis should be skipped for a given source function and target address.
- Parameters
-
source Source function and address sourceFunc Function at the source address sourceEnd End address of the source function target Target address to analyze
- Returns
- Whether the target analysis should be skipped
◆ 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()
|
static |
Internal namespace for the current BinaryView.
- Returns
- Internal namespace for the current BinaryView
◆ GetExternalNameSpace()
|
static |
External namespace for the current BinaryView.
- Returns
- External namespace for the current BinaryView
◆ ParseExpression()
|
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] view View object for relative selections [in] expression Expression to parse [out] offset Parsed expression [in] here The location for $here [out] errorString Any 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()
◆ CreateStructureMemberFromAccess()
◆ CreateLogger()
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
- 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
-
name Name for the magic value to add or update value Value 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
-
name Name for the magic value to remove value Value 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
-
name Names for the magic values to add or update value Values 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
-
name Names 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] name Name for the magic value to query [out] value Value for the magic value
- Returns
- Whether the magic value exists
◆ AddExternalLibrary()
◆ RemoveExternalLibrary()
| void BinaryView::RemoveExternalLibrary | ( | const std::string & | name | ) |
◆ GetExternalLibrary()
◆ GetExternalLibraries()
◆ AddExternalLocation()
◆ RemoveExternalLocation()
◆ GetExternalLocation()
◆ GetExternalLocations()
◆ GetGlobalPointerValue()
◆ UserGlobalPointerValueSet()
| bool BinaryView::UserGlobalPointerValueSet | ( | ) | const |
◆ ClearUserGlobalPointerValue()
| void BinaryView::ClearUserGlobalPointerValue | ( | ) |
◆ SetUserGlobalPointerValue()
◆ StringifyUnicodeData()
| optional< pair< string, BNStringType > > BinaryView::StringifyUnicodeData | ( | Architecture * | arch, |
| const DataBuffer & | buffer, | ||
| bool | nullTerminates = true, | ||
| bool | allowShortStrings = false ) |
◆ m_file
◆ BinaryNinja::Relocation
class BinaryNinja::Relocation
◆ 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 | |
| void | NotifyDataWritten (uint64_t offset, size_t len) |
| void | NotifyDataInserted (uint64_t offset, size_t len) |
| void | NotifyDataRemoved (uint64_t offset, uint64_t len) |
| BinaryView (BNBinaryView *view) | |
| virtual bool | Init () |
| FileMetadata * | GetFile () const |
| Ref< BinaryView > | GetParentView () 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. | |
| bool | CreateDatabase (const std::string &path, const ProgressFunction &progressCallback, Ref< SaveSettings > settings=new SaveSettings()) |
| Writes the current database (.bndb) out to the specified file. | |
| bool | SaveAutoSnapshot (Ref< SaveSettings > settings=new SaveSettings()) |
| bool | SaveAutoSnapshot (const ProgressFunction &progressCallback, Ref< SaveSettings > settings=new SaveSettings()) |
| bool | RunUndoableTransaction (std::function< bool()> func) |
| Run a function in a context in which any changes made to analysis will be added to an undo state. | |
| std::string | BeginUndoActions (bool anonymousAllowed=true) |
| Start recording actions taken so they can be undone at some point. | |
| void | CommitUndoActions (const std::string &id) |
| Commit the actions taken since a call to BeginUndoActions. | |
| void | RevertUndoActions (const std::string &id) |
| Revert the actions taken since a call to BeginUndoActions. | |
| void | ForgetUndoActions (const std::string &id) |
| Forget the actions taken since a call to BeginUndoActions. | |
| bool | CanUndo () |
| bool | Undo () |
| Undo the last committed action in the undo database. | |
| bool | CanRedo () |
| bool | Redo () |
| Redo the last committed action in the undo database. | |
| std::string | GetCurrentView () |
| Get the current View name, e.g. | |
| uint64_t | GetCurrentOffset () |
| Get the current offset in the current view. | |
| bool | Navigate (const std::string &view, uint64_t offset) |
| Navigate to the specified virtual address in the specified view. | |
| size_t | Read (void *dest, uint64_t offset, size_t len) |
| Read writes `len` bytes at virtual address `offset` to address `dest`. | |
| DataBuffer | ReadBuffer (uint64_t offset, size_t len) |
| ReadBuffer reads len bytes from a virtual address into a DataBuffer. | |
| const uint8_t * | GetDataPointer () const |
| GetDataPointer returns a pointer to the underlying data for zero-copy access. | |
| size_t | GetDataLength () const |
| GetDataLength returns the length of the underlying data. | |
| size_t | Write (uint64_t offset, const void *data, size_t len) |
| Write writes `len` bytes data at address `dest` to virtual address `offset`. | |
| size_t | WriteBuffer (uint64_t offset, const DataBuffer &data) |
| WriteBuffer writes the contents of a DataBuffer into a virtual address. | |
| 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`. | |
| size_t | InsertBuffer (uint64_t offset, const DataBuffer &data) |
| InsertBuffer inserts the contents of a DataBuffer starting from a virtual address. | |
| size_t | Remove (uint64_t offset, uint64_t len) |
| PerformRemove removes `len` bytes from virtual address `offset`. | |
| 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. | |
| std::vector< BNModificationStatus > | GetModification (uint64_t offset, size_t len) |
| bool | IsValidOffset (uint64_t offset) const |
| IsValidOffset checks whether a virtual address `offset` is valid. | |
| bool | IsOffsetReadable (uint64_t offset) const |
| IsOffsetReadable checks whether a virtual address is readable. | |
| bool | IsOffsetWritable (uint64_t offset) const |
| IsOffsetWritable checks whether a virtual address is writable. | |
| bool | IsOffsetExecutable (uint64_t offset) const |
| IsOffsetExecutable checks whether a virtual address is executable. | |
| bool | IsOffsetBackedByFile (uint64_t offset) const |
| IsOffsetBackedByFile checks whether a virtual address is backed by a file. | |
| 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`. | |
| uint64_t | GetImageBase () const |
| GetImageBase queries for the image base in the BinaryView. | |
| uint64_t | GetOriginalImageBase () const |
| GetOriginalImageBase queries for the original image base in the BinaryView, unaffected by any rebasing operations. | |
| void | SetOriginalImageBase (uint64_t imageBase) |
| SetOriginalBase sets the original image base in the BinaryView, unaffected by any rebasing operations. | |
| uint64_t | GetOriginalBase () const |
| GetOriginalBase queries for the original image base in the BinaryView, unaffected by any rebasing operations. | |
| void | SetOriginalBase (uint64_t base) |
| SetOriginalBase sets the original image base in the BinaryView, unaffected by any rebasing operations. | |
| uint64_t | GetStart () const |
| GetStart queries for the first valid virtual address in the BinaryView. | |
| uint64_t | GetEnd () const |
| GetEnd queries for the end virtual address of the BinaryView. | |
| uint64_t | GetLength () const |
| GetLength queries for the total length of the BinaryView from start to end. | |
| uint64_t | GetEntryPoint () const |
| GetEntryPoint returns the entry point of the executable in the BinaryView. | |
| Ref< Architecture > | GetDefaultArchitecture () const |
| GetDefaultArchitecture returns the current "default architecture" for the BinaryView. | |
| void | SetDefaultArchitecture (Architecture *arch) |
| SetDefaultArchitecture allows setting the default architecture for the BinaryView. | |
| Ref< Platform > | GetDefaultPlatform () const |
| GetDefaultPlatform returns the current default platform for the BinaryView. | |
| void | SetDefaultPlatform (Platform *platform) |
| SetDefaultPlatform allows setting the default platform for the BinaryView. | |
| BNEndianness | GetDefaultEndianness () const |
| GetDefaultEndianness returns the default endianness for the BinaryView. | |
| bool | IsRelocatable () const |
| Whether the binary is relocatable. | |
| size_t | GetAddressSize () const |
| Address size of the binary. | |
| bool | IsExecutable () const |
| Whether the binary is an executable. | |
| bool | Save (FileAccessor *file) |
| Save the original binary file to a FileAccessor. | |
| bool | Save (const std::string &path) |
| Save the original binary file to the provided destination. | |
| bool | FinalizeNewSegments () |
| Performs "finalization" on segments added after initial Finalization (performed after an Init() has completed). | |
| 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 |
| std::vector< std::pair< uint64_t, uint64_t > > | GetRelocationRangesInRange (uint64_t addr, size_t size) const |
| bool | RangeContainsRelocation (uint64_t addr, size_t size) const |
| std::vector< Ref< Relocation > > | GetRelocationsAt (uint64_t addr) const |
| void | RegisterNotification (BinaryDataNotification *notify) |
| Provides a mechanism for receiving callbacks for various analysis events. | |
| void | UnregisterNotification (BinaryDataNotification *notify) |
| Unregister a notification passed to RegisterNotification. | |
| void | AddAnalysisOption (const std::string &name) |
| Adds an analysis option. | |
| Ref< Function > | AddFunctionForAnalysis (Platform *platform, uint64_t addr, bool autoDiscovered=false, Type *type=nullptr) |
| Add a new function of the given platform at the virtual address. | |
| void | AddEntryPointForAnalysis (Platform *platform, uint64_t start) |
| adds an virtual address to start analysis from for a given platform | |
| void | AddToEntryFunctions (Function *func) |
| adds an function to all entry function list | |
| void | RemoveAnalysisFunction (Function *func, bool updateRefs=false) |
| removes a function from the list of functions | |
| Ref< Function > | CreateUserFunction (Platform *platform, uint64_t start) |
| Add a new user function of the given platform at the virtual address. | |
| void | RemoveUserFunction (Function *func) |
| removes a user function from the list of functions | |
| bool | HasInitialAnalysis () |
| check for the presence of an initial analysis in this BinaryView. | |
| void | SetAnalysisHold (bool enable) |
| Controls the analysis hold for this BinaryView. | |
| bool | GetFunctionAnalysisUpdateDisabled () |
| void | SetFunctionAnalysisUpdateDisabled (bool disabled) |
| void | UpdateAnalysisAndWait () |
| start the analysis running and dont return till it is complete | |
| void | UpdateAnalysis () |
| asynchronously starts the analysis running and returns immediately. | |
| void | AbortAnalysis () |
| Abort analysis and suspend the workflow machine. | |
| bool | AnalysisIsAborted () const |
| Check whether analysis is currently running. | |
| void | DefineDataVariable (uint64_t addr, const Confidence< Ref< Type > > &type) |
| Define a DataVariable at a given address with a set type. | |
| void | DefineUserDataVariable (uint64_t addr, const Confidence< Ref< Type > > &type) |
| Define a user DataVariable at a given address with a set type. | |
| void | UndefineDataVariable (uint64_t addr, bool blacklist=true) |
| Undefine a DataVariable at a given address. | |
| void | UndefineUserDataVariable (uint64_t addr) |
| Undefine a user DataVariable at a given address. | |
| std::map< uint64_t, DataVariable > | GetDataVariables () |
| Get a map of DataVariables defined in the current BinaryView. | |
| bool | GetDataVariableAtAddress (uint64_t addr, DataVariable &var) |
| Get a DataVariable at a given address. | |
| std::vector< Ref< Function > > | GetAnalysisFunctionList () |
| Get a list of functions within this BinaryView. | |
| bool | HasFunctions () const |
| Check whether the BinaryView has any functions defined. | |
| Ref< Function > | GetAnalysisFunction (Platform *platform, uint64_t addr) |
| Gets a function object for the function starting at a virtual address. | |
| Ref< Function > | GetRecentAnalysisFunctionForAddress (uint64_t addr) |
| Get the most recently used Function starting at a virtual address. | |
| std::vector< Ref< Function > > | GetAnalysisFunctionsForAddress (uint64_t addr) |
| Get a list of functions defined at an address. | |
| std::vector< Ref< Function > > | GetAnalysisFunctionsContainingAddress (uint64_t addr) |
| Get a list of functions containing an address. | |
| Ref< Function > | GetAnalysisEntryPoint () |
| Get the function defined as the Analysis entry point for the view. | |
| std::vector< Ref< Function > > | GetAllEntryFunctions () |
| Get all entry functions (including user-defined ones). | |
| Ref< BasicBlock > | GetRecentBasicBlockForAddress (uint64_t addr) |
| Get most recently used Basic Block containing a virtual address. | |
| std::vector< Ref< BasicBlock > > | GetBasicBlocksForAddress (uint64_t addr) |
| Get a list of Basic Blocks containing a virtual address. | |
| std::vector< Ref< BasicBlock > > | GetBasicBlocksStartingAtAddress (uint64_t addr) |
| Get a list of basic blocks starting at a virtual address. | |
| std::vector< ReferenceSource > | GetCodeReferences (uint64_t addr) |
| Get a list of references made from code (instructions) to a virtual address. | |
| std::vector< ReferenceSource > | GetCodeReferences (uint64_t addr, uint64_t len) |
| Get a list of references from code (instructions) to a range of addresses. | |
| std::vector< ReferenceSource > | GetCodeReferencesWithLimit (uint64_t addr, std::optional< size_t > maxItems=std::nullopt) |
| Get a list of references made from code (instructions) to a virtual address. | |
| std::vector< ReferenceSource > | GetCodeReferencesInRangeWithLimit (uint64_t addr, uint64_t len, std::optional< size_t > maxItems=std::nullopt) |
| Get a list of references from code (instructions) to a range of addresses. | |
| std::vector< uint64_t > | GetCodeReferencesFrom (ReferenceSource src) |
| Get code references made by a particular "ReferenceSource". | |
| std::vector< uint64_t > | GetCodeReferencesFrom (ReferenceSource src, uint64_t len) |
| Get code references from a range of addresses. | |
| std::vector< uint64_t > | GetDataReferences (uint64_t addr) |
| Get references made by data ('DataVariables') to a virtual address. | |
| 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. | |
| std::vector< uint64_t > | GetDataReferencesWithLimit (uint64_t addr, std::optional< size_t > maxItems=std::nullopt) |
| Get references made by data ('DataVariables') to a virtual address. | |
| std::vector< uint64_t > | GetDataReferencesInRangeWithLimit (uint64_t addr, uint64_t len, std::optional< size_t > maxItems=std::nullopt) |
| Get references made by data ('DataVariables') in a given range, to a virtual address. | |
| std::vector< uint64_t > | GetDataReferencesFrom (uint64_t addr) |
| Get references made by data ('DataVariables') located at a virtual address. | |
| std::vector< uint64_t > | GetDataReferencesFrom (uint64_t addr, uint64_t len) |
| Get references made by data ('DataVariables') located in a range of virtual addresses. | |
| void | AddDataReference (uint64_t fromAddr, uint64_t toAddr) |
| Add an auto Data Reference from a virtual address to another virtual address. | |
| void | RemoveDataReference (uint64_t fromAddr, uint64_t toAddr) |
| Remove an auto Data Reference from a virtual address to another virtual address. | |
| void | AddUserDataReference (uint64_t fromAddr, uint64_t toAddr) |
| Add a user Data Reference from a virtual address to another virtual address. | |
| void | RemoveUserDataReference (uint64_t fromAddr, uint64_t toAddr) |
| Remove a user Data Reference from a virtual address to another virtual address. | |
| std::vector< ReferenceSource > | GetCodeReferencesForType (const QualifiedName &type, std::optional< size_t > maxItems=std::nullopt) |
| Get code references to a Type. | |
| std::vector< uint64_t > | GetDataReferencesForType (const QualifiedName &type, std::optional< size_t > maxItems=std::nullopt) |
| Get data references to a Type. | |
| std::vector< TypeReferenceSource > | GetTypeReferencesForType (const QualifiedName &type, std::optional< size_t > maxItems=std::nullopt) |
| Get Type references to a Type. | |
| std::vector< TypeFieldReference > | GetCodeReferencesForTypeField (const QualifiedName &type, uint64_t offset, std::optional< size_t > maxItems=std::nullopt) |
| Returns a list of references to a specific type field. | |
| std::vector< uint64_t > | GetDataReferencesForTypeField (const QualifiedName &type, uint64_t offset, std::optional< size_t > maxItems=std::nullopt) |
Returns a list of virtual addresses of data which references the type type . | |
| std::vector< uint64_t > | GetDataReferencesFromForTypeField (const QualifiedName &type, uint64_t offset, std::optional< size_t > maxItems=std::nullopt) |
Returns a list of virtual addresses of data which are referenced from the type type . | |
| std::vector< TypeReferenceSource > | GetTypeReferencesForTypeField (const QualifiedName &type, uint64_t offset, std::optional< size_t > maxItems=std::nullopt) |
| Returns a list of type references to a specific type field. | |
| AllTypeReferences | GetAllReferencesForType (const QualifiedName &type, std::optional< size_t > maxItems=std::nullopt) |
| Returns a all references to a specific type. | |
| AllTypeFieldReferences | GetAllReferencesForTypeField (const QualifiedName &type, uint64_t offset, std::optional< size_t > maxItems=std::nullopt) |
| Returns a all references to a specific type field. | |
| std::vector< TypeReferenceSource > | GetCodeReferencesForTypeFrom (ReferenceSource src) |
Returns a list of types referenced by code at ReferenceSource src. | |
| std::vector< TypeReferenceSource > | GetCodeReferencesForTypeFrom (ReferenceSource src, uint64_t len) |
Returns a list of types referenced by code at ReferenceSource src. | |
| std::vector< TypeReferenceSource > | GetCodeReferencesForTypeFieldFrom (ReferenceSource src) |
Returns a list of type fields referenced by code at ReferenceSource src. | |
| std::vector< TypeReferenceSource > | GetCodeReferencesForTypeFieldFrom (ReferenceSource src, uint64_t len) |
Returns a list of type fields referenced by code at ReferenceSource src. | |
| std::vector< uint64_t > | GetAllFieldsReferenced (const QualifiedName &type) |
| Returns a list of offsets in the QualifiedName specified by name, which are referenced by code. | |
| 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. | |
| 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. | |
| std::vector< size_t > | GetSizesReferenced (const QualifiedName &type, uint64_t offset) |
| Returns a list of types related to the type field access. | |
| std::vector< Confidence< Ref< Type > > > | GetTypesReferenced (const QualifiedName &type, uint64_t offset) |
| Returns a list of types referenced by a particular type field. | |
| std::unordered_set< QualifiedName > | GetOutgoingDirectTypeReferences (const QualifiedName &type) |
| std::unordered_set< QualifiedName > | GetOutgoingRecursiveTypeReferences (const QualifiedName &type) |
| std::unordered_set< QualifiedName > | GetOutgoingRecursiveTypeReferences (const std::unordered_set< QualifiedName > &types) |
| std::unordered_set< QualifiedName > | GetIncomingDirectTypeReferences (const QualifiedName &type) |
| std::unordered_set< QualifiedName > | GetIncomingRecursiveTypeReferences (const QualifiedName &type) |
| std::unordered_set< QualifiedName > | GetIncomingRecursiveTypeReferences (const std::unordered_set< QualifiedName > &types) |
| Ref< Structure > | CreateStructureBasedOnFieldAccesses (const QualifiedName &type) |
| std::vector< uint64_t > | GetCallees (ReferenceSource addr) |
| Returns a list of virtual addresses called by the call site in the ReferenceSource. | |
| std::vector< ReferenceSource > | GetCallers (uint64_t addr) |
| Returns a list of ReferenceSource objects (xrefs or cross-references) that call the provided virtual address. | |
| Ref< Symbol > | GetSymbolByAddress (uint64_t addr, const NameSpace &nameSpace=NameSpace()) |
| Returns the Symbol at the provided virtual address. | |
| Ref< Symbol > | GetSymbolByRawName (const std::string &name, const NameSpace &nameSpace=NameSpace()) |
| Retrieves a Symbol object for the given a raw (mangled) name. | |
| std::vector< Ref< Symbol > > | GetSymbolsByName (const std::string &name, const NameSpace &nameSpace=NameSpace()) |
| Retrieves a list of symbols with a given name. | |
| 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. | |
| std::vector< Ref< Symbol > > | GetSymbols (const NameSpace &nameSpace=NameSpace()) |
| Retrieves the list of all Symbol objects. | |
| std::vector< Ref< Symbol > > | GetSymbols (uint64_t start, uint64_t len, const NameSpace &nameSpace=NameSpace()) |
| Retrieves a list of symbols in a given range. | |
| std::vector< Ref< Symbol > > | GetSymbolsOfType (BNSymbolType type, const NameSpace &nameSpace=NameSpace()) |
| Retrieves a list of all Symbol objects of the provided symbol type. | |
| 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. | |
| std::vector< Ref< Symbol > > | GetVisibleSymbols (const NameSpace &nameSpace=NameSpace()) |
| Get the list of visible symbols. | |
| void | DefineAutoSymbol (Ref< Symbol > sym) |
| Adds a symbol to the internal list of automatically discovered Symbol objects in a given namespace. | |
| Ref< Symbol > | DefineAutoSymbolAndVariableOrFunction (Ref< Platform > platform, Ref< Symbol > sym, const Confidence< Ref< Type > > &type) |
| Defines an "Auto" symbol, and a Variable/Function alongside it. | |
| void | UndefineAutoSymbol (Ref< Symbol > sym) |
| Undefine an automatically defined symbol. | |
| void | DefineUserSymbol (Ref< Symbol > sym) |
| Define a user symbol. | |
| void | UndefineUserSymbol (Ref< Symbol > sym) |
| Undefine a user symbol. | |
| void | DefineImportedFunction (Ref< Symbol > importAddressSym, Ref< Function > func, Ref< Type > type=nullptr) |
Defines an imported Function func with a ImportedFunctionSymbol type. | |
| Ref< DebugInfo > | GetDebugInfo () |
| The current debug info object for this binary view. | |
| void | ApplyDebugInfo (Ref< DebugInfo > newDebugInfo) |
| Sets the debug info and applies its contents to the current BinaryView. | |
| void | SetDebugInfo (Ref< DebugInfo > newDebugInfo) |
| Sets the debug info for the current binary view. | |
| bool | IsApplyingDebugInfo () const |
| Determine is a debug info object is currently being applied. | |
| void | BeginBulkModifySymbols () |
| void | EndBulkModifySymbols () |
| void | AddTagType (Ref< TagType > tagType) |
| Add a new TagType to this binaryview. | |
| void | RemoveTagType (Ref< TagType > tagType) |
| Remove a TagType from this binaryview. | |
| Ref< TagType > | GetTagType (const std::string &name) |
| Get a TagType by name. | |
| Ref< TagType > | GetTagType (const std::string &name, TagType::Type type) |
| Get a TagType by name and TagType::Type. | |
| Ref< TagType > | GetTagTypeByName (const std::string &name) |
| Get a TagType by name. | |
| Ref< TagType > | GetTagTypeByName (const std::string &name, TagType::Type type) |
| Get a TagType by name and TagType::Type. | |
| Ref< TagType > | GetTagTypeById (const std::string &id) |
| Get a TagType by its ID. | |
| Ref< TagType > | GetTagTypeById (const std::string &id, TagType::Type type) |
| Get a TagType by its ID and TagType::Type. | |
| std::vector< Ref< TagType > > | GetTagTypes () |
| Get the list of all defined TagTypes. | |
| void | AddTag (Ref< Tag > tag, bool user=false) |
| Add a Tag. | |
| void | RemoveTag (Ref< Tag > tag, bool user=false) |
| Remove a tag. | |
| Ref< Tag > | GetTag (const std::string &tagId) |
| Get a tag by its ID. | |
| std::vector< TagReference > | GetAllTagReferences () |
| std::vector< TagReference > | GetAllAddressTagReferences () |
| std::vector< TagReference > | GetAllFunctionTagReferences () |
| std::vector< TagReference > | GetAllTagReferencesOfType (Ref< TagType > tagType) |
| std::vector< TagReference > | GetTagReferencesOfType (Ref< TagType > tagType) |
| size_t | GetTagReferencesOfTypeCount (Ref< TagType > tagType) |
| size_t | GetAllTagReferencesOfTypeCount (Ref< TagType > tagType) |
| std::map< Ref< TagType >, size_t > | GetAllTagReferenceTypeCounts () |
| std::vector< TagReference > | GetDataTagReferences () |
| std::vector< TagReference > | GetAutoDataTagReferences () |
| std::vector< TagReference > | GetUserDataTagReferences () |
| 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< TagReference > | GetDataTagsInRange (uint64_t start, uint64_t end) |
| std::vector< TagReference > | GetAutoDataTagsInRange (uint64_t start, uint64_t end) |
| std::vector< TagReference > | GetUserDataTagsInRange (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< Tag > | CreateAutoDataTag (uint64_t addr, const std::string &tagTypeName, const std::string &data, bool unique=false) |
| Ref< Tag > | CreateUserDataTag (uint64_t addr, const std::string &tagTypeName, const std::string &data, bool unique=false) |
| Ref< Tag > | CreateAutoDataTag (uint64_t addr, Ref< TagType > tagType, const std::string &data, bool unique=false) |
| Ref< Tag > | CreateUserDataTag (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. | |
| std::optional< Ref< Component > > | GetComponentByPath (std::string path) |
| Lookup a component by its pathname. | |
| Ref< Component > | GetRootComponent () |
| Get the root component for the BinaryView (read-only). | |
| Ref< Component > | CreateComponent () |
| Create a component. | |
| Ref< Component > | CreateComponent (std::string parentGUID) |
| Create a component as a subcomponent of the component with a given Guid. | |
| Ref< Component > | CreateComponent (Ref< Component > parent) |
| Create a component as a subcomponent of a given Component. | |
| Ref< Component > | CreateComponentWithName (std::string name, std::string parentGUID={}) |
| Create a component with a given name and optional parent. | |
| Ref< Component > | CreateComponentWithName (std::string name, Ref< Component > parent) |
| Create a component with a given name and parent. | |
| bool | RemoveComponent (Ref< Component > component) |
| Remove a component from the tree entirely. | |
| bool | RemoveComponent (std::string guid) |
| Remove a component from the tree entirely. | |
| std::vector< Ref< Component > > | GetFunctionParentComponents (Ref< Function > function) const |
| std::vector< Ref< Component > > | GetDataVariableParentComponents (DataVariable var) const |
| std::optional< BNStringType > | CheckForStringAnnotationType (uint64_t addr, std::string &value, bool allowShortStrings, bool allowLargeStrings, size_t childWidth) |
| Heuristically determine if a string exists at the given address. | |
| bool | CanAssemble (Architecture *arch) |
| Check whether the given architecture supports assembling instructions. | |
| bool | IsNeverBranchPatchAvailable (Architecture *arch, uint64_t addr) |
| Check whether the "Never Branch" patch is available for a given architecture at a given address. | |
| bool | IsAlwaysBranchPatchAvailable (Architecture *arch, uint64_t addr) |
| Check whether the "Always Branch" patch is available for a given architecture at a given address. | |
| bool | IsInvertBranchPatchAvailable (Architecture *arch, uint64_t addr) |
| Check whether the "Invert Branch" patch is available for a given architecture at a given address. | |
| 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. | |
| 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. | |
| bool | ConvertToNop (Architecture *arch, uint64_t addr) |
| Convert the instruction at the given address to a nop. | |
| bool | AlwaysBranch (Architecture *arch, uint64_t addr) |
| Convert the conditional branch at the given address to always branch. | |
| bool | InvertBranch (Architecture *arch, uint64_t addr) |
| Convert the conditional branch at the given address to branch under inverted conditions. | |
| bool | SkipAndReturnValue (Architecture *arch, uint64_t addr, uint64_t value) |
| Convert the given instruction to skip the rest of the function and return 0. | |
| size_t | GetInstructionLength (Architecture *arch, uint64_t addr) |
| Get the length of the instruction at a given address. | |
| bool | GetStringAtAddress (uint64_t addr, BNStringReference &strRef) |
| Get the string at an address. | |
| std::vector< BNStringReference > | GetStrings () |
| Get the list of strings located within the view. | |
| std::vector< BNStringReference > | GetStrings (uint64_t start, uint64_t len) |
| Get the list of strings located within a range. | |
| std::vector< DerivedString > | GetDerivedStrings () |
| std::vector< ReferenceSource > | GetDerivedStringCodeReferences (const DerivedString &str, std::optional< size_t > maxItems=std::nullopt) |
| Ref< AnalysisCompletionEvent > | AddAnalysisCompletionEvent (const std::function< void()> &callback) |
| Sets up a call back function to be called when analysis has been completed. | |
| AnalysisInfo | GetAnalysisInfo () |
| BNAnalysisProgress | GetAnalysisProgress () |
| BNAnalysisState | GetAnalysisState () |
| Ref< BackgroundTask > | GetBackgroundAnalysisTask () |
| uint64_t | GetNextFunctionStartAfterAddress (uint64_t addr) |
| Returns the virtual address of the Function that occurs after the virtual address `addr`. | |
| uint64_t | GetNextBasicBlockStartAfterAddress (uint64_t addr) |
| Returns the virtual address of the BasicBlock that occurs after the virtual address `addr`. | |
| uint64_t | GetNextDataAfterAddress (uint64_t addr) |
| Retrieves the virtual address of the next non-code byte. | |
| uint64_t | GetNextDataVariableStartAfterAddress (uint64_t addr) |
| Retrieves the address of the next DataVariable. | |
| uint64_t | GetPreviousFunctionStartBeforeAddress (uint64_t addr) |
| Returns the virtual address of the Function that occurs prior to the virtual address provided. | |
| uint64_t | GetPreviousBasicBlockStartBeforeAddress (uint64_t addr) |
| Returns the virtual address of the Basic Block that occurs prior to the virtual address provided. | |
| uint64_t | GetPreviousBasicBlockEndBeforeAddress (uint64_t addr) |
| Returns the ending virtual address of the Basic Block that occurs prior to the virtual address provided. | |
| uint64_t | GetPreviousDataBeforeAddress (uint64_t addr) |
| Returns the virtual address of the previous data (non-code) byte. | |
| uint64_t | GetPreviousDataVariableStartBeforeAddress (uint64_t addr) |
| Returns the virtual address of the previous DataVariable. | |
| 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={}, bool importDependencies=true) |
| Parse a single type and name from a string containing their definition. | |
| 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={}, bool importDependencies=true) |
| Parse an entire block of source into types, variables, and functions. | |
| 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={}, bool importDependencies=true) |
| Parse an entire block of source into a structure containing types, variables, and functions. | |
| class TypeContainer | GetTypeContainer () |
| Type Container for all types (user and auto) in the BinaryView. | |
| class TypeContainer | GetAutoTypeContainer () |
| Type Container for ONLY auto types in the BinaryView. | |
| class TypeContainer | GetUserTypeContainer () |
| Type Container for ONLY user types in the BinaryView. | |
| 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. | |
| std::vector< QualifiedName > | GetTypeNames (const std::string &matching="") |
| Ref< Type > | GetTypeByName (const QualifiedName &name) |
| Ref< Type > | GetTypeByRef (Ref< NamedTypeReference > name) |
| Ref< Type > | GetTypeById (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) |
| std::unordered_map< std::string, QualifiedName > | DefineTypes (const std::vector< std::pair< std::string, QualifiedNameAndType > > &types, ProgressFunction progress={}) |
| void | DefineUserType (const QualifiedName &name, Ref< Type > type) |
| void | DefineUserTypes (const std::vector< QualifiedNameAndType > &types, ProgressFunction progress={}) |
| void | DefineUserTypes (const std::vector< ParsedType > &types, ProgressFunction progress={}) |
| void | UndefineType (const std::string &id) |
| void | UndefineUserType (const QualifiedName &name) |
| void | RenameType (const QualifiedName &oldName, const QualifiedName &newName) |
| Ref< Type > | GetSystemCallType (Platform *platform, uint32_t id) |
| std::string | GetSystemCallName (Platform *platform, uint32_t id) |
| 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. | |
| void | AddTypeLibrary (TypeLibrary *lib) |
| Make the contents of a type library available for type/import resolution. | |
| Ref< TypeLibrary > | GetTypeLibrary (const std::string &name) |
| Get the type library with the given name. | |
| std::vector< Ref< TypeLibrary > > | GetTypeLibraries () |
| Get the list of imported type libraries. | |
| Ref< Type > | 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. | |
| Ref< Type > | 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. | |
| Ref< Type > | ImportTypeLibraryTypeByGuid (const std::string &guid) |
| Recursively imports a type by guid from the current BinaryView's set of type libraries. | |
| std::optional< QualifiedName > | GetTypeNameByGuid (const std::string &guid) |
| void | ExportTypeToTypeLibrary (TypeLibrary *lib, const QualifiedName &name, Type *type) |
| Recursively exports ``type`` into ``lib`` as a type with name ``name``. | |
| void | ExportObjectToTypeLibrary (TypeLibrary *lib, const QualifiedName &name, Type *type) |
| Recursively exports ``type`` into ``lib`` as an object with name ``name``. | |
| 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). | |
| 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. | |
| 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. | |
| Ref< TypeArchive > | AttachTypeArchive (const std::string &id, const std::string &path) |
| Attach a given type archive to the binary view. | |
| void | DetachTypeArchive (const std::string &id) |
| Detach from a type archive, breaking all associations to types with the archive. | |
| Ref< TypeArchive > | GetTypeArchive (const std::string &id) const |
| Look up a connected archive by its id. | |
| std::unordered_map< std::string, std::string > | GetTypeArchives () const |
| Get all attached type archives. | |
| std::optional< std::string > | GetTypeArchivePath (const std::string &id) const |
| Look up the path for an attached (but not necessarily connected) type archive by its id. | |
| std::unordered_map< QualifiedName, std::map< std::string, std::string > > | GetTypeArchiveTypeNames () const |
| Get a list of all available type names in all connected archives, and their archive/type id pair. | |
| std::unordered_map< std::string, std::pair< std::string, std::string > > | GetAssociatedTypeArchiveTypes () const |
| Get a list of all types in the analysis that are associated with a specific type archive. | |
| std::unordered_map< std::string, std::string > | GetAssociatedTypesFromArchive (const std::string &archive) const |
| Get a list of all types in the analysis that are associated with a specific type archive. | |
| std::optional< std::pair< std::string, std::string > > | GetAssociatedTypeArchiveTypeTarget (const std::string &id) const |
| Determine the target archive / type id of a given analysis type. | |
| std::optional< std::string > | GetAssociatedTypeArchiveTypeSource (const std::string &archiveId, const std::string &archiveTypeId) const |
| Determine the local source type for a given archive type. | |
| BNSyncStatus | GetTypeArchiveSyncStatus (const std::string &typeId) const |
| Get the current status of any changes pending in a given type. | |
| bool | DisassociateTypeArchiveType (const std::string &typeId) |
| Disassociate an associated type, so that it will no longer receive updates from its connected type archive. | |
| bool | PullTypeArchiveTypes (const std::string &archiveId, const std::unordered_set< std::string > &archiveTypeIds, std::unordered_map< std::string, std::string > &updatedTypes) |
| Pull a collection of types from a type archive, associating with them and any dependencies. | |
| bool | PushTypeArchiveTypes (const std::string &archiveId, const std::unordered_set< std::string > &typeIds, std::unordered_map< std::string, std::string > &updatedTypes) |
| Push a collection of types, and all their dependencies, into a type archive. | |
| 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, const FunctionViewType &viewType=NormalFunctionGraph) |
| bool | FindNextConstant (uint64_t start, uint64_t constant, uint64_t &result, Ref< DisassemblySettings > settings, const FunctionViewType &viewType=NormalFunctionGraph) |
| bool | FindNextData (uint64_t start, uint64_t end, const DataBuffer &data, uint64_t &addr, BNFindFlag flags, const ProgressFunction &progress) |
| bool | FindNextText (uint64_t start, uint64_t end, const std::string &data, uint64_t &addr, Ref< DisassemblySettings > settings, BNFindFlag flags, const FunctionViewType &viewType, const ProgressFunction &progress) |
| bool | FindNextConstant (uint64_t start, uint64_t end, uint64_t constant, uint64_t &addr, Ref< DisassemblySettings > settings, const FunctionViewType &viewType, const ProgressFunction &progress) |
| bool | FindAllData (uint64_t start, uint64_t end, const DataBuffer &data, BNFindFlag flags, const ProgressFunction &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, const FunctionViewType &viewType, const ProgressFunction &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, const FunctionViewType &viewType, const ProgressFunction &progress, const std::function< bool(uint64_t addr, const LinearDisassemblyLine &line)> &matchCallback) |
| std::string | DetectSearchMode (const std::string &query) |
| bool | Search (const std::string &query, const ProgressFunction &progressCallback, const std::function< bool(uint64_t addr, const DataBuffer &buffer)> &matchCallback) |
| void | Reanalyze () |
| Ref< Workflow > | GetWorkflow () |
| void | ShowPlainTextReport (const std::string &title, const std::string &contents) |
| Displays contents to the user in the UI or on the command-line. | |
| 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. | |
| 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. | |
| void | ShowGraphReport (const std::string &title, FlowGraph *graph) |
| Displays a flow graph in UI applications and nothing in command-line applications. | |
| 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. | |
| 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. | |
| MemoryMap * | GetMemoryMap () |
| A mock object that is a placeholder during development of this feature. | |
| void | BeginBulkAddSegments () |
| Begin a bulk segment addition operation. | |
| void | EndBulkAddSegments () |
| Finalize and apply all queued segments (auto and user) added during a bulk segment addition operation. | |
| void | CancelBulkAddSegments () |
| Cancel a bulk segment addition operation. | |
| 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. | |
| void | AddAutoSegments (const std::vector< BNSegmentInfo > &segments) |
| Add analysis segments that specify how data from the raw file is mapped into a virtual address space. | |
| void | RemoveAutoSegment (uint64_t start, uint64_t length) |
| Removes an automatically generated segment from the current segment mapping. | |
| 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. | |
| void | AddUserSegments (const std::vector< BNSegmentInfo > &segments) |
| Creates user-defined segments that specify how data from the raw file is mapped into a virtual address space. | |
| void | RemoveUserSegment (uint64_t start, uint64_t length) |
| Removes a user-defined segment from th current segment mapping. | |
| std::vector< Ref< Segment > > | GetSegments () |
| Get the list of registered Segments. | |
| Ref< Segment > | GetSegmentAt (uint64_t addr) |
| Gets the Segment a given virtual address is located in. | |
| bool | GetAddressForDataOffset (uint64_t offset, uint64_t &addr) |
| Retrieves the virtual addreses that maps to the given file offset, if possible. | |
| bool | GetDataOffsetForAddress (uint64_t addr, uint64_t &offset) |
| 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. | |
| void | RemoveAutoSection (const std::string &name) |
| Remove an automatically defined section by name. | |
| 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. | |
| void | RemoveUserSection (const std::string &name) |
| Remove a user defined section by name. | |
| std::vector< Ref< Section > > | GetSections () |
| Get the list of defined sections. | |
| std::vector< Ref< Section > > | GetSectionsAt (uint64_t addr) |
Get the list of sections containing addr. | |
| Ref< Section > | GetSectionByName (const std::string &name) |
| Get a Section by name. | |
| 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. | |
| std::vector< BNAddressRange > | GetAllocatedRanges () |
| Get the list of allocated ranges. | |
| std::vector< BNAddressRange > | GetMappedAddressRanges () |
| Get the list of ranges mapped into the address space. | |
| std::vector< BNAddressRange > | GetBackedAddressRanges () |
| Get the list of ranges that are mapped into the address space and are backed by a target object. | |
| std::string | GetCommentForAddress (uint64_t addr) const |
| Get the comment placed at an address. | |
| std::vector< uint64_t > | GetCommentedAddresses () const |
| Get the list of commented addresses. | |
| void | SetCommentForAddress (uint64_t addr, const std::string &comment) |
| Set the comment at an address. | |
| void | StoreMetadata (const std::string &key, Ref< Metadata > value, bool isAuto=false) |
| Ref< Metadata > | QueryMetadata (const std::string &key) |
| void | RemoveMetadata (const std::string &key) |
| Ref< Metadata > | GetMetadata () |
| Ref< Metadata > | GetAutoMetadata () |
| 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< Settings > | GetLoadSettings (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) |
| bool | ShouldSkipTargetAnalysis (const ArchAndAddr &source, Ref< Function > sourceFunc, uint64_t sourceEnd, const ArchAndAddr &target) |
| Determine whether the target analysis should be skipped for a given source function and target address. | |
| std::set< NameSpace > | GetNameSpaces () const |
| Returns a list of namespaces for the current BinaryView. | |
| bool | HasSymbols () const |
| Check whether this BinaryView has any defined symbols. | |
| bool | HasDataVariables () const |
| Check whether this BinaryView has any defined DataVariables. | |
| Ref< Structure > | CreateStructureFromOffsetAccess (const QualifiedName &type, bool *newMemberAdded) const |
| Confidence< Ref< Type > > | CreateStructureMemberFromAccess (const QualifiedName &name, uint64_t offset) const |
| Ref< Logger > | CreateLogger (const std::string &name) |
| Create a logger with a session ID tied to this BinaryView. | |
| void | AddExpressionParserMagicValue (const std::string &name, uint64_t value) |
| Add a magic value to the expression parser. | |
| void | RemoveExpressionParserMagicValue (const std::string &name) |
| Remove a magic value from the expression parser. | |
| void | AddExpressionParserMagicValues (const std::vector< std::string > &names, const std::vector< uint64_t > &values) |
| Add a list of magic value to the expression parser. | |
| void | RemoveExpressionParserMagicValues (const std::vector< std::string > &names) |
| Remove a list of magic value from the expression parser. | |
| bool | GetExpressionParserMagicValue (const std::string &name, uint64_t *value) |
| Get the value of an expression parser magic value. | |
| Ref< ExternalLibrary > | AddExternalLibrary (const std::string &name, Ref< ProjectFile > backingFile, bool isAuto=false) |
| void | RemoveExternalLibrary (const std::string &name) |
| Ref< ExternalLibrary > | GetExternalLibrary (const std::string &name) |
| std::vector< Ref< ExternalLibrary > > | GetExternalLibraries () |
| Ref< ExternalLocation > | AddExternalLocation (Ref< Symbol > sourceSymbol, Ref< ExternalLibrary > library, std::optional< std::string > targetSymbol, std::optional< uint64_t > targetAddress, bool isAuto=false) |
| void | RemoveExternalLocation (Ref< Symbol > sourceSymbol) |
| Ref< ExternalLocation > | GetExternalLocation (Ref< Symbol > sourceSymbol) |
| std::vector< Ref< ExternalLocation > > | GetExternalLocations () |
| Confidence< RegisterValue > | GetGlobalPointerValue () const |
| bool | UserGlobalPointerValueSet () const |
| void | ClearUserGlobalPointerValue () |
| void | SetUserGlobalPointerValue (const Confidence< RegisterValue > &value) |
| std::optional< std::pair< std::string, BNStringType > > | StringifyUnicodeData (Architecture *arch, const DataBuffer &buffer, bool nullTerminates=true, bool allowShortStrings=false) |
| 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 Ref< BinaryData > | CreateFromFilename (FileMetadata *file, const std::string &path) |
| Open a raw file from a given path. | |
| static Ref< BinaryData > | CreateFromFile (FileMetadata *file, FileAccessor *accessor) |
| Open a raw file from a given path. | |
| Static Public Member Functions inherited from BinaryNinja::BinaryView | |
| static NameSpace | GetInternalNameSpace () |
| Internal namespace for the current BinaryView. | |
| static NameSpace | GetExternalNameSpace () |
| External namespace for the current BinaryView. | |
| 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. | |
Additional Inherited Members | |
| Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNBinaryView, BNNewViewReference, BNFreeBinaryView > | |
| std::atomic< int > | m_refs |
| bool | m_registeredRef |
| BNBinaryView * | m_object |
| Protected Member Functions inherited from BinaryNinja::BinaryView | |
| BinaryView (const std::string &typeName, FileMetadata *file, BinaryView *parentView=nullptr) | |
| BinaryView constructor. | |
| 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. | |
| 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. | |
| 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`. | |
| 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`. | |
| virtual BNModificationStatus | PerformGetModification (uint64_t offset) |
| PerformGetModification implements a query as to whether the virtual address `offset` is modified. | |
| virtual bool | PerformIsValidOffset (uint64_t offset) |
| PerformIsValidOffset implements a check as to whether a virtual address `offset` is valid. | |
| virtual bool | PerformIsOffsetReadable (uint64_t offset) |
| PerformIsOffsetReadable implements a check as to whether a virtual address is readable. | |
| virtual bool | PerformIsOffsetWritable (uint64_t offset) |
| PerformIsOffsetWritable implements a check as to whether a virtual address is writable. | |
| virtual bool | PerformIsOffsetExecutable (uint64_t offset) |
| PerformIsOffsetExecutable implements a check as to whether a virtual address is executable. | |
| virtual bool | PerformIsOffsetBackedByFile (uint64_t offset) |
| PerformIsOffsetBackedByFile implements a check as to whether a virtual address is backed by a file. | |
| virtual uint64_t | PerformGetNextValidOffset (uint64_t offset) |
| PerformGetNextValidOffset implements a query for the next valid readable, writable, or executable virtual memory address after `offset`. | |
| virtual uint64_t | PerformGetStart () const |
| PerformGetStart implements a query for the first readable, writable, or executable virtual address in the BinaryView. | |
| 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. | |
| virtual BNEndianness | PerformGetDefaultEndianness () const |
| PerformGetDefaultEndianness implements a check which returns the Endianness of the BinaryView. | |
| virtual bool | PerformIsRelocatable () const |
| PerformIsRelocatable implements a check which returns true if the BinaryView is relocatable. | |
| virtual size_t | PerformGetAddressSize () const |
| PerformGetAddressSize implements a query for the address size for this BinaryView. | |
| 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) |
| Protected Attributes inherited from BinaryNinja::BinaryView | |
| Ref< FileMetadata > | m_file |
| The underlying file. | |
◆ BinaryData() [1/5]
◆ BinaryData() [2/5]
◆ BinaryData() [3/5]
| BinaryData::BinaryData | ( | FileMetadata * | file, |
| const void * | data, | ||
| size_t | len ) |
◆ BinaryData() [4/5]
| BinaryNinja::BinaryData::BinaryData | ( | FileMetadata * | file, |
| const std::string & | path ) |
◆ BinaryData() [5/5]
◆ CreateFromFilename()
|
static |
Open a raw file from a given path.
This is lifted out into a method because this operation can fail.
- Parameters
-
file Metadata structure path Path to file to open
- Returns
- Reference to binary data if successful, nullptr reference otherwise
◆ CreateFromFile()
Open a raw file from a given path.
This is lifted out into a method because this operation can fail.
- Parameters
-
file Metadata structure accessor File accessor object for reading file contents
- Returns
- Reference to binary data if successful, nullptr reference otherwise
◆ BinaryNinja::BinaryViewType
class BinaryNinja::BinaryViewType
The BinaryViewType object is used internally and should not be directly instantiated.
Public Member Functions | |
| BinaryViewType (const std::string &name, const std::string &longName) | |
| virtual | ~BinaryViewType () |
| void | RegisterArchitecture (uint32_t id, BNEndianness endian, Architecture *arch) |
| Register an Architecture for this view type. | |
| Ref< Architecture > | GetArchitecture (uint32_t id, BNEndianness endian) |
| Get an Architecture for this BinaryViewType by id and endianness. | |
| void | RegisterPlatform (uint32_t id, Architecture *arch, Platform *platform) |
| Register a Platform for this view type. | |
| void | RegisterDefaultPlatform (Architecture *arch, Platform *platform) |
| Register a Platform as a default for this view type. | |
| Ref< Platform > | GetPlatform (uint32_t id, Architecture *arch) |
| Get a platform by ID and architecture. | |
| void | RegisterPlatformRecognizer (uint64_t id, BNEndianness endian, const std::function< Ref< Platform >(BinaryView *view, Metadata *)> &callback) |
| Ref< Platform > | RecognizePlatform (uint64_t id, BNEndianness endian, BinaryView *view, Metadata *metadata) |
| std::string | GetName () |
| Get the name this platform was registered with. | |
| std::string | GetLongName () |
| Get the "Long Name" this platform was registered with. | |
| virtual bool | IsDeprecated () |
| virtual Ref< BinaryView > | Create (BinaryView *data)=0 |
| Create a BinaryView for this BinaryViewType given the data from an existing BinaryView. | |
| virtual Ref< BinaryView > | Parse (BinaryView *data) |
| Create ephemeral BinaryView to generate information for preview. | |
| virtual bool | IsTypeValidForData (BinaryView *data)=0 |
| Check whether this BinaryViewType is valid for given data. | |
| virtual bool | IsForceLoadable () |
| Check whether this BinaryViewType can be forced to load a binary, even if IsTypeValidForData returns false. | |
| virtual Ref< Settings > | GetLoadSettingsForData (BinaryView *data) |
| Ref< Settings > | GetDefaultLoadSettingsForData (BinaryView *data) |
| Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNBinaryViewType > | |
| StaticCoreRefCountObject () | |
| virtual | ~StaticCoreRefCountObject () |
| BNBinaryViewType * | GetObject () const |
| void | AddRef () |
| void | Release () |
| void | AddRefForRegistration () |
| void | AddRefForCallback () |
| void | ReleaseForCallback () |
Static Public Member Functions | |
| static void | Register (BinaryViewType *type) |
| Register a BinaryViewType. | |
| static Ref< BinaryViewType > | GetByName (const std::string &name) |
| Get a BinaryViewType by name. | |
| static std::vector< Ref< BinaryViewType > > | GetViewTypes () |
| Get the list of registered View Types. | |
| static std::vector< Ref< BinaryViewType > > | GetViewTypesForData (BinaryView *data) |
| Get the list of valid view types for a BinaryView. | |
| static void | RegisterArchitecture (const std::string &name, uint32_t id, BNEndianness endian, Architecture *arch) |
| Register an Architecture for a specific view type. | |
| static void | RegisterPlatform (const std::string &name, uint32_t id, Platform *platform) |
| Register a Platform for a specific view type. | |
| static void | RegisterPlatform (const std::string &name, uint32_t id, Architecture *arch, Platform *platform) |
| Register a Platform for a specific view type (this form is deprecated as of 4.3, please use the form without architecture as an argument instead). | |
| static void | RegisterDefaultPlatform (const std::string &name, Architecture *arch, Platform *platform) |
| Register a Platform as a default for a specific view type. | |
| static void | RegisterBinaryViewFinalizationEvent (const std::function< void(BinaryView *view)> &callback) |
| static void | RegisterBinaryViewInitialAnalysisCompletionEvent (const std::function< void(BinaryView *view)> &callback) |
| static void | BinaryViewEventCallback (void *ctxt, BNBinaryView *view) |
| static BNPlatform * | PlatformRecognizerCallback (void *ctxt, BNBinaryView *view, BNMetadata *metadata) |
Protected Member Functions | |
| BinaryViewType (BNBinaryViewType *type) | |
Static Protected Member Functions | |
| static BNBinaryView * | CreateCallback (void *ctxt, BNBinaryView *data) |
| static BNBinaryView * | ParseCallback (void *ctxt, BNBinaryView *data) |
| static bool | IsValidCallback (void *ctxt, BNBinaryView *data) |
| static bool | IsDeprecatedCallback (void *ctxt) |
| static bool | IsForceLoadableCallback (void *ctxt) |
| static BNSettings * | GetSettingsCallback (void *ctxt, BNBinaryView *data) |
Protected Attributes | |
| std::string | m_nameForRegister |
| std::string | m_longNameForRegister |
◆ BinaryViewType() [1/2]
◆ BinaryViewType() [2/2]
| BinaryNinja::BinaryViewType::BinaryViewType | ( | const std::string & | name, |
| const std::string & | longName ) |
◆ ~BinaryViewType()
|
inlinevirtual |
◆ CreateCallback()
◆ ParseCallback()
◆ IsValidCallback()
|
staticprotected |
◆ IsDeprecatedCallback()
|
staticprotected |
◆ IsForceLoadableCallback()
|
staticprotected |
◆ GetSettingsCallback()
◆ Register()
|
static |
Register a BinaryViewType.
- Parameters
-
type BinaryViewType to register
◆ GetByName()
|
static |
Get a BinaryViewType by name.
- Parameters
-
name Name of the registered BinaryViewType
- Returns
- The BinaryViewType, if one was registered
◆ GetViewTypes()
|
static |
◆ GetViewTypesForData()
|
static |
Get the list of valid view types for a BinaryView.
- Parameters
-
data BinaryView for a binary
- Returns
- List of valid view types
◆ RegisterArchitecture() [1/2]
|
static |
Register an Architecture for a specific view type.
- Parameters
-
name Name of the view type id ID of the architecture endian Endianness of the architecture arch Architecture
◆ RegisterArchitecture() [2/2]
Register an Architecture for this view type.
- Parameters
-
id ID of the architecture endian Endianness of the architecture arch Architecture
◆ GetArchitecture()
Get an Architecture for this BinaryViewType by id and endianness.
- Parameters
-
id ID of the architecture endian Endianness of the architecture
- Returns
- The architecture, if it was found
◆ RegisterPlatform() [1/3]
|
static |
Register a Platform for a specific view type.
- Parameters
-
name Name of the BinaryViewType id ID of the platform platform The Platform to register
◆ RegisterPlatform() [2/3]
|
static |
Register a Platform for a specific view type (this form is deprecated as of 4.3, please use the form without architecture as an argument instead).
- Parameters
-
name Name of the BinaryViewType id ID of the platform arch Architecture to register this platform with platform The Platform to register
◆ RegisterDefaultPlatform() [1/2]
|
static |
Register a Platform as a default for a specific view type.
- Parameters
◆ RegisterPlatform() [3/3]
Register a Platform for this view type.
- Parameters
-
id ID of the platform arch Architecture to register this platform with platform The Platform to register
◆ RegisterDefaultPlatform() [2/2]
Register a Platform as a default for this view type.
- Parameters
◆ GetPlatform()
◆ RegisterPlatformRecognizer()
| void BinaryViewType::RegisterPlatformRecognizer | ( | uint64_t | id, |
| BNEndianness | endian, | ||
| const std::function< Ref< Platform >(BinaryView *view, Metadata *)> & | callback ) |
◆ RecognizePlatform()
◆ GetName()
| string BinaryViewType::GetName | ( | ) |
Get the name this platform was registered with.
- Returns
- The name of the platform
◆ GetLongName()
| string BinaryViewType::GetLongName | ( | ) |
Get the "Long Name" this platform was registered with.
- Returns
- The "Long Name" this platform was registered with
◆ IsDeprecated()
|
virtual |
Reimplemented in BinaryNinja::CoreBinaryViewType.
◆ Create()
|
pure virtual |
Create a BinaryView for this BinaryViewType given the data from an existing BinaryView.
- Parameters
-
data An existing BinaryView, typically with the Rawtype
- Returns
- The BinaryView created by this BinaryViewType
Implemented in BinaryNinja::CoreBinaryViewType.
◆ Parse()
|
virtual |
Create ephemeral BinaryView to generate information for preview.
- Parameters
-
data An existing BinaryView, typically with the Rawtype
- Returns
- The BinaryView created by this BinaryViewType
Reimplemented in BinaryNinja::CoreBinaryViewType.
◆ IsTypeValidForData()
|
pure virtual |
Check whether this BinaryViewType is valid for given data.
- Parameters
-
data An existing BinaryView, typically with the Rawtype
- Returns
- Whether this BinaryViewType is valid for given data
Implemented in BinaryNinja::CoreBinaryViewType.
◆ IsForceLoadable()
|
virtual |
Check whether this BinaryViewType can be forced to load a binary, even if IsTypeValidForData returns false.
- Returns
- Whether this BinaryViewType can be forced to load a binary
Reimplemented in BinaryNinja::CoreBinaryViewType.
◆ GetLoadSettingsForData()
|
virtual |
Reimplemented in BinaryNinja::CoreBinaryViewType.
◆ GetDefaultLoadSettingsForData()
| Ref< Settings > BinaryViewType::GetDefaultLoadSettingsForData | ( | BinaryView * | data | ) |
◆ RegisterBinaryViewFinalizationEvent()
|
static |
◆ RegisterBinaryViewInitialAnalysisCompletionEvent()
|
static |
◆ BinaryViewEventCallback()
|
static |
◆ PlatformRecognizerCallback()
◆ m_nameForRegister
|
std::string BinaryNinja::BinaryViewType::m_nameForRegister |
protected |
◆ m_longNameForRegister
|
std::string BinaryNinja::BinaryViewType::m_longNameForRegister |
protected |
◆ BinaryNinja::CoreBinaryViewType
class BinaryNinja::CoreBinaryViewType
Public Member Functions | |
| CoreBinaryViewType (BNBinaryViewType *type) | |
| virtual Ref< BinaryView > | Create (BinaryView *data) override |
| Create a BinaryView for this BinaryViewType given the data from an existing BinaryView. | |
| virtual Ref< BinaryView > | Parse (BinaryView *data) override |
| Create ephemeral BinaryView to generate information for preview. | |
| virtual bool | IsTypeValidForData (BinaryView *data) override |
| Check whether this BinaryViewType is valid for given data. | |
| virtual bool | IsDeprecated () override |
| virtual bool | IsForceLoadable () override |
| Check whether this BinaryViewType can be forced to load a binary, even if IsTypeValidForData returns false. | |
| virtual Ref< Settings > | GetLoadSettingsForData (BinaryView *data) override |
| Public Member Functions inherited from BinaryNinja::BinaryViewType | |
| BinaryViewType (const std::string &name, const std::string &longName) | |
| virtual | ~BinaryViewType () |
| void | RegisterArchitecture (uint32_t id, BNEndianness endian, Architecture *arch) |
| Register an Architecture for this view type. | |
| Ref< Architecture > | GetArchitecture (uint32_t id, BNEndianness endian) |
| Get an Architecture for this BinaryViewType by id and endianness. | |
| void | RegisterPlatform (uint32_t id, Architecture *arch, Platform *platform) |
| Register a Platform for this view type. | |
| void | RegisterDefaultPlatform (Architecture *arch, Platform *platform) |
| Register a Platform as a default for this view type. | |
| Ref< Platform > | GetPlatform (uint32_t id, Architecture *arch) |
| Get a platform by ID and architecture. | |
| void | RegisterPlatformRecognizer (uint64_t id, BNEndianness endian, const std::function< Ref< Platform >(BinaryView *view, Metadata *)> &callback) |
| Ref< Platform > | RecognizePlatform (uint64_t id, BNEndianness endian, BinaryView *view, Metadata *metadata) |
| std::string | GetName () |
| Get the name this platform was registered with. | |
| std::string | GetLongName () |
| Get the "Long Name" this platform was registered with. | |
| Ref< Settings > | GetDefaultLoadSettingsForData (BinaryView *data) |
| Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNBinaryViewType > | |
| StaticCoreRefCountObject () | |
| virtual | ~StaticCoreRefCountObject () |
| BNBinaryViewType * | GetObject () const |
| void | AddRef () |
| void | Release () |
| void | AddRefForRegistration () |
| void | AddRefForCallback () |
| void | ReleaseForCallback () |
Additional Inherited Members | |
| Static Public Member Functions inherited from BinaryNinja::BinaryViewType | |
| static void | Register (BinaryViewType *type) |
| Register a BinaryViewType. | |
| static Ref< BinaryViewType > | GetByName (const std::string &name) |
| Get a BinaryViewType by name. | |
| static std::vector< Ref< BinaryViewType > > | GetViewTypes () |
| Get the list of registered View Types. | |
| static std::vector< Ref< BinaryViewType > > | GetViewTypesForData (BinaryView *data) |
| Get the list of valid view types for a BinaryView. | |
| static void | RegisterArchitecture (const std::string &name, uint32_t id, BNEndianness endian, Architecture *arch) |
| Register an Architecture for a specific view type. | |
| static void | RegisterPlatform (const std::string &name, uint32_t id, Platform *platform) |
| Register a Platform for a specific view type. | |
| static void | RegisterPlatform (const std::string &name, uint32_t id, Architecture *arch, Platform *platform) |
| Register a Platform for a specific view type (this form is deprecated as of 4.3, please use the form without architecture as an argument instead). | |
| static void | RegisterDefaultPlatform (const std::string &name, Architecture *arch, Platform *platform) |
| Register a Platform as a default for a specific view type. | |
| static void | RegisterBinaryViewFinalizationEvent (const std::function< void(BinaryView *view)> &callback) |
| static void | RegisterBinaryViewInitialAnalysisCompletionEvent (const std::function< void(BinaryView *view)> &callback) |
| static void | BinaryViewEventCallback (void *ctxt, BNBinaryView *view) |
| static BNPlatform * | PlatformRecognizerCallback (void *ctxt, BNBinaryView *view, BNMetadata *metadata) |
| Public Attributes inherited from BinaryNinja::StaticCoreRefCountObject< BNBinaryViewType > | |
| std::atomic< int > | m_refs |
| BNBinaryViewType * | m_object |
| Protected Member Functions inherited from BinaryNinja::BinaryViewType | |
| BinaryViewType (BNBinaryViewType *type) | |
| Static Protected Member Functions inherited from BinaryNinja::BinaryViewType | |
| static BNBinaryView * | CreateCallback (void *ctxt, BNBinaryView *data) |
| static BNBinaryView * | ParseCallback (void *ctxt, BNBinaryView *data) |
| static bool | IsValidCallback (void *ctxt, BNBinaryView *data) |
| static bool | IsDeprecatedCallback (void *ctxt) |
| static bool | IsForceLoadableCallback (void *ctxt) |
| static BNSettings * | GetSettingsCallback (void *ctxt, BNBinaryView *data) |
| Protected Attributes inherited from BinaryNinja::BinaryViewType | |
| std::string | m_nameForRegister |
| std::string | m_longNameForRegister |
◆ CoreBinaryViewType()
◆ Create()
|
overridevirtual |
Create a BinaryView for this BinaryViewType given the data from an existing BinaryView.
- Parameters
-
data An existing BinaryView, typically with the Rawtype
- Returns
- The BinaryView created by this BinaryViewType
Implements BinaryNinja::BinaryViewType.
◆ Parse()
|
overridevirtual |
Create ephemeral BinaryView to generate information for preview.
- Parameters
-
data An existing BinaryView, typically with the Rawtype
- Returns
- The BinaryView created by this BinaryViewType
Reimplemented from BinaryNinja::BinaryViewType.
◆ IsTypeValidForData()
|
overridevirtual |
Check whether this BinaryViewType is valid for given data.
- Parameters
-
data An existing BinaryView, typically with the Rawtype
- Returns
- Whether this BinaryViewType is valid for given data
Implements BinaryNinja::BinaryViewType.
◆ IsDeprecated()
|
overridevirtual |
Reimplemented from BinaryNinja::BinaryViewType.
◆ IsForceLoadable()
|
overridevirtual |
Check whether this BinaryViewType can be forced to load a binary, even if IsTypeValidForData returns false.
- Returns
- Whether this BinaryViewType can be forced to load a binary
Reimplemented from BinaryNinja::BinaryViewType.
◆ GetLoadSettingsForData()
|
overridevirtual |
Reimplemented from BinaryNinja::BinaryViewType.
◆ BinaryNinja::ReadException
class BinaryNinja::ReadException
◆ BinaryNinja::BinaryReader
class BinaryNinja::BinaryReader
BinaryReader is a convenience class for reading binary data.
Public Member Functions | |
| BinaryReader (BinaryView *data, BNEndianness endian=LittleEndian) | |
| Create a BinaryReader instance given a BinaryView and endianness. | |
| ~BinaryReader () | |
| BNEndianness | GetEndianness () const |
| Get the endianness set for this reader. | |
| void | SetEndianness (BNEndianness endian) |
| Set the endianness for this reader. | |
| void | Read (void *dest, size_t len) |
| Read from the current cursor position into buffer `dest`. | |
| DataBuffer | Read (size_t len) |
| Read from the current cursor position into a DataBuffer. | |
| template<typename T> | |
| T | Read () |
| template<typename T> | |
| std::vector< T > | ReadVector (size_t count) |
| std::string | ReadString (size_t len) |
| Read a string of fixed length from the current cursor position. | |
| std::string | ReadCString (size_t maxLength=-1) |
| Read a null-terminated string from the current cursor position. | |
| uint8_t | Read8 () |
| Read a uint8_t from the current cursor position and advance the cursor by 1 byte. | |
| uint16_t | Read16 () |
| Read a uint16_t from the current cursor position and advance the cursor by 2 bytes. | |
| uint32_t | Read32 () |
| Read a uint32_t from the current cursor position and advance the cursor by 4 bytes. | |
| uint64_t | Read64 () |
| Read a uint64_t from the current cursor position and advance the cursor by 8 bytes. | |
| uint64_t | ReadPointer () |
| Read a pointer (size of BinaryView::GetAddressSize()) from the current cursor position and advance and advance it that many bytes. | |
| uint16_t | ReadLE16 () |
| Read a uint16_t from the current cursor position, explicitly as a little endian value, and advance the cursor by 4 bytes. | |
| uint32_t | ReadLE32 () |
| Read a uint16_t from the current cursor position, explicitly as a little endian value, and advance the cursor by 4 bytes. | |
| uint64_t | ReadLE64 () |
| Read a uint16_t from the current cursor position, explicitly as a little endian value, and advance the cursor by 4 bytes. | |
| uint64_t | ReadLEPointer () |
| Read a pointer (size of BinaryView::GetAddressSize()) as little-endian from the current cursor position and advance and advance it that many bytes. | |
| uint16_t | ReadBE16 () |
| Read a uint16_t from the current cursor position, explicitly as a big endian value, and advance the cursor by 4 bytes. | |
| uint32_t | ReadBE32 () |
| Read a uint16_t from the current cursor position, explicitly as a big endian value, and advance the cursor by 4 bytes. | |
| uint64_t | ReadBE64 () |
| Read a uint16_t from the current cursor position, explicitly as a big endian value, and advance the cursor by 4 bytes. | |
| uint64_t | ReadBEPointer () |
| Read a pointer (size of BinaryView::GetAddressSize()) as big-endian from the current cursor position and advance and advance it that many bytes. | |
| bool | TryRead (void *dest, size_t len) |
| Try reading a value, returning false whenever that read fails. | |
| bool | TryRead (DataBuffer &dest, size_t len) |
| Try reading a value into a databuffer. | |
| bool | TryReadString (std::string &dest, size_t len) |
| Try reading a string. | |
| bool | TryRead8 (uint8_t &result) |
| Try reading a uint8_t. | |
| bool | TryRead16 (uint16_t &result) |
| Try reading a uint16_t. | |
| bool | TryRead32 (uint32_t &result) |
| Try reading a uint32_t. | |
| bool | TryRead64 (uint64_t &result) |
| Try reading a uint64_t. | |
| bool | TryReadPointer (uint64_t &result) |
| Try reading a pointer (size of BinaryView::GetAddressSize()). | |
| bool | TryReadLE16 (uint16_t &result) |
| Try reading a uint16_t, explicitly as little endian. | |
| bool | TryReadLE32 (uint32_t &result) |
| Try reading a uint32_t, explicitly as little endian. | |
| bool | TryReadLE64 (uint64_t &result) |
| Try reading a uint64_t, explicitly as little endian. | |
| bool | TryReadLEPointer (uint64_t &result) |
| Try reading a pointer (size of BinaryView::GetAddressSize()) as little-endian. | |
| bool | TryReadBE16 (uint16_t &result) |
| Try reading a uint16_t, explicitly as big endian. | |
| bool | TryReadBE32 (uint32_t &result) |
| Try reading a uint32_t, explicitly as big endian. | |
| bool | TryReadBE64 (uint64_t &result) |
| Try reading a uint64_t, explicitly as big endian. | |
| bool | TryReadBEPointer (uint64_t &result) |
| Try reading a pointer (size of BinaryView::GetAddressSize()) as big-endian. | |
| uint64_t | GetOffset () const |
| Get the current cursor position. | |
| void | Seek (uint64_t offset) |
| Set the cursor position. | |
| void | SeekRelative (int64_t offset) |
| Set the cursor position, relative to the current position. | |
| uint64_t | GetVirtualBase () |
| Gets the virtual base offset for the stream. | |
| void | SetVirtualBase (uint64_t base) |
| Sets a virtual base offset for the stream. | |
| bool | IsEndOfFile () const |
| Whether the current cursor position is at the end of the file. | |
| template<typename T> | |
| vector< T > | ReadVector (size_t count) |
◆ BinaryReader()
Create a BinaryReader instance given a BinaryView and endianness.
- Parameters
-
data BinaryView to read from endian Byte order to read with. One of LittleEndian, BigEndian
◆ ~BinaryReader()
| BinaryReader::~BinaryReader | ( | ) |
◆ GetEndianness()
Get the endianness set for this reader.
- Returns
- The endianness set for this reader.
◆ SetEndianness()
Set the endianness for this reader.
- Parameters
-
endian Byte order to read with. One of LittleEndian, BigEndian
◆ Read() [1/3]
| void BinaryReader::Read | ( | void * | dest, |
| size_t | len ) |
Read from the current cursor position into buffer `dest`.
- Exceptions
- Parameters
-
dest Address to write the read bytes to len Number of bytes to write
◆ Read() [2/3]
Read from the current cursor position into a DataBuffer.
- Exceptions
- Parameters
-
len Number of bytes to read
- Returns
- DataBuffer containing the bytes read
◆ Read() [3/3]
template<typename T>
| T BinaryReader::Read | ( | ) |
◆ ReadVector() [1/2]
template<typename T>
| std::vector< T > BinaryNinja::BinaryReader::ReadVector | ( | size_t | count | ) |
◆ ReadString()
| string BinaryReader::ReadString | ( | size_t | len | ) |
Read a string of fixed length from the current cursor position.
- Exceptions
- Parameters
- Returns
- the string
◆ ReadCString()
| string BinaryReader::ReadCString | ( | size_t | maxLength = -1 | ) |
Read a null-terminated string from the current cursor position.
- Exceptions
- Parameters
-
maxLength Maximum length of the string, default is no limit (-1)
- Returns
- the string
◆ Read8()
| uint8_t BinaryReader::Read8 | ( | ) |
Read a uint8_t from the current cursor position and advance the cursor by 1 byte.
- Exceptions
- Returns
- The read value
◆ Read16()
| uint16_t BinaryReader::Read16 | ( | ) |
Read a uint16_t from the current cursor position and advance the cursor by 2 bytes.
- Exceptions
- Returns
- The read value
◆ Read32()
| uint32_t BinaryReader::Read32 | ( | ) |
Read a uint32_t from the current cursor position and advance the cursor by 4 bytes.
- Exceptions
- Returns
- The read value
◆ Read64()
| uint64_t BinaryReader::Read64 | ( | ) |
Read a uint64_t from the current cursor position and advance the cursor by 8 bytes.
- Exceptions
- Returns
- The read value
◆ ReadPointer()
| uint64_t BinaryReader::ReadPointer | ( | ) |
Read a pointer (size of BinaryView::GetAddressSize()) from the current cursor position and advance and advance it that many bytes.
- Exceptions
- Returns
- The value that was read
◆ ReadLE16()
| uint16_t BinaryReader::ReadLE16 | ( | ) |
Read a uint16_t from the current cursor position, explicitly as a little endian value, and advance the cursor by 4 bytes.
- Exceptions
- Returns
- The read value
◆ ReadLE32()
| uint32_t BinaryReader::ReadLE32 | ( | ) |
Read a uint16_t from the current cursor position, explicitly as a little endian value, and advance the cursor by 4 bytes.
- Exceptions
- Returns
- The read value
◆ ReadLE64()
| uint64_t BinaryReader::ReadLE64 | ( | ) |
Read a uint16_t from the current cursor position, explicitly as a little endian value, and advance the cursor by 4 bytes.
- Exceptions
- Returns
- The read value
◆ ReadLEPointer()
| uint64_t BinaryReader::ReadLEPointer | ( | ) |
Read a pointer (size of BinaryView::GetAddressSize()) as little-endian from the current cursor position and advance and advance it that many bytes.
- Exceptions
- Returns
- The value that was read
◆ ReadBE16()
| uint16_t BinaryReader::ReadBE16 | ( | ) |
Read a uint16_t from the current cursor position, explicitly as a big endian value, and advance the cursor by 4 bytes.
- Exceptions
- Returns
- The read value
◆ ReadBE32()
| uint32_t BinaryReader::ReadBE32 | ( | ) |
Read a uint16_t from the current cursor position, explicitly as a big endian value, and advance the cursor by 4 bytes.
- Exceptions
- Returns
- The read value
◆ ReadBE64()
| uint64_t BinaryReader::ReadBE64 | ( | ) |
Read a uint16_t from the current cursor position, explicitly as a big endian value, and advance the cursor by 4 bytes.
- Exceptions
- Returns
- The read value
◆ ReadBEPointer()
| uint64_t BinaryReader::ReadBEPointer | ( | ) |
Read a pointer (size of BinaryView::GetAddressSize()) as big-endian from the current cursor position and advance and advance it that many bytes.
- Exceptions
- Returns
- The value that was read
◆ TryRead() [1/2]
| bool BinaryReader::TryRead | ( | void * | dest, |
| size_t | len ) |
Try reading a value, returning false whenever that read fails.
- Parameters
-
dest Address to write the bytes to len Number of bytes to read
- Returns
- Whether the read succeeded
◆ TryRead() [2/2]
| bool BinaryReader::TryRead | ( | DataBuffer & | dest, |
| size_t | len ) |
Try reading a value into a databuffer.
- Parameters
-
dest Reference to a DataBuffer to write to len Amount of bytes to read
- Returns
- Whether the read succeeded
◆ TryReadString()
| bool BinaryReader::TryReadString | ( | std::string & | dest, |
| size_t | len ) |
Try reading a string.
- Parameters
-
dest Reference to a string to write to len Length of the string to be read
- Returns
- Whether the read succeeded
◆ TryRead8()
| bool BinaryReader::TryRead8 | ( | uint8_t & | result | ) |
Try reading a uint8_t.
- Parameters
-
result Reference to a uint8_t to write to
- Returns
- Whether the read succeeded.
◆ TryRead16()
| bool BinaryReader::TryRead16 | ( | uint16_t & | result | ) |
Try reading a uint16_t.
- Parameters
-
result Reference to a uint16_t to write to
- Returns
- Whether the read succeeded.
◆ TryRead32()
| bool BinaryReader::TryRead32 | ( | uint32_t & | result | ) |
Try reading a uint32_t.
- Parameters
-
result Reference to a uint32_t to write to
- Returns
- Whether the read succeeded.
◆ TryRead64()
| bool BinaryReader::TryRead64 | ( | uint64_t & | result | ) |
Try reading a uint64_t.
- Parameters
-
result Reference to a uint64_t to write to
- Returns
- Whether the read succeeded.
◆ TryReadPointer()
| bool BinaryReader::TryReadPointer | ( | uint64_t & | result | ) |
Try reading a pointer (size of BinaryView::GetAddressSize()).
- Parameters
-
result Reference to a uint64_t to write to
- Returns
- Whether the read succeeded.
◆ TryReadLE16()
| bool BinaryReader::TryReadLE16 | ( | uint16_t & | result | ) |
Try reading a uint16_t, explicitly as little endian.
- Parameters
-
result Reference to a uint16_t to write to
- Returns
- Whether the read succeeded.
◆ TryReadLE32()
| bool BinaryReader::TryReadLE32 | ( | uint32_t & | result | ) |
Try reading a uint32_t, explicitly as little endian.
- Parameters
-
result Reference to a uint32_t to write to
- Returns
- Whether the read succeeded.
◆ TryReadLE64()
| bool BinaryReader::TryReadLE64 | ( | uint64_t & | result | ) |
Try reading a uint64_t, explicitly as little endian.
- Parameters
-
result Reference to a uint64_t to write to
- Returns
- Whether the read succeeded.
◆ TryReadLEPointer()
| bool BinaryReader::TryReadLEPointer | ( | uint64_t & | result | ) |
Try reading a pointer (size of BinaryView::GetAddressSize()) as little-endian.
- Parameters
-
result Reference to a uint64_t to write to
- Returns
- Whether the read succeeded.
◆ TryReadBE16()
| bool BinaryReader::TryReadBE16 | ( | uint16_t & | result | ) |
Try reading a uint16_t, explicitly as big endian.
- Parameters
-
result Reference to a uint16_t to write to
- Returns
- Whether the read succeeded.
◆ TryReadBE32()
| bool BinaryReader::TryReadBE32 | ( | uint32_t & | result | ) |
Try reading a uint32_t, explicitly as big endian.
- Parameters
-
result Reference to a uint32_t to write to
- Returns
- Whether the read succeeded.
◆ TryReadBE64()
| bool BinaryReader::TryReadBE64 | ( | uint64_t & | result | ) |
Try reading a uint64_t, explicitly as big endian.
- Parameters
-
result Reference to a uint64_t to write to
- Returns
- Whether the read succeeded.
◆ TryReadBEPointer()
| bool BinaryReader::TryReadBEPointer | ( | uint64_t & | result | ) |
Try reading a pointer (size of BinaryView::GetAddressSize()) as big-endian.
- Parameters
-
result Reference to a uint64_t to write to
- Returns
- Whether the read succeeded.
◆ GetOffset()
| uint64_t BinaryReader::GetOffset | ( | ) | const |
Get the current cursor position.
- Returns
- The current cursor position
◆ Seek()
| void BinaryReader::Seek | ( | uint64_t | offset | ) |
Set the cursor position.
- Parameters
-
offset The new cursor position
◆ SeekRelative()
| void BinaryReader::SeekRelative | ( | int64_t | offset | ) |
Set the cursor position, relative to the current position.
- Parameters
-
offset Offset to the current cursor position
◆ GetVirtualBase()
| uint64_t BinaryReader::GetVirtualBase | ( | ) |
Gets the virtual base offset for the stream.
- Returns
- The current virtual base
◆ SetVirtualBase()
| void BinaryReader::SetVirtualBase | ( | uint64_t | base | ) |
Sets a virtual base offset for the stream.
- Parameters
◆ IsEndOfFile()
| bool BinaryReader::IsEndOfFile | ( | ) | const |
Whether the current cursor position is at the end of the file.
◆ ReadVector() [2/2]
template<typename T>
| vector< T > BinaryNinja::BinaryReader::ReadVector | ( | size_t | count | ) |
◆ BinaryNinja::WriteException
class BinaryNinja::WriteException
◆ BinaryNinja::BinaryWriter
class BinaryNinja::BinaryWriter
BinaryWriter is a convenience class for writing binary data.
Public Member Functions | |
| BinaryWriter (BinaryView *data, BNEndianness endian=LittleEndian) | |
| Create a BinaryWriter instance given a BinaryView and endianness. | |
| ~BinaryWriter () | |
| BNEndianness | GetEndianness () const |
| Get the endianness set for this writer. | |
| void | SetEndianness (BNEndianness endian) |
| Set the endianness for this writer. | |
| void | Write (const void *src, size_t len) |
| Write bytes from an address to the current cursor position. | |
| void | Write (const DataBuffer &buf) |
| Write the contents of a DataBuffer to the current cursor position. | |
| void | Write (const std::string &str) |
| Write the contents of a string to the current cursor position. | |
| void | Write8 (uint8_t val) |
| Write a uint8_t to the current cursor position. | |
| void | Write16 (uint16_t val) |
| Write a uint16_t to the current cursor position. | |
| void | Write32 (uint32_t val) |
| Write a uint32_t to the current cursor position. | |
| void | Write64 (uint64_t val) |
| Write a uint64_t to the current cursor position. | |
| void | WriteLE16 (uint16_t val) |
| Write a uint16_t to the current cursor position, explicitly as little endian. | |
| void | WriteLE32 (uint32_t val) |
| Write a uint32_t to the current cursor position, explicitly as little endian. | |
| void | WriteLE64 (uint64_t val) |
| Write a uint64_t to the current cursor position, explicitly as little endian. | |
| void | WriteBE16 (uint16_t val) |
| Write a uint16_t to the current cursor position, explicitly as big endian. | |
| void | WriteBE32 (uint32_t val) |
| Write a uint32_t to the current cursor position, explicitly as big endian. | |
| void | WriteBE64 (uint64_t val) |
| Write a uint64_t to the current cursor position, explicitly as big endian. | |
| bool | TryWrite (const void *src, size_t len) |
| Write bytes from an address to the current cursor position. | |
| bool | TryWrite (const DataBuffer &buf) |
| Write from a DataBuffer to the current cursor position. | |
| bool | TryWrite (const std::string &str) |
| Write a string to the current cursor position. | |
| bool | TryWrite8 (uint8_t val) |
| Write a uint8_t to the current cursor position. | |
| bool | TryWrite16 (uint16_t val) |
| Write a uint16_t to the current cursor position. | |
| bool | TryWrite32 (uint32_t val) |
| Write a uint32_t to the current cursor position. | |
| bool | TryWrite64 (uint64_t val) |
| Write a uint64_t to the current cursor position. | |
| bool | TryWriteLE16 (uint16_t val) |
| bool | TryWriteLE32 (uint32_t val) |
| bool | TryWriteLE64 (uint64_t val) |
| bool | TryWriteBE16 (uint16_t val) |
| bool | TryWriteBE32 (uint32_t val) |
| bool | TryWriteBE64 (uint64_t val) |
| uint64_t | GetOffset () const |
| Get the current cursor position. | |
| void | Seek (uint64_t offset) |
| Set the current cursor position. | |
| void | SeekRelative (int64_t offset) |
| Set the cursor position relative to the current cursor position. | |
◆ BinaryWriter()
Create a BinaryWriter instance given a BinaryView and endianness.
- Parameters
-
data BinaryView to write to endian Byte order to write with. One of LittleEndian, BigEndian
◆ ~BinaryWriter()
| BinaryWriter::~BinaryWriter | ( | ) |
◆ GetEndianness()
Get the endianness set for this writer.
- Returns
- The endianness set for this writer.
◆ SetEndianness()
Set the endianness for this writer.
- Parameters
-
endian Byte order to write with. One of LittleEndian, BigEndian
◆ Write() [1/3]
| void BinaryWriter::Write | ( | const void * | src, |
| size_t | len ) |
Write bytes from an address to the current cursor position.
- Exceptions
-
WriteException on out of bounds write
- Parameters
-
src Address to read the bytes from len Amount of bytes to write
◆ Write() [2/3]
| void BinaryWriter::Write | ( | const DataBuffer & | buf | ) |
Write the contents of a DataBuffer to the current cursor position.
- Exceptions
-
WriteException on out of bounds write
- Parameters
◆ Write() [3/3]
| void BinaryNinja::BinaryWriter::Write | ( | const std::string & | str | ) |
Write the contents of a string to the current cursor position.
- Exceptions
-
WriteException on out of bounds write
- Parameters
◆ Write8()
| void BinaryWriter::Write8 | ( | uint8_t | val | ) |
Write a uint8_t to the current cursor position.
- Exceptions
-
WriteException on out of bounds write
- Parameters
◆ Write16()
| void BinaryWriter::Write16 | ( | uint16_t | val | ) |
Write a uint16_t to the current cursor position.
- Exceptions
-
WriteException on out of bounds write
- Parameters
◆ Write32()
| void BinaryWriter::Write32 | ( | uint32_t | val | ) |
Write a uint32_t to the current cursor position.
- Exceptions
-
WriteException on out of bounds write
- Parameters
◆ Write64()
| void BinaryWriter::Write64 | ( | uint64_t | val | ) |
Write a uint64_t to the current cursor position.
- Exceptions
-
WriteException on out of bounds write
- Parameters
◆ WriteLE16()
| void BinaryWriter::WriteLE16 | ( | uint16_t | val | ) |
Write a uint16_t to the current cursor position, explicitly as little endian.
- Exceptions
-
WriteException on out of bounds write
- Parameters
◆ WriteLE32()
| void BinaryWriter::WriteLE32 | ( | uint32_t | val | ) |
Write a uint32_t to the current cursor position, explicitly as little endian.
- Exceptions
-
WriteException on out of bounds write
- Parameters
◆ WriteLE64()
| void BinaryWriter::WriteLE64 | ( | uint64_t | val | ) |
Write a uint64_t to the current cursor position, explicitly as little endian.
- Exceptions
-
WriteException on out of bounds write
- Parameters
◆ WriteBE16()
| void BinaryWriter::WriteBE16 | ( | uint16_t | val | ) |
Write a uint16_t to the current cursor position, explicitly as big endian.
- Exceptions
-
WriteException on out of bounds write
- Parameters
◆ WriteBE32()
| void BinaryWriter::WriteBE32 | ( | uint32_t | val | ) |
Write a uint32_t to the current cursor position, explicitly as big endian.
- Exceptions
-
WriteException on out of bounds write
- Parameters
◆ WriteBE64()
| void BinaryWriter::WriteBE64 | ( | uint64_t | val | ) |
Write a uint64_t to the current cursor position, explicitly as big endian.
- Exceptions
-
WriteException on out of bounds write
- Parameters
◆ TryWrite() [1/3]
| bool BinaryWriter::TryWrite | ( | const void * | src, |
| size_t | len ) |
Write bytes from an address to the current cursor position.
- Parameters
-
src Address to read the bytes from len Amount of bytes to write
- Returns
- Whether the write succeeded
◆ TryWrite() [2/3]
| bool BinaryWriter::TryWrite | ( | const DataBuffer & | buf | ) |
Write from a DataBuffer to the current cursor position.
- Parameters
- Returns
- Whether the write succeeded
◆ TryWrite() [3/3]
| bool BinaryNinja::BinaryWriter::TryWrite | ( | const std::string & | str | ) |
Write a string to the current cursor position.
- Parameters
- Returns
- Whether the write succeeded
◆ TryWrite8()
| bool BinaryWriter::TryWrite8 | ( | uint8_t | val | ) |
Write a uint8_t to the current cursor position.
- Parameters
- Returns
- Whether the write succeeded
◆ TryWrite16()
| bool BinaryWriter::TryWrite16 | ( | uint16_t | val | ) |
Write a uint16_t to the current cursor position.
- Parameters
- Returns
- Whether the write succeeded
◆ TryWrite32()
| bool BinaryWriter::TryWrite32 | ( | uint32_t | val | ) |
Write a uint32_t to the current cursor position.
- Parameters
- Returns
- Whether the write succeeded
◆ TryWrite64()
| bool BinaryWriter::TryWrite64 | ( | uint64_t | val | ) |
Write a uint64_t to the current cursor position.
- Parameters
- Returns
- Whether the write succeeded
◆ TryWriteLE16()
| bool BinaryWriter::TryWriteLE16 | ( | uint16_t | val | ) |
◆ TryWriteLE32()
| bool BinaryWriter::TryWriteLE32 | ( | uint32_t | val | ) |
◆ TryWriteLE64()
| bool BinaryWriter::TryWriteLE64 | ( | uint64_t | val | ) |
◆ TryWriteBE16()
| bool BinaryWriter::TryWriteBE16 | ( | uint16_t | val | ) |
◆ TryWriteBE32()
| bool BinaryWriter::TryWriteBE32 | ( | uint32_t | val | ) |
◆ TryWriteBE64()
| bool BinaryWriter::TryWriteBE64 | ( | uint64_t | val | ) |
◆ GetOffset()
| uint64_t BinaryWriter::GetOffset | ( | ) | const |
Get the current cursor position.
- Returns
- The current cursor position
◆ Seek()
| void BinaryWriter::Seek | ( | uint64_t | offset | ) |
Set the current cursor position.
- Parameters
-
offset The new cursor position
◆ SeekRelative()
| void BinaryWriter::SeekRelative | ( | int64_t | offset | ) |
Set the cursor position relative to the current cursor position.
- Parameters
-
offset Offset to the current cursor position
◆ BinaryNinja::TypeArchive
class BinaryNinja::TypeArchive
Type Archives are a collection of types which can be shared between different analysis sessions and are backed by a database file on disk.
Their types can be modified, and a history of previous versions of types is stored in snapshots in the archive.
Public Member Functions | |
| TypeArchive (BNTypeArchive *archive) | |
| std::string | GetId () const |
| Get the unique id associated with this type archive. | |
| std::string | GetPath () const |
| Get the path to the type archive. | |
| Ref< Platform > | GetPlatform () const |
| Get the associated Platform for a Type Archive. | |
| std::string | GetCurrentSnapshotId () const |
| Get the id of the current snapshot in the type archive. | |
| void | SetCurrentSnapshot (const std::string &id) |
| Revert the type archive's current snapshot to the given snapshot. | |
| std::vector< std::string > | GetAllSnapshotIds () const |
| Get a list of every snapshot's id. | |
| std::vector< std::string > | GetSnapshotParentIds (const std::string &id) const |
| Get the ids of the parents to the given snapshot. | |
| std::vector< std::string > | GetSnapshotChildIds (const std::string &id) const |
| Get the ids of the children to the given snapshot. | |
| class TypeContainer | GetTypeContainer () const |
| Get the TypeContainer interface for this Type Archive, presenting types at the current snapshot in the archive. | |
| bool | AddTypes (const std::vector< QualifiedNameAndType > &types) |
| Add named types to the type archive. | |
| bool | RenameType (const std::string &id, const QualifiedName &newName) |
| Change the name of an existing type in the type archive. | |
| bool | DeleteType (const std::string &id) |
| Delete an existing type in the type archive. | |
| Ref< Type > | GetTypeById (const std::string &id, std::string snapshot="") const |
| Retrieve a stored type in the archive by id. | |
| Ref< Type > | GetTypeByName (const QualifiedName &name, std::string snapshot="") const |
| Retrieve a stored type in the archive. | |
| std::string | GetTypeId (const QualifiedName &name, std::string snapshot="") const |
| Retrieve a type's id by its name. | |
| QualifiedName | GetTypeName (const std::string &id, std::string snapshot="") const |
| Retrieve a type's name by its id. | |
| std::unordered_map< std::string, QualifiedNameAndType > | GetTypes (std::string snapshot="") const |
| Retrieve all stored types in the archive. | |
| std::vector< std::string > | GetTypeIds (std::string snapshot="") const |
| Get a list of all types' ids currently in the archive. | |
| std::vector< QualifiedName > | GetTypeNames (std::string snapshot="") const |
| Get a list of all types' names currently in the archive. | |
| std::unordered_map< std::string, QualifiedName > | GetTypeNamesAndIds (std::string snapshot="") const |
| Get a list of all types' names and ids currently in the archive. | |
| std::unordered_set< std::string > | GetOutgoingDirectTypeReferences (const std::string &id, std::string snapshot="") const |
| Get all types a given type references directly. | |
| std::unordered_set< std::string > | GetOutgoingRecursiveTypeReferences (const std::string &id, std::string snapshot="") const |
| Get all types a given type references, and any types that the referenced types reference. | |
| std::unordered_set< std::string > | GetIncomingDirectTypeReferences (const std::string &id, std::string snapshot="") const |
| Get all types that reference a given type. | |
| std::unordered_set< std::string > | GetIncomingRecursiveTypeReferences (const std::string &id, std::string snapshot="") const |
| Get all types that reference a given type, and all types that reference them, recursively. | |
| std::string | NewSnapshotTransaction (std::function< void(const std::string &id)> func, const std::vector< std::string > &parents) |
| Do some function in a transaction making a new snapshot whose id is passed to func. | |
| void | RegisterNotification (TypeArchiveNotification *notification) |
| Register a notification listener. | |
| void | UnregisterNotification (TypeArchiveNotification *notification) |
| Unregister a notification listener. | |
| void | StoreMetadata (const std::string &key, Ref< Metadata > value) |
| Store a key/value pair in the archive's metadata storage. | |
| Ref< Metadata > | QueryMetadata (const std::string &key) const |
| Look up a metadata entry in the archive. | |
| void | RemoveMetadata (const std::string &key) |
| Delete a given metadata entry in the archive. | |
| DataBuffer | SerializeSnapshot (const std::string &snapshot) const |
| Turn a given snapshot into a data stream. | |
| std::string | DeserializeSnapshot (const DataBuffer &data) |
| Take a serialized snapshot data stream and create a new snapshot from it. | |
| std::optional< std::string > | MergeSnapshots (const std::string &baseSnapshot, const std::string &firstSnapshot, const std::string &secondSnapshot, const std::unordered_map< std::string, std::string > &mergeConflictsIn, std::unordered_set< std::string > &mergeConflictsOut, ProgressFunction progress) |
| Merge two snapshots in the archive to produce a new snapshot. | |
| Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNTypeArchive, BNNewTypeArchiveReference, BNFreeTypeArchiveReference > | |
| CoreRefCountObject () | |
| virtual | ~CoreRefCountObject () |
| BNTypeArchive * | GetObject () const |
| void | AddRef () |
| void | Release () |
| void | AddRefForRegistration () |
| void | ReleaseForRegistration () |
| void | AddRefForCallback () |
| void | ReleaseForCallback () |
Static Public Member Functions | |
| static Ref< TypeArchive > | Open (const std::string &path) |
| Open the type archive at the given path, if it exists. | |
| static Ref< TypeArchive > | Create (const std::string &path, Ref< Platform > platform) |
| Create a type archive at the given path. | |
| static Ref< TypeArchive > | CreateWithId (const std::string &path, Ref< Platform > platform, const std::string &id) |
| Create a type archive at the given path with a manually-specified id. | |
| static Ref< TypeArchive > | LookupById (const std::string &id) |
| Get a reference to the type archive with the known id, if one exists. | |
| static void | Close (Ref< TypeArchive > archive) |
| Close a type archive, disconnecting it from any active views and closing any open file handles. | |
| static bool | IsTypeArchive (const std::string &path) |
| Determine if a file is a Type Archive. | |
◆ TypeArchive()
◆ Open()
|
static |
Open the type archive at the given path, if it exists.
- Parameters
-
path Path to type archive file
- Returns
- Type archive, or nullptr if it could not be loaded.
◆ Create()
|
static |
Create a type archive at the given path.
- Parameters
-
path Path to type archive file platform Relevant platform for types in the archive
- Returns
- Type archive, or nullptr if it could not be loaded.
◆ CreateWithId()
|
static |
Create a type archive at the given path with a manually-specified id.
- Note
- You probably want to use Create() and let BN handle picking an id for you.
- Parameters
-
path Path to type archive file platform Relevant platform for types in the archive id Assigned id for the type archive
- Returns
- Type archive, or nullptr if it could not be created.
◆ LookupById()
|
static |
Get a reference to the type archive with the known id, if one exists.
- Parameters
- Returns
- Type archive, or nullptr if it could not be found.
◆ Close()
|
static |
Close a type archive, disconnecting it from any active views and closing any open file handles.
- Parameters
-
archive Type Archive to close
◆ IsTypeArchive()
|
static |
◆ GetId()
| std::string TypeArchive::GetId | ( | ) | const |
Get the unique id associated with this type archive.
- Returns
- The id
◆ GetPath()
| std::string TypeArchive::GetPath | ( | ) | const |
Get the path to the type archive.
- Returns
- The path
◆ GetPlatform()
◆ GetCurrentSnapshotId()
| std::string TypeArchive::GetCurrentSnapshotId | ( | ) | const |
◆ SetCurrentSnapshot()
| void TypeArchive::SetCurrentSnapshot | ( | const std::string & | id | ) |
Revert the type archive's current snapshot to the given snapshot.
- Parameters
◆ GetAllSnapshotIds()
| std::vector< std::string > TypeArchive::GetAllSnapshotIds | ( | ) | const |
Get a list of every snapshot's id.
- Exceptions
- Returns
- All ids (including the empty first snapshot)
◆ GetSnapshotParentIds()
| std::vector< std::string > TypeArchive::GetSnapshotParentIds | ( | const std::string & | id | ) | const |
Get the ids of the parents to the given snapshot.
- Parameters
- Exceptions
- Returns
- Parent snapshot ids, or empty vector if the snapshot is a root
◆ GetSnapshotChildIds()
| std::vector< std::string > TypeArchive::GetSnapshotChildIds | ( | const std::string & | id | ) | const |
Get the ids of the children to the given snapshot.
- Parameters
- Exceptions
- Returns
- Child snapshot ids, or empty vector if the snapshot is a leaf
◆ GetTypeContainer()
◆ AddTypes()
Add named types to the type archive.
Types must have all dependant named types prior to being added, or this function will fail. Types already existing with any added names will be overwritten.
- Parameters
-
name Name of new type types Type definitions
- Returns
- True if the types were added
◆ RenameType()
| bool TypeArchive::RenameType | ( | const std::string & | id, |
| const QualifiedName & | newName ) |
Change the name of an existing type in the type archive.
- Parameters
-
id Type id newName New type name
- Returns
- True if successful
◆ DeleteType()
| bool TypeArchive::DeleteType | ( | const std::string & | id | ) |
Delete an existing type in the type archive.
- Parameters
- Returns
- True if successful
◆ GetTypeById()
◆ GetTypeByName()
| Ref< Type > TypeArchive::GetTypeByName | ( | const QualifiedName & | name, |
| std::string | snapshot = "" ) const |
◆ GetTypeId()
| std::string TypeArchive::GetTypeId | ( | const QualifiedName & | name, |
| std::string | snapshot = "" ) const |
◆ GetTypeName()
| QualifiedName TypeArchive::GetTypeName | ( | const std::string & | id, |
| std::string | snapshot = "" ) const |
◆ GetTypes()
| std::unordered_map< std::string, QualifiedNameAndType > TypeArchive::GetTypes | ( | std::string | snapshot = "" | ) | const |
Retrieve all stored types in the archive.
- Parameters
-
snapshot Snapshot id to search for types, or empty string to search the latest snapshot
- Exceptions
- Returns
- All types
◆ GetTypeIds()
| std::vector< std::string > TypeArchive::GetTypeIds | ( | std::string | snapshot = "" | ) | const |
Get a list of all types' ids currently in the archive.
- Parameters
-
snapshot Snapshot id to search for types, or empty string to search the latest snapshot
- Exceptions
- Returns
- All type ids
◆ GetTypeNames()
| std::vector< QualifiedName > TypeArchive::GetTypeNames | ( | std::string | snapshot = "" | ) | const |
Get a list of all types' names currently in the archive.
- Parameters
-
snapshot Snapshot id to search for types, or empty string to search the latest snapshot
- Exceptions
- Returns
- All type names
◆ GetTypeNamesAndIds()
| std::unordered_map< std::string, QualifiedName > TypeArchive::GetTypeNamesAndIds | ( | std::string | snapshot = "" | ) | const |
Get a list of all types' names and ids currently in the archive.
- Parameters
-
snapshot Snapshot id to search for types, or empty string to search the latest snapshot
- Exceptions
- Returns
- All type names and ids
◆ GetOutgoingDirectTypeReferences()
| std::unordered_set< std::string > TypeArchive::GetOutgoingDirectTypeReferences | ( | const std::string & | id, |
| std::string | snapshot = "" ) const |
Get all types a given type references directly.
- Parameters
-
id Source type id snapshot Snapshot id to search for types, or empty string to search the latest snapshot
- Exceptions
- Returns
- Target type ids
◆ GetOutgoingRecursiveTypeReferences()
| std::unordered_set< std::string > TypeArchive::GetOutgoingRecursiveTypeReferences | ( | const std::string & | id, |
| std::string | snapshot = "" ) const |
Get all types a given type references, and any types that the referenced types reference.
- Parameters
-
id Source type id snapshot Snapshot id to search for types, or empty string to search the latest snapshot
- Exceptions
- Returns
- Target type ids
◆ GetIncomingDirectTypeReferences()
| std::unordered_set< std::string > TypeArchive::GetIncomingDirectTypeReferences | ( | const std::string & | id, |
| std::string | snapshot = "" ) const |
Get all types that reference a given type.
- Parameters
-
id Target type id snapshot Snapshot id to search for types, or empty string to search the latest snapshot
- Exceptions
- Returns
- Source type ids
◆ GetIncomingRecursiveTypeReferences()
| std::unordered_set< std::string > TypeArchive::GetIncomingRecursiveTypeReferences | ( | const std::string & | id, |
| std::string | snapshot = "" ) const |
Get all types that reference a given type, and all types that reference them, recursively.
- Parameters
-
id Target type id snapshot Snapshot id to search for types, or empty string to search the latest snapshot
- Exceptions
- Returns
- Source type ids
◆ NewSnapshotTransaction()
| std::string TypeArchive::NewSnapshotTransaction | ( | std::function< void(const std::string &id)> | func, |
| const std::vector< std::string > & | parents ) |
Do some function in a transaction making a new snapshot whose id is passed to func.
If func throws, the transaction will be rolled back and the snapshot will not be created.
- Parameters
-
func Function to call parents Parent snapshot ids
- Exceptions
- Returns
- Created snapshot id
◆ RegisterNotification()
Register a notification listener.
- Parameters
-
notification Object to receive notifications
◆ UnregisterNotification()
Unregister a notification listener.
- Parameters
-
notification Object to no longer receive notifications
◆ StoreMetadata()
◆ QueryMetadata()
Look up a metadata entry in the archive.
- Parameters
- Returns
- Metadata value, if it exists. Otherwise, nullptr
◆ RemoveMetadata()
| void TypeArchive::RemoveMetadata | ( | const std::string & | key | ) |
Delete a given metadata entry in the archive.
- Parameters
- Exceptions
◆ SerializeSnapshot()
| DataBuffer TypeArchive::SerializeSnapshot | ( | const std::string & | snapshot | ) | const |
Turn a given snapshot into a data stream.
- Parameters
- Returns
- Buffer containing serialized snapshot data
◆ DeserializeSnapshot()
| std::string TypeArchive::DeserializeSnapshot | ( | const DataBuffer & | data | ) |
Take a serialized snapshot data stream and create a new snapshot from it.
- Parameters
- Exceptions
- Returns
- String of created snapshot id
◆ MergeSnapshots()
| std::optional< std::string > TypeArchive::MergeSnapshots | ( | const std::string & | baseSnapshot, |
| const std::string & | firstSnapshot, | ||
| const std::string & | secondSnapshot, | ||
| const std::unordered_map< std::string, std::string > & | mergeConflictsIn, | ||
| std::unordered_set< std::string > & | mergeConflictsOut, | ||
| ProgressFunction | progress ) |
Merge two snapshots in the archive to produce a new snapshot.
- Parameters
-
[in] baseSnapshot Common ancestor of snapshots [in] firstSnapshot First snapshot to merge [in] secondSnapshot Second snapshot to merge [in] mergeConflictsIn Map of resolutions for all conflicting types, id <-> target snapshot [out] mergeConflictsOut List of conflicting type ids [in] progress Function to call for progress updates
- Exceptions
- Returns
- Snapshot id, if merge was successful. std::nullopt, otherwise