Public Member Functions | |
def | __init__ |
def | step_counter |
def | current_step |
def | inc_step |
def | get |
def | get_from_depnodes |
def | get_from_end |
Static Public Member Functions | |
def | get_expr |
def | follow_expr |
Private Member Functions | |
def | _follow_exprs |
def | _follow_apply_cb |
def | _get_irs |
def | _get_affblock |
def | _direct_depnode_dependencies |
def | _resolve_intrablock_dep |
def | _get_previousblocks |
def | _compute_interblock_dep |
Static Private Member Functions | |
def | _follow_simp_expr |
def | _follow_nolabel |
Private Attributes | |
_ira | |
_implicit | |
_step_counter | |
_current_step | |
_cb_follow | |
Implementation of a dependency graph A dependency graph contains DependencyNode as nodes. The oriented edges stand for a dependency. The dependency graph is made of the lines of a group of IRblock *explicitely* or *implicitely* involved in the equation of given element.
Definition at line 676 of file depgraph.py.
def miasm2.analysis.depgraph.DependencyGraph.__init__ | ( | self, | |
ira, | |||
implicit = False , |
|||
apply_simp = True , |
|||
follow_mem = True , |
|||
follow_call = True |
|||
) |
Create a DependencyGraph linked to @ira The IRA graph must have been computed @ira: IRAnalysis instance @implicit: (optional) Imply implicit dependencies Following arguments define filters used to generate dependencies @apply_simp: (optional) Apply expr_simp @follow_mem: (optional) Track memory syntactically @follow_call: (optional) Track through "call"
Definition at line 687 of file depgraph.py.
|
private |
Create a DependencyDict from @depnodes, and propagate DependencyDicts through all blocs
Definition at line 900 of file depgraph.py.
|
private |
Compute and return the dependencies involved by @depnode, over the instruction @depnode.line_,. Return a set of FollowExpr
Definition at line 820 of file depgraph.py.
|
private |
Apply callback functions to @expr @expr : FollowExpr instance
Definition at line 797 of file depgraph.py.
|
private |
Extracts subnodes from exprs and returns followed/non followed expressions according to @follow_mem/@follow_call
Definition at line 775 of file depgraph.py.
|
staticprivate |
Do not follow labels
Definition at line 788 of file depgraph.py.
|
staticprivate |
Simplify expression so avoid tracking useless elements, as: XOR EAX, EAX
Definition at line 733 of file depgraph.py.
|
private |
Return the list of ExprAff associtiated to @depnode. LINE_NB must be > 0
Definition at line 815 of file depgraph.py.
|
private |
Definition at line 811 of file depgraph.py.
|
private |
Return an iterator on predecessors blocks of @label, with their lengths
Definition at line 892 of file depgraph.py.
|
private |
Resolve the dependencies of nodes in @depdict.pending inside @depdict.label until a fixed point is reached. @depdict: DependencyDict to update
Definition at line 855 of file depgraph.py.
def miasm2.analysis.depgraph.DependencyGraph.current_step | ( | self | ) |
Definition at line 723 of file depgraph.py.
|
static |
Returns True if we must visit sub expressions. @expr: expression to browse @follow: set of nodes to follow @nofollow: set of nodes not to follow @follow_mem: force the visit of memory sub expressions @follow_call: force the visit of call sub expressions
Definition at line 758 of file depgraph.py.
def miasm2.analysis.depgraph.DependencyGraph.get | ( | self, | |
label, | |||
elements, | |||
line_nb, | |||
heads | |||
) |
Compute the dependencies of @elements at line number @line_nb in the block named @label in the current IRA, before the execution of this line. Dependency check stop if one of @heads is reached @label: asm_label instance @element: set of Expr instances @line_nb: int @heads: set of asm_label instances Return an iterator on DiGraph(DependencyNode)
Definition at line 973 of file depgraph.py.
|
static |
Update @follow/@nofollow according to insteresting nodes Returns same expression (non modifier visitor). @expr: expression to handle @follow: set of nodes to follow @nofollow: set of nodes not to follow
Definition at line 743 of file depgraph.py.
def miasm2.analysis.depgraph.DependencyGraph.get_from_depnodes | ( | self, | |
depnodes, | |||
heads | |||
) |
Alias for the get() method. Use the attributes of @depnodes as argument. PRE: Labels and lines of depnodes have to be equals @depnodes: set of DependencyNode instances @heads: set of asm_label instances
Definition at line 1010 of file depgraph.py.
def miasm2.analysis.depgraph.DependencyGraph.get_from_end | ( | self, | |
label, | |||
elements, | |||
heads | |||
) |
Alias for the get() method. Consider that the dependency is asked at the end of the block named @label. @label: asm_label instance @elements: set of Expr instances @heads: set of asm_label instances
Definition at line 1021 of file depgraph.py.
def miasm2.analysis.depgraph.DependencyGraph.inc_step | ( | self | ) |
Definition at line 727 of file depgraph.py.
def miasm2.analysis.depgraph.DependencyGraph.step_counter | ( | self | ) |
Definition at line 718 of file depgraph.py.
|
private |
Definition at line 709 of file depgraph.py.
|
private |
Definition at line 703 of file depgraph.py.
|
private |
Definition at line 701 of file depgraph.py.
|
private |
Definition at line 700 of file depgraph.py.
|
private |
Definition at line 702 of file depgraph.py.