summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binaryninjacore.h1
-rw-r--r--python/typelibrary.py9
2 files changed, 10 insertions, 0 deletions
diff --git a/binaryninjacore.h b/binaryninjacore.h
index 53a125c4..05eb44fa 100644
--- a/binaryninjacore.h
+++ b/binaryninjacore.h
@@ -4946,6 +4946,7 @@ extern "C"
BINARYNINJACOREAPI void BNAddTypeLibraryNamedObject(BNTypeLibrary* lib, BNQualifiedName* name, BNType* type);
BINARYNINJACOREAPI void BNAddTypeLibraryNamedType(BNTypeLibrary* lib, BNQualifiedName* name, BNType* type);
+ BINARYNINJACOREAPI void BNAddTypeLibraryNamedTypeSource(BNTypeLibrary* lib, BNQualifiedName* name, const char* source);
BINARYNINJACOREAPI BNType* BNGetTypeLibraryNamedObject(BNTypeLibrary* lib, BNQualifiedName* name);
BINARYNINJACOREAPI BNType* BNGetTypeLibraryNamedType(BNTypeLibrary* lib, BNQualifiedName* name);
diff --git a/python/typelibrary.py b/python/typelibrary.py
index 2d2c8fb1..0a7bbccc 100644
--- a/python/typelibrary.py
+++ b/python/typelibrary.py
@@ -307,6 +307,15 @@ class TypeLibrary:
raise ValueError("parameter type must be a Type")
core.BNAddTypeLibraryNamedType(self.handle, name._to_core_struct(), type.handle)
+ def add_type_source(self, name: types.QualifiedName, source: str) -> None:
+ """
+ Manually flag NamedTypeReferences to the given QualifiedName as originating from another source
+ TypeLibrary with the given dependency name.
+
+ .. warning:: Use this api with extreme caution.
+ """
+ core.BNAddTypeLibraryNamedTypeSource(self.handle, QualifiedName(name)._to_core_struct(), source)
+
def get_named_object(self, name: str) -> Optional[types.Type]:
"""
`get_named_object` direct extracts a reference to a contained object -- when