Package vivisect :: Package tools :: Module graphutil
[hide private]
[frames] | no frames]

Module graphutil

source code

Some glue code to do workspace related things based on visgraph

Functions [hide private]
 
getLongPath(g, maxpath=1000)
Returns a list of list tuples (node id, edge id) representing the longest path
source code
 
_nodeedge(tnode) source code
 
getCoveragePaths(fgraph, maxpath=None)
Get a set of paths which will cover every block, but will *end* on branches which re-merge with previously traversed paths.
source code
 
getCodePaths(fgraph, loopcnt=0, maxpath=None)
Return a list of all the paths through the hierarchical graph.
source code
 
getLoopPaths(fgraph)
Similar to getCodePaths(), however, getLoopPaths() will return path lists which loop.
source code
 
buildFunctionGraph(vw, fva, revloop=False)
Build a visgraph HierarchicalGraph for the specified function.
source code
Variables [hide private]
  xrskip = envi.BR_PROC | envi.BR_DEREF
Function Details [hide private]

getCoveragePaths(fgraph, maxpath=None)

source code 

Get a set of paths which will cover every block, but will *end* on branches which re-merge with previously traversed paths. This allows a full coverage of the graph with as little work as possible, but *will* omit possible states.

Returns: yield based path generator ( where path is list if (nid,edge) tuples )

getCodePaths(fgraph, loopcnt=0, maxpath=None)

source code 

Return a list of all the paths through the hierarchical graph.  Each
"root" node is traced to all terminating points.  Specify a loopcnt
to allow loop paths to be generated with the given "loop iteration count"

Example:
    for path in getCodePaths(fgraph):
        for node,edge in path:
            ...etc...

getLoopPaths(fgraph)

source code 

Similar to getCodePaths(), however, getLoopPaths() will return path lists which loop. The last element in the (node,edge) list will be the first "looped" block.