From f0ab57068974f11cc19a95e9672af22ba2ea2ae2 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Sun, 31 Jan 2016 03:10:41 -0500 Subject: Create functions and types from function pointer parameters, now finds main() on Linux armv7 --- binaryninjaapi.h | 2 ++ function.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/binaryninjaapi.h b/binaryninjaapi.h index c57bdf3a..42a29388 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -1246,6 +1246,7 @@ namespace BinaryNinja Ref GetSymbol() const; bool WasAutomaticallyDiscovered() const; bool CanReturn() const; + bool HasExplicitlyDefinedType() const; std::vector> GetBasicBlocks() const; void MarkRecentUse(); @@ -1267,6 +1268,7 @@ namespace BinaryNinja Ref GetType() const; void ApplyImportedTypes(Symbol* sym); + void ApplyAutoDiscoveredType(Type* type); Ref CreateFunctionGraph(); }; diff --git a/function.cpp b/function.cpp index 20b7ee89..ee2c5d36 100644 --- a/function.cpp +++ b/function.cpp @@ -46,6 +46,12 @@ bool Function::CanReturn() const } +bool Function::HasExplicitlyDefinedType() const +{ + return BNFunctionHasExplicitlyDefinedType(m_object); +} + + vector> Function::GetBasicBlocks() const { size_t count; @@ -193,6 +199,12 @@ void Function::ApplyImportedTypes(Symbol* sym) } +void Function::ApplyAutoDiscoveredType(Type* type) +{ + BNApplyAutoDiscoveredFunctionType(m_object, type->GetObject()); +} + + Ref Function::CreateFunctionGraph() { BNFunctionGraph* graph = BNCreateFunctionGraph(m_object); -- cgit v1.3.1