summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2016-01-27 02:20:11 -0500
committerRusty Wagner <rusty.wagner@gmail.com>2016-01-27 02:20:11 -0500
commitbbb74ee011e2b482e1895a513203c11affbac229 (patch)
tree6137967b146d65cdfccf26df66d31ad9ddd5f520
parentad05dd2072917e2487dcd34dbc249b2a0efac589 (diff)
Implement platform type libraries, though types folder is not yet automatically copied
-rw-r--r--binaryninjaapi.h3
-rw-r--r--function.cpp6
-rw-r--r--type.cpp6
3 files changed, 15 insertions, 0 deletions
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<Type> Duplicate() const;
+
static Ref<Type> VoidType();
static Ref<Type> BoolType();
static Ref<Type> IntegerType(size_t width, bool sign);
@@ -1202,6 +1204,7 @@ namespace BinaryNinja
std::vector<uint32_t> GetRegistersWrittenByInstruction(Architecture* arch, uint64_t addr);
Ref<Type> GetType() const;
+ void ApplyImportedTypes(Symbol* sym);
Ref<FunctionGraph> CreateFunctionGraph();
};
diff --git a/function.cpp b/function.cpp
index 9c8968b7..27d0795b 100644
--- a/function.cpp
+++ b/function.cpp
@@ -192,6 +192,12 @@ Ref<Type> Function::GetType() const
}
+void Function::ApplyImportedTypes(Symbol* sym)
+{
+ BNApplyImportedTypes(m_func, sym->GetSymbolObject());
+}
+
+
Ref<FunctionGraph> 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> Type::Duplicate() const
+{
+ return new Type(BNDuplicateType(m_type));
+}
+
+
Ref<Type> Type::VoidType()
{
return new Type(BNCreateVoidType());