From bbb74ee011e2b482e1895a513203c11affbac229 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 27 Jan 2016 02:20:11 -0500 Subject: Implement platform type libraries, though types folder is not yet automatically copied --- binaryninjaapi.h | 3 +++ function.cpp | 6 ++++++ type.cpp | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/binaryninjaapi.h b/binaryninjaapi.h index d4176aa5..43dd3b3d 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -1064,6 +1064,8 @@ namespace BinaryNinja std::string GetStringBeforeName() const; std::string GetStringAfterName() const; + Ref Duplicate() const; + static Ref VoidType(); static Ref BoolType(); static Ref IntegerType(size_t width, bool sign); @@ -1202,6 +1204,7 @@ namespace BinaryNinja std::vector GetRegistersWrittenByInstruction(Architecture* arch, uint64_t addr); Ref GetType() const; + void ApplyImportedTypes(Symbol* sym); Ref CreateFunctionGraph(); }; diff --git a/function.cpp b/function.cpp index 9c8968b7..27d0795b 100644 --- a/function.cpp +++ b/function.cpp @@ -192,6 +192,12 @@ Ref Function::GetType() const } +void Function::ApplyImportedTypes(Symbol* sym) +{ + BNApplyImportedTypes(m_func, sym->GetSymbolObject()); +} + + Ref Function::CreateFunctionGraph() { BNFunctionGraph* graph = BNCreateFunctionGraph(m_func); diff --git a/type.cpp b/type.cpp index 5a48d590..af7d6adf 100644 --- a/type.cpp +++ b/type.cpp @@ -151,6 +151,12 @@ string Type::GetStringAfterName() const } +Ref Type::Duplicate() const +{ + return new Type(BNDuplicateType(m_type)); +} + + Ref Type::VoidType() { return new Type(BNCreateVoidType()); -- cgit v1.3.1