miasm
Reverse engineering framework
miasm.expression.expression_reduce.ExprReducer Class Reference
Inheritance diagram for miasm.expression.expression_reduce.ExprReducer:
Collaboration diagram for miasm.expression.expression_reduce.ExprReducer:

Public Member Functions

def expr2node (self, expr)
 
def reduce (self, expr, **kwargs)
 
def categorize (self, node, lvl=0, **kwargs)
 
def apply_rules (self, node, lvl=0, **kwargs)
 

Static Public Attributes

list reduction_rules = []
 
bool allow_none_result = False
 

Detailed Description

Apply reduction rules to an expr

reduction_rules: list of ordered reduction rules

List of function representing reduction rules
Function API:
reduction_xxx(self, node, lvl=0)
with:
* node: the ExprNode to qualify
* lvl: [optional] the recursion level
Returns:
* None if the reduction rule is not applied
* the resulting information to store in the ExprNode.info

allow_none_result: allow missing reduction rules

Member Function Documentation

◆ apply_rules()

def miasm.expression.expression_reduce.ExprReducer.apply_rules (   self,
  node,
  lvl = 0,
**  kwargs 
)
Find and apply reduction rules to @node

@node: ExprNode to analyse
@lvl: actuel recursion level
Here is the caller graph for this function:

◆ categorize()

def miasm.expression.expression_reduce.ExprReducer.categorize (   self,
  node,
  lvl = 0,
**  kwargs 
)
Recursively apply rules to @node

@node: ExprNode to analyze
@lvl: actual recursion level
Here is the call graph for this function:
Here is the caller graph for this function:

◆ expr2node()

def miasm.expression.expression_reduce.ExprReducer.expr2node (   self,
  expr 
)
Build ExprNode mirror of @expr

@expr: Expression to analyze
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reduce()

def miasm.expression.expression_reduce.ExprReducer.reduce (   self,
  expr,
**  kwargs 
)
Returns an ExprNode tree mirroring @expr tree. The ExprNode is
computed by applying reduction rules to the expression @expr

@expr: an Expression
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ allow_none_result

bool miasm.expression.expression_reduce.ExprReducer.allow_none_result = False
static

◆ reduction_rules

list miasm.expression.expression_reduce.ExprReducer.reduction_rules = []
static

The documentation for this class was generated from the following file: