Loading...
Searching...
No Matches
Database

Detailed Description

Classes

struct  BinaryNinja::DatabaseException
 
class  BinaryNinja::KeyValueStore
 Maintains access to the raw data stored in Snapshots and various other Database-related structures. More...
 
class  BinaryNinja::Snapshot
 A model of an individual database snapshot, created on save. More...
 
class  BinaryNinja::Database
 Provides lower level access to raw snapshot data used to construct analysis data. More...
 

Class Documentation

◆ BinaryNinja::DatabaseException

struct BinaryNinja::DatabaseException

Public Member Functions

 DatabaseException (const std::string &desc)
 
- Public Member Functions inherited from BinaryNinja::ExceptionWithStackTrace
 ExceptionWithStackTrace (const std::string &message)
 
 ExceptionWithStackTrace (std::exception_ptr exc1, std::exception_ptr exc2)
 
const char * what () const noexcept override
 

Additional Inherited Members

- Public Attributes inherited from BinaryNinja::ExceptionWithStackTrace
std::string m_originalMessage
 
std::string m_message
 
std::string m_stackTrace
 

Constructor & Destructor Documentation

◆ DatabaseException()

BinaryNinja::DatabaseException::DatabaseException ( const std::string & desc)
inline

◆ BinaryNinja::KeyValueStore

class BinaryNinja::KeyValueStore

Maintains access to the raw data stored in Snapshots and various other Database-related structures.

Public Member Functions

 KeyValueStore ()
 
 KeyValueStore (const DataBuffer &buffer)
 
 KeyValueStore (BNKeyValueStore *store)
 
std::vector< std::string > GetKeys () const
 
bool HasValue (const std::string &name) const
 
Json::Value GetValue (const std::string &name) const
 
DataBuffer GetValueHash (const std::string &name) const
 
DataBuffer GetBuffer (const std::string &name) const
 
void SetValue (const std::string &name, const Json::Value &value)
 
void SetBuffer (const std::string &name, const DataBuffer &value)
 
DataBuffer GetSerializedData () const
 
void BeginNamespace (const std::string &name)
 
void EndNamespace ()
 
bool IsEmpty () const
 
size_t ValueSize () const
 
size_t DataSize () const
 
size_t ValueStorageSize () const
 
size_t NamespaceSize () const
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNKeyValueStore, BNNewKeyValueStoreReference, BNFreeKeyValueStore >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNKeyValueStoreGetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNKeyValueStore, BNNewKeyValueStoreReference, BNFreeKeyValueStore >
static BNKeyValueStoreGetObject (CoreRefCountObject *obj)
 
static BNKeyValueStoreGetObject (const CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNKeyValueStore, BNNewKeyValueStoreReference, BNFreeKeyValueStore >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNKeyValueStorem_object
 

Constructor & Destructor Documentation

◆ KeyValueStore() [1/3]

KeyValueStore::KeyValueStore ( )

◆ KeyValueStore() [2/3]

KeyValueStore::KeyValueStore ( const DataBuffer & buffer)

◆ KeyValueStore() [3/3]

KeyValueStore::KeyValueStore ( BNKeyValueStore * store)

Member Function Documentation

◆ GetKeys()

std::vector< std::string > KeyValueStore::GetKeys ( ) const

◆ HasValue()

bool KeyValueStore::HasValue ( const std::string & name) const

◆ GetValue()

Json::Value KeyValueStore::GetValue ( const std::string & name) const

◆ GetValueHash()

DataBuffer KeyValueStore::GetValueHash ( const std::string & name) const

◆ GetBuffer()

DataBuffer KeyValueStore::GetBuffer ( const std::string & name) const

◆ SetValue()

void KeyValueStore::SetValue ( const std::string & name,
const Json::Value & value )

◆ SetBuffer()

void KeyValueStore::SetBuffer ( const std::string & name,
const DataBuffer & value )

◆ GetSerializedData()

DataBuffer KeyValueStore::GetSerializedData ( ) const

◆ BeginNamespace()

void KeyValueStore::BeginNamespace ( const std::string & name)

◆ EndNamespace()

void KeyValueStore::EndNamespace ( )

◆ IsEmpty()

bool KeyValueStore::IsEmpty ( ) const

◆ ValueSize()

size_t KeyValueStore::ValueSize ( ) const

◆ DataSize()

size_t KeyValueStore::DataSize ( ) const

◆ ValueStorageSize()

size_t KeyValueStore::ValueStorageSize ( ) const

◆ NamespaceSize()

size_t KeyValueStore::NamespaceSize ( ) const

◆ BinaryNinja::Snapshot

class BinaryNinja::Snapshot

A model of an individual database snapshot, created on save.

Public Member Functions

 Snapshot (BNSnapshot *snapshot)
 
Ref< DatabaseGetDatabase ()
 
int64_t GetId ()
 
std::string GetName ()
 
void SetName (const std::string &name)
 
bool IsAutoSave ()
 
bool HasContents ()
 
bool HasData ()
 
bool HasUndo ()
 
Ref< SnapshotGetFirstParent ()
 
std::vector< Ref< Snapshot > > GetParents ()
 
std::vector< Ref< Snapshot > > GetChildren ()
 
DataBuffer GetFileContents ()
 
DataBuffer GetFileContentsHash ()
 
DataBuffer GetUndoData ()
 
std::vector< Ref< UndoEntry > > GetUndoEntries ()
 
std::vector< Ref< UndoEntry > > GetUndoEntries (const std::function< bool(size_t, size_t)> &progress)
 
Ref< KeyValueStoreReadData ()
 
Ref< KeyValueStoreReadData (const std::function< bool(size_t, size_t)> &progress)
 
bool StoreData (const Ref< KeyValueStore > &data, const std::function< bool(size_t, size_t)> &progress)
 
bool HasAncestor (Ref< Snapshot > other)
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNSnapshot, BNNewSnapshotReference, BNFreeSnapshot >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNSnapshotGetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNSnapshot, BNNewSnapshotReference, BNFreeSnapshot >
static BNSnapshotGetObject (CoreRefCountObject *obj)
 
static BNSnapshotGetObject (const CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNSnapshot, BNNewSnapshotReference, BNFreeSnapshot >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNSnapshotm_object
 

Constructor & Destructor Documentation

◆ Snapshot()

Snapshot::Snapshot ( BNSnapshot * snapshot)

Member Function Documentation

◆ GetDatabase()

Ref< Database > Snapshot::GetDatabase ( )

◆ GetId()

int64_t Snapshot::GetId ( )

◆ GetName()

std::string Snapshot::GetName ( )

◆ SetName()

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

◆ IsAutoSave()

bool Snapshot::IsAutoSave ( )

◆ HasContents()

bool Snapshot::HasContents ( )

◆ HasData()

bool BinaryNinja::Snapshot::HasData ( )

◆ HasUndo()

bool Snapshot::HasUndo ( )

◆ GetFirstParent()

Ref< Snapshot > Snapshot::GetFirstParent ( )

◆ GetParents()

vector< Ref< Snapshot > > Snapshot::GetParents ( )

◆ GetChildren()

vector< Ref< Snapshot > > Snapshot::GetChildren ( )

◆ GetFileContents()

DataBuffer Snapshot::GetFileContents ( )

◆ GetFileContentsHash()

DataBuffer Snapshot::GetFileContentsHash ( )

◆ GetUndoData()

DataBuffer Snapshot::GetUndoData ( )

◆ GetUndoEntries() [1/2]

vector< Ref< UndoEntry > > Snapshot::GetUndoEntries ( )

◆ GetUndoEntries() [2/2]

vector< Ref< UndoEntry > > Snapshot::GetUndoEntries ( const std::function< bool(size_t, size_t)> & progress)

◆ ReadData() [1/2]

Ref< KeyValueStore > Snapshot::ReadData ( )

◆ ReadData() [2/2]

Ref< KeyValueStore > Snapshot::ReadData ( const std::function< bool(size_t, size_t)> & progress)

◆ StoreData()

bool Snapshot::StoreData ( const Ref< KeyValueStore > & data,
const std::function< bool(size_t, size_t)> & progress )

◆ HasAncestor()

bool Snapshot::HasAncestor ( Ref< Snapshot > other)

◆ BinaryNinja::Database

class BinaryNinja::Database

Provides lower level access to raw snapshot data used to construct analysis data.

Public Member Functions

 Database (BNDatabase *database)
 
bool SnapshotHasData (int64_t id)
 
Ref< SnapshotGetSnapshot (int64_t id)
 
std::vector< Ref< Snapshot > > GetSnapshots ()
 
void SetCurrentSnapshot (int64_t id)
 
Ref< SnapshotGetCurrentSnapshot ()
 
int64_t WriteSnapshotData (std::vector< int64_t > parents, Ref< BinaryView > file, const std::string &name, const Ref< KeyValueStore > &data, bool autoSave, const std::function< bool(size_t, size_t)> &progress)
 
void TrimSnapshot (int64_t id)
 
void RemoveSnapshot (int64_t id)
 
std::vector< std::string > GetGlobalKeys () const
 
bool HasGlobal (const std::string &key) const
 
Json::Value ReadGlobal (const std::string &key) const
 
void WriteGlobal (const std::string &key, const Json::Value &val)
 
DataBuffer ReadGlobalData (const std::string &key) const
 
void WriteGlobalData (const std::string &key, const DataBuffer &val)
 
Ref< FileMetadataGetFile ()
 
void ReloadConnection ()
 
Ref< KeyValueStoreReadAnalysisCache () const
 
void WriteAnalysisCache (Ref< KeyValueStore > val)
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNDatabase, BNNewDatabaseReference, BNFreeDatabase >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNDatabaseGetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNDatabase, BNNewDatabaseReference, BNFreeDatabase >
static BNDatabaseGetObject (CoreRefCountObject *obj)
 
static BNDatabaseGetObject (const CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNDatabase, BNNewDatabaseReference, BNFreeDatabase >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNDatabasem_object
 

Constructor & Destructor Documentation

◆ Database()

Database::Database ( BNDatabase * database)

Member Function Documentation

◆ SnapshotHasData()

bool Database::SnapshotHasData ( int64_t id)

◆ GetSnapshot()

Ref< Snapshot > Database::GetSnapshot ( int64_t id)

◆ GetSnapshots()

vector< Ref< Snapshot > > Database::GetSnapshots ( )

◆ SetCurrentSnapshot()

void Database::SetCurrentSnapshot ( int64_t id)

◆ GetCurrentSnapshot()

Ref< Snapshot > Database::GetCurrentSnapshot ( )

◆ WriteSnapshotData()

int64_t Database::WriteSnapshotData ( std::vector< int64_t > parents,
Ref< BinaryView > file,
const std::string & name,
const Ref< KeyValueStore > & data,
bool autoSave,
const std::function< bool(size_t, size_t)> & progress )

◆ TrimSnapshot()

void Database::TrimSnapshot ( int64_t id)

◆ RemoveSnapshot()

void Database::RemoveSnapshot ( int64_t id)

◆ GetGlobalKeys()

std::vector< std::string > Database::GetGlobalKeys ( ) const

◆ HasGlobal()

bool Database::HasGlobal ( const std::string & key) const

◆ ReadGlobal()

Json::Value Database::ReadGlobal ( const std::string & key) const

◆ WriteGlobal()

void Database::WriteGlobal ( const std::string & key,
const Json::Value & val )

◆ ReadGlobalData()

DataBuffer Database::ReadGlobalData ( const std::string & key) const

◆ WriteGlobalData()

void Database::WriteGlobalData ( const std::string & key,
const DataBuffer & val )

◆ GetFile()

Ref< FileMetadata > Database::GetFile ( )

◆ ReloadConnection()

void Database::ReloadConnection ( )

◆ ReadAnalysisCache()

Ref< KeyValueStore > Database::ReadAnalysisCache ( ) const

◆ WriteAnalysisCache()

void Database::WriteAnalysisCache ( Ref< KeyValueStore > val)