From 2111f1f77241c938b30bd3cf2851919094429dd6 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Sun, 14 May 2017 09:41:28 -0400 Subject: Expose some core API's for the demangling and type creation --- binaryninjaapi.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index b5ca60b4..5fb78367 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -407,6 +407,10 @@ namespace BinaryNinja const std::string& mangledName, Type** outType, QualifiedName& outVarName); + bool DemangleGNU3(Architecture* arch, + const std::string& mangledName, + Type** outType, + QualifiedName& outVarName); void RegisterMainThread(MainThreadActionHandler* handler); Ref ExecuteOnMainThread(const std::function& action); @@ -1624,6 +1628,7 @@ namespace BinaryNinja BNTypeClass GetClass() const; uint64_t GetWidth() const; size_t GetAlignment() const; + QualifiedName GetTypeName() const; bool IsSigned() const; bool IsConst() const; bool IsVolatile() const; @@ -1636,6 +1641,13 @@ namespace BinaryNinja Ref GetStructure() const; Ref GetEnumeration() const; Ref GetNamedTypeReference() const; + BNMemberScope GetScope() const; + void SetScope(BNMemberScope scope); + BNMemberAccess GetAccess() const; + void SetAccess(BNMemberAccess access); + void SetConst(bool cnst); + void SetVolatile(bool vltl); + void SetTypeName(const QualifiedName& name); uint64_t GetElementCount() const; @@ -1664,6 +1676,8 @@ namespace BinaryNinja static Ref EnumerationType(Architecture* arch, Enumeration* enm, size_t width = 0, bool issigned = false); static Ref PointerType(Architecture* arch, Type* type, bool cnst = false, bool vltl = false, BNReferenceType refType = PointerReferenceType); + static Ref PointerType(size_t width, Type* type, bool cnst = false, bool vltl = false, + BNReferenceType refType = PointerReferenceType); static Ref ArrayType(Type* type, uint64_t elem); static Ref FunctionType(Type* returnValue, CallingConvention* callingConvention, const std::vector& params, bool varArg = false); @@ -1671,6 +1685,8 @@ namespace BinaryNinja static std::string GenerateAutoTypeId(const std::string& source, const QualifiedName& name); static std::string GenerateAutoDemangledTypeId(const QualifiedName& name); static std::string GetAutoDemangledTypeIdSource(); + static std::string GenerateAutoDebugTypeId(const QualifiedName& name); + static std::string GetAutoDebugTypeIdSource(); }; class NamedTypeReference: public CoreRefCountObject GenerateAutoDemangledTypeReference(BNNamedTypeReferenceClass cls, const QualifiedName& name); + static Ref GenerateAutoDebugTypeReference(BNNamedTypeReferenceClass cls, + const QualifiedName& name); }; struct StructureMember @@ -1705,6 +1723,7 @@ namespace BinaryNinja public: Structure(); Structure(BNStructure* s); + Structure(BNStructureType type, bool isUnion = false, bool packed = false); std::vector GetMembers() const; uint64_t GetWidth() const; @@ -1732,6 +1751,7 @@ namespace BinaryNinja class Enumeration: public CoreRefCountObject { public: + Enumeration(); Enumeration(BNEnumeration* e); std::vector GetMembers() const; -- cgit v1.3.1