summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binaryninjaapi.h5
-rw-r--r--binaryninjacore.h1
-rw-r--r--python/typelibrary.py6
-rw-r--r--rust/src/types/library.rs5
-rw-r--r--typelibrary.cpp6
5 files changed, 23 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 08c03c30..5acc6a1c 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -20233,6 +20233,11 @@ namespace BinaryNinja {
*/
void Finalize();
+
+ /*! Make a created or loaded Type Library available for Platforms to use when loading binaries.
+
+ */
+ void Register();
};
class TypeArchive;
diff --git a/binaryninjacore.h b/binaryninjacore.h
index 439f87c0..0ebeac20 100644
--- a/binaryninjacore.h
+++ b/binaryninjacore.h
@@ -6829,6 +6829,7 @@ extern "C"
BINARYNINJACOREAPI void BNFreeTypeLibraryList(BNTypeLibrary** lib, size_t count);
BINARYNINJACOREAPI bool BNFinalizeTypeLibrary(BNTypeLibrary* lib);
+ BINARYNINJACOREAPI void BNRegisterTypeLibrary(BNTypeLibrary* lib);
BINARYNINJACOREAPI BNArchitecture* BNGetTypeLibraryArchitecture(BNTypeLibrary* lib);
diff --git a/python/typelibrary.py b/python/typelibrary.py
index b02fbfda..5dec0fd9 100644
--- a/python/typelibrary.py
+++ b/python/typelibrary.py
@@ -241,6 +241,12 @@ class TypeLibrary:
"""
return core.BNFinalizeTypeLibrary(self.handle)
+ def register(self) -> None:
+ """
+ Make a created or loaded Type Library available for Platforms to use when loading binaries.
+ """
+ core.BNRegisterTypeLibrary(self.handle)
+
def query_metadata(self, key: str) -> 'metadata.MetadataValueType':
"""
`query_metadata` retrieves a metadata associated with the given key stored in the type library
diff --git a/rust/src/types/library.rs b/rust/src/types/library.rs
index ab69e76e..8743b896 100644
--- a/rust/src/types/library.rs
+++ b/rust/src/types/library.rs
@@ -217,6 +217,11 @@ impl TypeLibrary {
unsafe { BNFinalizeTypeLibrary(self.as_raw()) }
}
+ /// Make a created or loaded Type Library available for Platforms to use when loading binaries.
+ pub fn register(&self) {
+ unsafe { BNRegisterTypeLibrary(self.as_raw()) }
+ }
+
/// Retrieves the metadata associated with the given key stored in the type library.
pub fn query_metadata(&self, key: &str) -> Option<Ref<Metadata>> {
let key = key.to_cstr();
diff --git a/typelibrary.cpp b/typelibrary.cpp
index a2fff4a5..bea52459 100644
--- a/typelibrary.cpp
+++ b/typelibrary.cpp
@@ -259,3 +259,9 @@ void TypeLibrary::Finalize()
{
BNFinalizeTypeLibrary(m_object);
}
+
+
+void TypeLibrary::Register()
+{
+ BNRegisterTypeLibrary(m_object);
+}