Classes | |
struct | BinaryNinja::FlowGraphEdge |
class | BinaryNinja::FlowGraphNode |
class | BinaryNinja::FlowGraphLayoutRequest |
class | BinaryNinja::FlowGraph |
FlowGraph implements a directed flow graph to be shown in the UI. More... | |
class | BinaryNinja::CoreFlowGraph |
struct BinaryNinja::FlowGraphEdge |
Class Members | ||
---|---|---|
BNBranchType | type | |
Ref< FlowGraphNode > | target | |
vector< BNPoint > | points | |
bool | backEdge | |
BNEdgeStyle | style |
class BinaryNinja::FlowGraphNode |
Public Member Functions | |
FlowGraphNode (FlowGraph *graph) | |
FlowGraphNode (BNFlowGraphNode *node) | |
Ref< FlowGraph > | GetGraph () const |
Get the FlowGraph associated with this node. | |
Ref< BasicBlock > | GetBasicBlock () const |
Get the Basic Block associated with this node. | |
void | SetBasicBlock (BasicBlock *block) |
Set the Basic Block associated with this node. | |
void | SetX (int x) |
Set flow graph block X position. | |
void | SetY (int y) |
Set flow graph block Y position. | |
int | GetX () const |
Flow graph block X position. | |
int | GetY () const |
Flow graph block Y position. | |
int | GetWidth () const |
Flow graph block width. | |
int | GetHeight () const |
Flow graph block height. | |
const std::vector< DisassemblyTextLine > & | GetLines () |
Get the list of DisassemblyTextLines for this graph node. | |
void | SetLines (const std::vector< DisassemblyTextLine > &lines) |
Set the list of DisassemblyTextLines for this graph node. | |
const std::vector< FlowGraphEdge > & | GetOutgoingEdges () |
Get the list of outgoing edges for this flow graph node. | |
const std::vector< FlowGraphEdge > & | GetIncomingEdges () |
Get the list of incoming edges for this flow graph node. | |
void | AddOutgoingEdge (BNBranchType type, FlowGraphNode *target, BNEdgeStyle edgeStyle=BNEdgeStyle()) |
Connects two flow graph nodes with an edge. | |
BNHighlightColor | GetHighlight () const |
Get the highlight color for the node. | |
void | SetHighlight (const BNHighlightColor &color) |
Set the highlight color for the node. | |
bool | IsValidForGraph (FlowGraph *graph) const |
void | SetVisibilityRegion (int x, int y, int w, int h) |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNFlowGraphNode, BNNewFlowGraphNodeReference, BNFreeFlowGraphNode > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNFlowGraphNode * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNFlowGraphNode, BNNewFlowGraphNodeReference, BNFreeFlowGraphNode > | |
static BNFlowGraphNode * | GetObject (CoreRefCountObject *obj) |
static BNFlowGraphNode * | GetObject (const CoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNFlowGraphNode, BNNewFlowGraphNodeReference, BNFreeFlowGraphNode > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNFlowGraphNode * | m_object |
FlowGraphNode::FlowGraphNode | ( | FlowGraph * | graph | ) |
FlowGraphNode::FlowGraphNode | ( | BNFlowGraphNode * | node | ) |
Ref< BasicBlock > FlowGraphNode::GetBasicBlock | ( | ) | const |
Get the Basic Block associated with this node.
void FlowGraphNode::SetBasicBlock | ( | BasicBlock * | block | ) |
Set the Basic Block associated with this node.
block | The BasicBlock associated with this node |
void FlowGraphNode::SetX | ( | int | x | ) |
Set flow graph block X position.
x | Flow graph block X position |
void FlowGraphNode::SetY | ( | int | y | ) |
Set flow graph block Y position.
y | Flow graph block Y position |
int FlowGraphNode::GetX | ( | ) | const |
Flow graph block X position.
int FlowGraphNode::GetY | ( | ) | const |
Flow graph block Y position.
int FlowGraphNode::GetWidth | ( | ) | const |
Flow graph block width.
int FlowGraphNode::GetHeight | ( | ) | const |
Flow graph block height.
const vector< DisassemblyTextLine > & FlowGraphNode::GetLines | ( | ) |
Get the list of DisassemblyTextLines for this graph node.
void FlowGraphNode::SetLines | ( | const std::vector< DisassemblyTextLine > & | lines | ) |
Set the list of DisassemblyTextLines for this graph node.
lines | The list of DisassemblyTextLines for this graph node. |
const vector< FlowGraphEdge > & FlowGraphNode::GetOutgoingEdges | ( | ) |
Get the list of outgoing edges for this flow graph node.
const vector< FlowGraphEdge > & FlowGraphNode::GetIncomingEdges | ( | ) |
Get the list of incoming edges for this flow graph node.
void FlowGraphNode::AddOutgoingEdge | ( | BNBranchType | type, |
FlowGraphNode * | target, | ||
BNEdgeStyle | edgeStyle = BNEdgeStyle() ) |
BNHighlightColor FlowGraphNode::GetHighlight | ( | ) | const |
Get the highlight color for the node.
void FlowGraphNode::SetHighlight | ( | const BNHighlightColor & | color | ) |
Set the highlight color for the node.
color | The highlight color for the node |
bool FlowGraphNode::IsValidForGraph | ( | FlowGraph * | graph | ) | const |
void FlowGraphNode::SetVisibilityRegion | ( | int | x, |
int | y, | ||
int | w, | ||
int | h ) |
class BinaryNinja::FlowGraphLayoutRequest |
Public Member Functions | |
FlowGraphLayoutRequest (FlowGraph *graph, const std::function< void()> &completeFunc) | |
virtual | ~FlowGraphLayoutRequest () |
BNFlowGraphLayoutRequest * | GetObject () const |
Ref< FlowGraph > | GetGraph () const |
bool | IsComplete () const |
void | Abort () |
Public Member Functions inherited from BinaryNinja::RefCountObject | |
RefCountObject () | |
virtual | ~RefCountObject () |
RefCountObject * | GetObject () |
void | AddRef () |
void | Release () |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::RefCountObject | |
static RefCountObject * | GetObject (RefCountObject *obj) |
Public Attributes inherited from BinaryNinja::RefCountObject | |
std::atomic< int > | m_refs |
FlowGraphLayoutRequest::FlowGraphLayoutRequest | ( | FlowGraph * | graph, |
const std::function< void()> & | completeFunc ) |
|
virtual |
|
inline |
bool FlowGraphLayoutRequest::IsComplete | ( | ) | const |
void FlowGraphLayoutRequest::Abort | ( | ) |
class BinaryNinja::FlowGraph |
FlowGraph implements a directed flow graph to be shown in the UI.
This class allows plugins to create custom flow graphs and render them in the UI using the flow graph report API.
Public Member Functions | |
FlowGraph () | |
Ref< Function > | GetFunction () const |
Get the Function associated with this FlowGraph. | |
Ref< BinaryView > | GetView () const |
Get the BinaryView associated with this FlowGraph. | |
void | SetFunction (Function *func) |
Set the Function associated with this FlowGraph. | |
void | SetView (BinaryView *view) |
Set the BinaryView associated with this FlowGraph. | |
int | GetHorizontalNodeMargin () const |
int | GetVerticalNodeMargin () const |
void | SetNodeMargins (int horiz, int vert) |
Ref< FlowGraphLayoutRequest > | StartLayout (const std::function< void()> &func) |
Starts rendering a graph for display. | |
bool | IsLayoutComplete () |
Check whether layout is complete. | |
std::vector< Ref< FlowGraphNode > > | GetNodes () |
Get the list of nodes in the graph. | |
Ref< FlowGraphNode > | GetNode (size_t i) |
Retrieve node by index. | |
bool | HasNodes () const |
Whether the FlowGraph has any nodes added. | |
size_t | AddNode (FlowGraphNode *node) |
Add a node to this flowgraph. | |
int | GetWidth () const |
Flow graph width. | |
void | SetWidth (int width) |
int | GetHeight () const |
Flow graph height. | |
void | SetHeight (int height) |
std::vector< Ref< FlowGraphNode > > | GetNodesInRegion (int left, int top, int right, int bottom) |
bool | IsILGraph () const |
Whether this graph is representing IL. | |
bool | IsLowLevelILGraph () const |
Whether this graph is representing Low Level IL. | |
bool | IsMediumLevelILGraph () const |
Whether this graph is representing Medium Level IL. | |
bool | IsHighLevelILGraph () const |
Whether this graph is representing High Level IL. | |
Ref< LowLevelILFunction > | GetLowLevelILFunction () const |
Get the associated Low Level IL Function. | |
Ref< MediumLevelILFunction > | GetMediumLevelILFunction () const |
Get the associated Medium Level IL Function. | |
Ref< HighLevelILFunction > | GetHighLevelILFunction () const |
Get the associated High Level IL Function. | |
void | SetLowLevelILFunction (LowLevelILFunction *func) |
Set the associated Low Level IL Function. | |
void | SetMediumLevelILFunction (MediumLevelILFunction *func) |
Set the associated Medium Level IL Function. | |
void | SetHighLevelILFunction (HighLevelILFunction *func) |
Set the associated High Level IL Function. | |
void | Show (const std::string &title) |
Display a flowgraph with a given title. | |
bool | IsQueryModeEnabled () const |
virtual bool | HasUpdates () const |
virtual Ref< FlowGraph > | Update () |
void | SetOption (BNFlowGraphOption option, bool value=true) |
bool | IsOptionSet (BNFlowGraphOption option) |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNFlowGraph, BNNewFlowGraphReference, BNFreeFlowGraph > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNFlowGraph * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Protected Member Functions | |
FlowGraph (BNFlowGraph *graph) | |
void | FinishPrepareForLayout () |
virtual void | PrepareForLayout () |
virtual void | PopulateNodes () |
virtual void | CompleteLayout () |
Protected Attributes | |
bool | m_queryMode = false |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNFlowGraph, BNNewFlowGraphReference, BNFreeFlowGraph > | |
static BNFlowGraph * | GetObject (CoreRefCountObject *obj) |
static BNFlowGraph * | GetObject (const CoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNFlowGraph, BNNewFlowGraphReference, BNFreeFlowGraph > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNFlowGraph * | m_object |
|
protected |
FlowGraph::FlowGraph | ( | ) |
|
protected |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Ref< BinaryView > FlowGraph::GetView | ( | ) | const |
Get the BinaryView associated with this FlowGraph.
void FlowGraph::SetFunction | ( | Function * | func | ) |
void FlowGraph::SetView | ( | BinaryView * | view | ) |
Set the BinaryView associated with this FlowGraph.
view | The BinaryView associated with this FlowGraph |
int FlowGraph::GetHorizontalNodeMargin | ( | ) | const |
int FlowGraph::GetVerticalNodeMargin | ( | ) | const |
void FlowGraph::SetNodeMargins | ( | int | horiz, |
int | vert ) |
Ref< FlowGraphLayoutRequest > FlowGraph::StartLayout | ( | const std::function< void()> & | func | ) |
Starts rendering a graph for display.
Once a layout is complete, each node will contain coordinates and extents that can be used to render a graph with minimum additional computation. This function does not wait for the graph to be ready to display, but a callback can be provided to signal when the graph is ready.
func | Callback to execute once layout is complete. |
bool FlowGraph::IsLayoutComplete | ( | ) |
Check whether layout is complete.
vector< Ref< FlowGraphNode > > FlowGraph::GetNodes | ( | ) |
Get the list of nodes in the graph.
Ref< FlowGraphNode > FlowGraph::GetNode | ( | size_t | i | ) |
Retrieve node by index.
i | Index of the node to retrieve |
bool FlowGraph::HasNodes | ( | ) | const |
size_t FlowGraph::AddNode | ( | FlowGraphNode * | node | ) |
Add a node to this flowgraph.
node | Node to be added. |
int FlowGraph::GetWidth | ( | ) | const |
Flow graph width.
void FlowGraph::SetWidth | ( | int | width | ) |
int FlowGraph::GetHeight | ( | ) | const |
Flow graph height.
void FlowGraph::SetHeight | ( | int | height | ) |
vector< Ref< FlowGraphNode > > FlowGraph::GetNodesInRegion | ( | int | left, |
int | top, | ||
int | right, | ||
int | bottom ) |
bool FlowGraph::IsILGraph | ( | ) | const |
Whether this graph is representing IL.
bool FlowGraph::IsLowLevelILGraph | ( | ) | const |
Whether this graph is representing Low Level IL.
bool FlowGraph::IsMediumLevelILGraph | ( | ) | const |
Whether this graph is representing Medium Level IL.
bool FlowGraph::IsHighLevelILGraph | ( | ) | const |
Whether this graph is representing High Level IL.
Ref< LowLevelILFunction > FlowGraph::GetLowLevelILFunction | ( | ) | const |
Ref< MediumLevelILFunction > FlowGraph::GetMediumLevelILFunction | ( | ) | const |
Ref< HighLevelILFunction > FlowGraph::GetHighLevelILFunction | ( | ) | const |
void FlowGraph::SetLowLevelILFunction | ( | LowLevelILFunction * | func | ) |
Set the associated Low Level IL Function.
func | The associated function |
void FlowGraph::SetMediumLevelILFunction | ( | MediumLevelILFunction * | func | ) |
Set the associated Medium Level IL Function.
func | The associated function |
void FlowGraph::SetHighLevelILFunction | ( | HighLevelILFunction * | func | ) |
Set the associated High Level IL Function.
func | The associated function |
void FlowGraph::Show | ( | const std::string & | title | ) |
Display a flowgraph with a given title.
title | Title for the flowgraph |
|
inline |
|
virtual |
Reimplemented in BinaryNinja::CoreFlowGraph.
Reimplemented in BinaryNinja::CoreFlowGraph.
void FlowGraph::SetOption | ( | BNFlowGraphOption | option, |
bool | value = true ) |
bool FlowGraph::IsOptionSet | ( | BNFlowGraphOption | option | ) |
|
protected |
class BinaryNinja::CoreFlowGraph |
Public Member Functions | |
CoreFlowGraph (BNFlowGraph *graph) | |
virtual bool | HasUpdates () const override |
virtual Ref< FlowGraph > | Update () override |
Public Member Functions inherited from BinaryNinja::FlowGraph | |
FlowGraph () | |
Ref< Function > | GetFunction () const |
Get the Function associated with this FlowGraph. | |
Ref< BinaryView > | GetView () const |
Get the BinaryView associated with this FlowGraph. | |
void | SetFunction (Function *func) |
Set the Function associated with this FlowGraph. | |
void | SetView (BinaryView *view) |
Set the BinaryView associated with this FlowGraph. | |
int | GetHorizontalNodeMargin () const |
int | GetVerticalNodeMargin () const |
void | SetNodeMargins (int horiz, int vert) |
Ref< FlowGraphLayoutRequest > | StartLayout (const std::function< void()> &func) |
Starts rendering a graph for display. | |
bool | IsLayoutComplete () |
Check whether layout is complete. | |
std::vector< Ref< FlowGraphNode > > | GetNodes () |
Get the list of nodes in the graph. | |
Ref< FlowGraphNode > | GetNode (size_t i) |
Retrieve node by index. | |
bool | HasNodes () const |
Whether the FlowGraph has any nodes added. | |
size_t | AddNode (FlowGraphNode *node) |
Add a node to this flowgraph. | |
int | GetWidth () const |
Flow graph width. | |
void | SetWidth (int width) |
int | GetHeight () const |
Flow graph height. | |
void | SetHeight (int height) |
std::vector< Ref< FlowGraphNode > > | GetNodesInRegion (int left, int top, int right, int bottom) |
bool | IsILGraph () const |
Whether this graph is representing IL. | |
bool | IsLowLevelILGraph () const |
Whether this graph is representing Low Level IL. | |
bool | IsMediumLevelILGraph () const |
Whether this graph is representing Medium Level IL. | |
bool | IsHighLevelILGraph () const |
Whether this graph is representing High Level IL. | |
Ref< LowLevelILFunction > | GetLowLevelILFunction () const |
Get the associated Low Level IL Function. | |
Ref< MediumLevelILFunction > | GetMediumLevelILFunction () const |
Get the associated Medium Level IL Function. | |
Ref< HighLevelILFunction > | GetHighLevelILFunction () const |
Get the associated High Level IL Function. | |
void | SetLowLevelILFunction (LowLevelILFunction *func) |
Set the associated Low Level IL Function. | |
void | SetMediumLevelILFunction (MediumLevelILFunction *func) |
Set the associated Medium Level IL Function. | |
void | SetHighLevelILFunction (HighLevelILFunction *func) |
Set the associated High Level IL Function. | |
void | Show (const std::string &title) |
Display a flowgraph with a given title. | |
bool | IsQueryModeEnabled () const |
void | SetOption (BNFlowGraphOption option, bool value=true) |
bool | IsOptionSet (BNFlowGraphOption option) |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNFlowGraph, BNNewFlowGraphReference, BNFreeFlowGraph > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNFlowGraph * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNFlowGraph, BNNewFlowGraphReference, BNFreeFlowGraph > | |
static BNFlowGraph * | GetObject (CoreRefCountObject *obj) |
static BNFlowGraph * | GetObject (const CoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNFlowGraph, BNNewFlowGraphReference, BNFreeFlowGraph > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNFlowGraph * | m_object |
Protected Member Functions inherited from BinaryNinja::FlowGraph | |
FlowGraph (BNFlowGraph *graph) | |
void | FinishPrepareForLayout () |
virtual void | PrepareForLayout () |
virtual void | PopulateNodes () |
virtual void | CompleteLayout () |
Protected Attributes inherited from BinaryNinja::FlowGraph | |
bool | m_queryMode = false |
CoreFlowGraph::CoreFlowGraph | ( | BNFlowGraph * | graph | ) |
|
overridevirtual |
Reimplemented from BinaryNinja::FlowGraph.
Reimplemented from BinaryNinja::FlowGraph.