Skip to content

Commit 9861190

Browse files
committed
DBO: id stopped being a thing a while ago
1 parent 5779126 commit 9861190

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

python/database.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,10 @@ def analysis_cache(self) -> KeyValueStore:
365365
return KeyValueStore(handle=handle)
366366

367367

368+
def _from_4cc(four_cc) -> str:
369+
return chr((four_cc >> 24) & 0xff) + chr((four_cc >> 16) & 0xff) + chr((four_cc >> 8) & 0xff) + chr(four_cc & 0xff)
370+
371+
368372
class DatabaseObject:
369373
def __init__(self, handle):
370374
self.handle = core.handle_of_type(handle, core.BNDatabaseObject)
@@ -378,10 +382,10 @@ def __del__(self):
378382
core.BNFreeDatabaseObject(self.handle)
379383

380384
def __str__(self):
381-
return f"<dbo {self.id}: {self.description}>"
385+
return f"<dbo {_from_4cc(self.type)}: {self.description}>"
382386

383387
def __repr__(self):
384-
return f"<dbo {self.id}>"
388+
return f"<dbo {_from_4cc(self.type)}>"
385389

386390
@property
387391
def type(self) -> int:

0 commit comments

Comments
 (0)