From 5d0f774334c1bea3935001bf665d614c39a60d0f Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 4 Mar 2015 01:47:13 -0500 Subject: Add architecture to graph edges, and add edge routing data field for layout --- binaryninjaapi.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 2b0d53ad..63e8f1a5 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -424,7 +424,7 @@ namespace BinaryNinja public: BinaryViewType(const std::string& name, const std::string& longName); - virtual ~BinaryViewType(); + virtual ~BinaryViewType() {} static void Register(BinaryViewType* type); static Ref GetByName(const std::string& name); @@ -613,7 +613,7 @@ namespace BinaryNinja struct InstructionInfo: public BNInstructionInfo { InstructionInfo(); - void AddBranch(BNBranchType type, uint64_t target = 0); + void AddBranch(BNBranchType type, uint64_t target = 0, Architecture* arch = nullptr); }; struct InstructionTextToken @@ -664,6 +664,13 @@ namespace BinaryNinja class Function; + struct BasicBlockEdge + { + BNBranchType type; + uint64_t target; + Ref arch; + }; + class BasicBlock: public RefCountObject { BNBasicBlock* m_block; @@ -679,7 +686,7 @@ namespace BinaryNinja uint64_t GetEnd() const; uint64_t GetLength() const; - std::vector GetOutgoingEdges() const; + std::vector GetOutgoingEdges() const; }; class FunctionGraph; @@ -693,7 +700,7 @@ namespace BinaryNinja ~Function(); BNFunction* GetFunctionObject() const { return m_func; } - + Ref GetArchitecture() const; uint64_t GetStart() const; @@ -708,6 +715,14 @@ namespace BinaryNinja std::vector tokens; }; + struct FunctionGraphEdge + { + BNBranchType type; + uint64_t target; + Ref arch; + std::vector points; + }; + class FunctionGraphBlock: public RefCountObject { BNFunctionGraphBlock* m_block; @@ -724,7 +739,7 @@ namespace BinaryNinja int GetHeight() const; std::vector GetLines() const; - std::vector GetOutgoingEdges() const; + std::vector GetOutgoingEdges() const; }; class FunctionGraph: public RefCountObject -- cgit v1.3.1