Skip to content

Commit 1108176

Browse files
committed
DBO: Add FileMetadata::GetDatabaseObject
1 parent 1197276 commit 1108176

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

binaryninjaapi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3922,6 +3922,8 @@ namespace BinaryNinja {
39223922
bool restoreRawView = true);
39233923
Ref<Database> GetDatabase();
39243924

3925+
Ref<class DatabaseObject> GetDatabaseObject();
3926+
39253927
/*! Rebase the given BinaryView to a new address
39263928

39273929
\param data BinaryView to rebase

filemetadata.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,15 @@ Ref<Database> FileMetadata::GetDatabase()
279279
}
280280

281281

282+
Ref<DatabaseObject> FileMetadata::GetDatabaseObject()
283+
{
284+
BNDatabaseObject* object = BNGetFileDatabaseObject(m_object, nullptr);
285+
if (!object)
286+
return nullptr;
287+
return new DatabaseObject(object);
288+
}
289+
290+
282291
bool FileMetadata::Rebase(BinaryView* data, uint64_t address)
283292
{
284293
return BNRebase(data->GetObject(), address);

0 commit comments

Comments
 (0)