From 8747681904104688158650354128100257896501 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Thu, 26 Sep 2024 00:59:00 -0400 Subject: Expose Type::GetNameTypeString --- binaryninjaapi.h | 2 ++ binaryninjacore.h | 1 + type.cpp | 9 +++++++++ 3 files changed, 12 insertions(+) diff --git a/binaryninjaapi.h b/binaryninjaapi.h index feb15aa5..7bbd2d48 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -8956,6 +8956,8 @@ namespace BinaryNinja { static Ref VarArgsType(); static Ref ValueType(const std::string& value); + static std::string GetNameTypeString(BNNameType classFunctionType); + static std::string GenerateAutoTypeId(const std::string& source, const QualifiedName& name); static std::string GenerateAutoDemangledTypeId(const QualifiedName& name); static std::string GetAutoDemangledTypeIdSource(); diff --git a/binaryninjacore.h b/binaryninjacore.h index 23471a7b..a80f0a20 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -5915,6 +5915,7 @@ extern "C" BNRegisterSetWithConfidence* returnRegs, BNNameType ft, BNBoolWithConfidence* pure); BINARYNINJACOREAPI BNType* BNCreateVarArgsType(); BINARYNINJACOREAPI BNType* BNCreateValueType(const char* value); + BINARYNINJACOREAPI char* BNGetNameTypeString(BNNameType classFunctionType); BINARYNINJACOREAPI BNType* BNNewTypeReference(BNType* type); BINARYNINJACOREAPI BNType* BNDuplicateType(BNType* type); BINARYNINJACOREAPI char* BNGetTypeAndName(BNType* type, BNQualifiedName* name, BNTokenEscapingType escaping); diff --git a/type.cpp b/type.cpp index a53928f7..42ef40b9 100644 --- a/type.cpp +++ b/type.cpp @@ -1090,6 +1090,15 @@ Ref Type::ValueType(const std::string& value) } +std::string Type::GetNameTypeString(BNNameType classFunctionType) +{ + char* value = BNGetNameTypeString(classFunctionType); + std::string result(value); + BNFreeString(value); + return result; +} + + BNIntegerDisplayType Type::GetIntegerTypeDisplayType() const { return BNGetIntegerTypeDisplayType(m_object); -- cgit v1.3.1