diff options
Diffstat (limited to 'flowgraph.cpp')
| -rw-r--r-- | flowgraph.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/flowgraph.cpp b/flowgraph.cpp index e557f540..4bacee81 100644 --- a/flowgraph.cpp +++ b/flowgraph.cpp @@ -24,6 +24,17 @@ using namespace BinaryNinja; using namespace std; +FlowGraph::FlowGraph() +{ + BNCustomFlowGraph callbacks; + callbacks.context = this; + callbacks.prepareForLayout = PrepareForLayoutCallback; + callbacks.populateNodes = PopulateNodesCallback; + callbacks.completeLayout = CompleteLayoutCallback; + m_graph = BNCreateCustomFlowGraph(&callbacks); +} + + FlowGraph::FlowGraph(BNFlowGraph* graph): m_graph(graph) { } @@ -46,6 +57,49 @@ void FlowGraph::CompleteCallback(void* ctxt) } +void FlowGraph::PrepareForLayoutCallback(void* ctxt) +{ + FlowGraph* graph = (FlowGraph*)ctxt; + graph->PrepareForLayout(); +} + + +void FlowGraph::PopulateNodesCallback(void* ctxt) +{ + FlowGraph* graph = (FlowGraph*)ctxt; + graph->PopulateNodes(); +} + + +void FlowGraph::CompleteLayoutCallback(void* ctxt) +{ + FlowGraph* graph = (FlowGraph*)ctxt; + graph->CompleteLayout(); +} + + +void FlowGraph::FinishPrepareForLayout() +{ + BNFinishPrepareForLayout(m_graph); +} + + +void FlowGraph::PrepareForLayout() +{ + FinishPrepareForLayout(); +} + + +void FlowGraph::PopulateNodes() +{ +} + + +void FlowGraph::CompleteLayout() +{ +} + + Ref<Function> FlowGraph::GetFunction() const { BNFunction* func = BNGetFunctionForFlowGraph(m_graph); |
