Classes | |
class | BinaryNinja::NavigationHandler |
class | BinaryNinja::SaveSettings |
class | BinaryNinja::FileMetadata |
class BinaryNinja::NavigationHandler |
Public Member Functions | |
NavigationHandler () | |
virtual | ~NavigationHandler () |
BNNavigationHandler * | GetCallbacks () |
virtual std::string | GetCurrentView ()=0 |
virtual uint64_t | GetCurrentOffset ()=0 |
virtual bool | Navigate (const std::string &view, uint64_t offset)=0 |
NavigationHandler::NavigationHandler | ( | ) |
|
inlinevirtual |
|
inline |
|
pure virtual |
Implemented in FileContext.
|
pure virtual |
Implemented in FileContext.
|
pure virtual |
Implemented in FileContext.
class BinaryNinja::SaveSettings |
Public Member Functions | |
SaveSettings () | |
SaveSettings (BNSaveSettings *settings) | |
bool | IsOptionSet (BNSaveOption option) const |
void | SetOption (BNSaveOption option, bool state=true) |
std::string | GetName () const |
void | SetName (const std::string &name) |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNSaveSettings, BNNewSaveSettingsReference, BNFreeSaveSettings > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNSaveSettings * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNSaveSettings, BNNewSaveSettingsReference, BNFreeSaveSettings > | |
static BNSaveSettings * | GetObject (CoreRefCountObject *obj) |
static BNSaveSettings * | GetObject (const CoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNSaveSettings, BNNewSaveSettingsReference, BNFreeSaveSettings > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNSaveSettings * | m_object |
SaveSettings::SaveSettings | ( | ) |
SaveSettings::SaveSettings | ( | BNSaveSettings * | settings | ) |
bool SaveSettings::IsOptionSet | ( | BNSaveOption | option | ) | const |
void SaveSettings::SetOption | ( | BNSaveOption | option, |
bool | state = true ) |
std::string SaveSettings::GetName | ( | ) | const |
void SaveSettings::SetName | ( | const std::string & | name | ) |
class BinaryNinja::FileMetadata |
Public Member Functions | |
FileMetadata () | |
FileMetadata (const std::string &filename) | |
FileMetadata (Ref< ProjectFile > projectFile) | |
FileMetadata (BNFileMetadata *file) | |
void | Close () |
Close the underlying file handle. | |
void | SetNavigationHandler (NavigationHandler *handler) |
std::string | GetOriginalFilename () const |
Get the original name of the binary opened if a bndb, otherwise the current filename. | |
void | SetOriginalFilename (const std::string &name) |
If the filename is not open in a BNDB, sets the filename for the current file. | |
std::string | GetFilename () const |
void | SetFilename (const std::string &name) |
Set the filename for the current BNDB or binary. | |
bool | IsModified () const |
Whether the file has unsaved modifications. | |
bool | IsAnalysisChanged () const |
Whether auto-analysis results have changed. | |
void | MarkFileModified () |
Mark file as having unsaved changes. | |
void | MarkFileSaved () |
Mark file as having been saved (inverse of MarkFileModified) | |
bool | IsSnapshotDataAppliedWithoutError () const |
bool | IsBackedByDatabase (const std::string &binaryViewType="") const |
Whether the FileMetadata is backed by a database, or if specified, a specific BinaryView type. | |
bool | CreateDatabase (const std::string &name, BinaryView *data, Ref< SaveSettings > settings) |
Writes the current database (.bndb) out to the specified file. | |
bool | CreateDatabase (const std::string &name, BinaryView *data, const std::function< bool(size_t progress, size_t total)> &progressCallback, Ref< SaveSettings > settings) |
Writes the current database (.bndb) out to the specified file. | |
Ref< BinaryView > | OpenExistingDatabase (const std::string &path) |
Open an existing database from a given path. | |
Ref< BinaryView > | OpenExistingDatabase (const std::string &path, const std::function< bool(size_t progress, size_t total)> &progressCallback) |
Open an existing database from a given path with a progress callback. | |
Ref< BinaryView > | OpenDatabaseForConfiguration (const std::string &path) |
bool | SaveAutoSnapshot (BinaryView *data, Ref< SaveSettings > settings) |
Save the current database to the already created file. | |
bool | SaveAutoSnapshot (BinaryView *data, const std::function< bool(size_t progress, size_t total)> &progressCallback, Ref< SaveSettings > settings) |
Save the current database to the already created file. | |
void | GetSnapshotData (Ref< KeyValueStore > data, Ref< KeyValueStore > cache, const std::function< bool(size_t, size_t)> &progress) |
void | ApplySnapshotData (BinaryView *file, Ref< KeyValueStore > data, Ref< KeyValueStore > cache, const std::function< bool(size_t, size_t)> &progress, bool openForConfiguration=false, bool restoreRawView=true) |
Ref< Database > | GetDatabase () |
bool | Rebase (BinaryView *data, uint64_t address) |
Rebase the given BinaryView to a new address. | |
bool | Rebase (BinaryView *data, uint64_t address, const std::function< bool(size_t progress, size_t total)> &progressCallback) |
Rebase the given BinaryView to a new address. | |
bool | CreateSnapshotedView (BinaryView *data, const std::string &viewName) |
bool | CreateSnapshotedView (BinaryView *data, const std::string &viewName, const std::function< bool(size_t progress, size_t total)> &progressCallback) |
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 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::vector< Ref< User > > | GetUsers () |
std::vector< Ref< UndoEntry > > | GetUndoEntries () |
std::vector< Ref< UndoEntry > > | GetRedoEntries () |
Ref< UndoEntry > | GetLastUndoEntry () |
Ref< UndoEntry > | GetLastRedoEntry () |
std::optional< std::string > | GetLastUndoEntryTitle () |
std::optional< std::string > | GetLastRedoEntryTitle () |
void | ClearUndoEntries () |
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. | |
BinaryNinja::Ref< BinaryNinja::BinaryView > | GetViewOfType (const std::string &name) |
Get the BinaryView for a specific View type. | |
std::vector< std::string > | GetExistingViews () const |
List of View names that exist within the current file. | |
size_t | GetSessionId () const |
Get the current Session ID for this file. | |
void | UnregisterViewOfType (const std::string &type, BinaryNinja::Ref< BinaryNinja::BinaryView > data) |
Explicitly unregister a binary view of the given type from this file. | |
Ref< ProjectFile > | GetProjectFile () const |
void | SetProjectFile (Ref< ProjectFile > projectFile) |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNFileMetadata, BNNewFileReference, BNFreeFileMetadata > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNFileMetadata * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNFileMetadata, BNNewFileReference, BNFreeFileMetadata > | |
static BNFileMetadata * | GetObject (CoreRefCountObject *obj) |
static BNFileMetadata * | GetObject (const CoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNFileMetadata, BNNewFileReference, BNFreeFileMetadata > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNFileMetadata * | m_object |
FileMetadata::FileMetadata | ( | ) |
BinaryNinja::FileMetadata::FileMetadata | ( | const std::string & | filename | ) |
FileMetadata::FileMetadata | ( | Ref< ProjectFile > | projectFile | ) |
FileMetadata::FileMetadata | ( | BNFileMetadata * | file | ) |
void FileMetadata::Close | ( | ) |
Close the underlying file handle.
void FileMetadata::SetNavigationHandler | ( | NavigationHandler * | handler | ) |
string FileMetadata::GetOriginalFilename | ( | ) | const |
Get the original name of the binary opened if a bndb, otherwise the current filename.
void FileMetadata::SetOriginalFilename | ( | const std::string & | name | ) |
If the filename is not open in a BNDB, sets the filename for the current file.
name | New name |
string FileMetadata::GetFilename | ( | ) | const |
void FileMetadata::SetFilename | ( | const std::string & | name | ) |
Set the filename for the current BNDB or binary.
name | Set the filename for the current BNDB or binary. |
bool FileMetadata::IsModified | ( | ) | const |
Whether the file has unsaved modifications.
bool FileMetadata::IsAnalysisChanged | ( | ) | const |
Whether auto-analysis results have changed.
void FileMetadata::MarkFileModified | ( | ) |
Mark file as having unsaved changes.
void FileMetadata::MarkFileSaved | ( | ) |
Mark file as having been saved (inverse of MarkFileModified)
bool FileMetadata::IsSnapshotDataAppliedWithoutError | ( | ) | const |
bool FileMetadata::IsBackedByDatabase | ( | const std::string & | binaryViewType = "" | ) | const |
Whether the FileMetadata is backed by a database, or if specified, a specific BinaryView type.
binaryViewType | Type for the BinaryView |
bool BinaryNinja::FileMetadata::CreateDatabase | ( | const std::string & | name, |
BinaryView * | data, | ||
Ref< SaveSettings > | settings ) |
Writes the current database (.bndb) out to the specified file.
name | path and filename to write the bndb to. Should have ".bndb" appended to it. |
data | BinaryView to save the database from |
settings | Special save options |
bool BinaryNinja::FileMetadata::CreateDatabase | ( | const std::string & | name, |
BinaryView * | data, | ||
const std::function< bool(size_t progress, size_t total)> & | progressCallback, | ||
Ref< SaveSettings > | settings ) |
Writes the current database (.bndb) out to the specified file.
name | path and filename to write the bndb to. Should have ".bndb" appended to it. |
data | BinaryView to save the database from |
progressCallback | callback function to send save progress to. |
settings | Special save options |
Ref< BinaryView > BinaryNinja::FileMetadata::OpenExistingDatabase | ( | const std::string & | path | ) |
Open an existing database from a given path.
path | Path to the existing database |
Ref< BinaryView > BinaryNinja::FileMetadata::OpenExistingDatabase | ( | const std::string & | path, |
const std::function< bool(size_t progress, size_t total)> & | progressCallback ) |
Open an existing database from a given path with a progress callback.
path | Path to the existing database |
progressCallback | callback function to send load progress to. |
Ref< BinaryView > FileMetadata::OpenDatabaseForConfiguration | ( | const std::string & | path | ) |
bool FileMetadata::SaveAutoSnapshot | ( | BinaryView * | data, |
Ref< SaveSettings > | settings ) |
Save the current database to the already created file.
Note: CreateDatabase should have been called prior to calling this.
data | BinaryView to save the data of |
settings | Special save options |
bool BinaryNinja::FileMetadata::SaveAutoSnapshot | ( | BinaryView * | data, |
const std::function< bool(size_t progress, size_t total)> & | progressCallback, | ||
Ref< SaveSettings > | settings ) |
Save the current database to the already created file.
Note: CreateDatabase should have been called prior to calling this.
data | BinaryView to save the data of |
settings | Special save options |
progressCallback | callback function to send save progress to |
void FileMetadata::GetSnapshotData | ( | Ref< KeyValueStore > | data, |
Ref< KeyValueStore > | cache, | ||
const std::function< bool(size_t, size_t)> & | progress ) |
void FileMetadata::ApplySnapshotData | ( | BinaryView * | file, |
Ref< KeyValueStore > | data, | ||
Ref< KeyValueStore > | cache, | ||
const std::function< bool(size_t, size_t)> & | progress, | ||
bool | openForConfiguration = false, | ||
bool | restoreRawView = true ) |
bool FileMetadata::Rebase | ( | BinaryView * | data, |
uint64_t | address ) |
Rebase the given BinaryView to a new address.
data | BinaryView to rebase |
address | Address to rebase to |
bool BinaryNinja::FileMetadata::Rebase | ( | BinaryView * | data, |
uint64_t | address, | ||
const std::function< bool(size_t progress, size_t total)> & | progressCallback ) |
Rebase the given BinaryView to a new address.
data | BinaryView to rebase |
address | Address to rebase to |
progressCallback | Callback function to pass rebase progress to |
bool FileMetadata::CreateSnapshotedView | ( | BinaryView * | data, |
const std::string & | viewName ) |
bool BinaryNinja::FileMetadata::CreateSnapshotedView | ( | BinaryView * | data, |
const std::string & | viewName, | ||
const std::function< bool(size_t progress, size_t total)> & | progressCallback ) |
bool FileMetadata::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.
func | Function to run in undo context |
std::exception | If the called function throws an exception |
|
nodiscard |
Start recording actions taken so they can be undone at some point.
anonymousAllowed | Legacy interop: prevent empty calls to CommitUndoActions from affecting this undo state. Specifically for RunUndoableTransaction. |
void FileMetadata::CommitUndoActions | ( | const std::string & | id | ) |
Commit the actions taken since a call to BeginUndoActions.
id | Id of UndoEntry created by BeginUndoActions |
void FileMetadata::RevertUndoActions | ( | const std::string & | id | ) |
Revert the actions taken since a call to BeginUndoActions.
id | Id of UndoEntry created by BeginUndoActions |
void FileMetadata::ForgetUndoActions | ( | const std::string & | id | ) |
Forget the actions since a call to BeginUndoActions.
id | Id of UndoEntry created by BeginUndoActions |
bool FileMetadata::CanUndo | ( | ) |
bool FileMetadata::Undo | ( | ) |
Undo the last committed action in the undo database.
bool FileMetadata::CanRedo | ( | ) |
bool FileMetadata::Redo | ( | ) |
Redo the last committed action in the undo database.
std::optional< std::string > FileMetadata::GetLastUndoEntryTitle | ( | ) |
std::optional< std::string > FileMetadata::GetLastRedoEntryTitle | ( | ) |
void FileMetadata::ClearUndoEntries | ( | ) |
string FileMetadata::GetCurrentView | ( | ) |
uint64_t FileMetadata::GetCurrentOffset | ( | ) |
Get the current offset in the current view.
bool FileMetadata::Navigate | ( | const std::string & | view, |
uint64_t | offset ) |
Navigate to the specified virtual address in the specified view.
view | View name. e.g. ``Linear:ELF``, ``Graph:PE`` |
offset | Virtual address to navigate to |
Ref< BinaryView > FileMetadata::GetViewOfType | ( | const std::string & | name | ) |
Get the BinaryView for a specific View type.
name | View name. e.g. ``Linear:ELF``, ``Graph:PE`` |
std::vector< std::string > FileMetadata::GetExistingViews | ( | ) | const |
size_t FileMetadata::GetSessionId | ( | ) | const |
Get the current Session ID for this file.
void FileMetadata::UnregisterViewOfType | ( | const std::string & | type, |
BinaryNinja::Ref< BinaryNinja::BinaryView > | data ) |
Explicitly unregister a binary view of the given type from this file.
Only use this function when you wish to explicitly remove the binary view from the file. For example, in the debugger, this method is used to remove the Debugger view from the file after the target exits.
This also does not necessarily free the binary, because there could be other references to it.
type | the type of the view to unregister |
data | the binary view to unregister |
Ref< ProjectFile > FileMetadata::GetProjectFile | ( | ) | const |
void FileMetadata::SetProjectFile | ( | Ref< ProjectFile > | projectFile | ) |