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 --- functiongraphblock.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'functiongraphblock.cpp') diff --git a/functiongraphblock.cpp b/functiongraphblock.cpp index 8afdef60..3914cc18 100644 --- a/functiongraphblock.cpp +++ b/functiongraphblock.cpp @@ -65,14 +65,22 @@ vector FunctionGraphBlock::GetLines() const } -vector FunctionGraphBlock::GetOutgoingEdges() const +vector FunctionGraphBlock::GetOutgoingEdges() const { size_t count; - BNBasicBlockEdge* edges = BNGetFunctionGraphBlockOutgoingEdges(m_block, &count); + BNFunctionGraphEdge* edges = BNGetFunctionGraphBlockOutgoingEdges(m_block, &count); - vector result; - result.insert(result.begin(), &edges[0], &edges[count]); + vector result; + for (size_t i = 0; i < count; i++) + { + FunctionGraphEdge edge; + edge.type = edges[i].type; + edge.target = edges[i].target; + edge.arch = edges[i].arch ? new CoreArchitecture(edges[i].arch) : nullptr; + edge.points.insert(edge.points.begin(), &edges[i].points[0], &edges[i].points[edges[i].pointCount]); + result.push_back(edge); + } - BNFreeFunctionGraphBlockOutgoingEdgeList(edges); + BNFreeFunctionGraphBlockOutgoingEdgeList(edges, count); return result; } -- cgit v1.3.1