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

Public Member Functions

def set_size (self, _)
 
def __init__ (self, size)
 
def get_is_canon (self)
 
def set_is_canon (self, value)
 
def __str__ (self)
 
def __getitem__ (self, i)
 
def get_size (self)
 
def is_function_call (self)
 
def __repr__ (self)
 
def __hash__ (self)
 
def __eq__ (self, other)
 
def __ne__ (self, other)
 
def __lt__ (self, other)
 
def __add__ (self, other)
 
def __sub__ (self, other)
 
def __div__ (self, other)
 
def __floordiv__ (self, other)
 
def __mod__ (self, other)
 
def __mul__ (self, other)
 
def __lshift__ (self, other)
 
def __rshift__ (self, other)
 
def __xor__ (self, other)
 
def __or__ (self, other)
 
def __and__ (self, other)
 
def __neg__ (self)
 
def __pow__ (self, other)
 
def __invert__ (self)
 
def copy (self)
 
def __deepcopy__ (self, _)
 
def replace_expr (self, dct)
 
def canonize (self)
 
def msb (self)
 
def zeroExtend (self, size)
 
def signExtend (self, size)
 
def graph_recursive (self, graph)
 
def graph (self)
 
def set_mask (self, value)
 
def is_int (self, value=None)
 
def is_id (self, name=None)
 
def is_loc (self, label=None)
 
def is_aff (self)
 
def is_assign (self)
 
def is_cond (self)
 
def is_mem (self)
 
def is_op (self, op=None)
 
def is_slice (self, start=None, stop=None)
 
def is_compose (self)
 
def is_op_segm (self)
 
def is_mem_segm (self)
 
def __contains__ (self, expr)
 
def visit (self, callback)
 
def get_r (self, mem_read=False, cst_read=False)
 
def get_w (self, mem_read=False, cst_read=False)
 

Static Public Member Functions

def get_object (expr_cls, args)
 

Static Public Attributes

dictionary args2expr = {}
 
 canon_exprs = set()
 
bool use_singleton = True
 

Properties

 size = property(lambda self: self._size)
 
 is_canon = property(get_is_canon, set_is_canon)
 
 mask = property(lambda self: ExprInt(-1, self.size))
 

Constructor & Destructor Documentation

◆ __init__()

def miasm.expression.expression.Expr.__init__ (   self,
  size 
)
Instantiate an Expr with size @size
@size: int

Member Function Documentation

◆ __add__()

def miasm.expression.expression.Expr.__add__ (   self,
  other 
)

◆ __and__()

def miasm.expression.expression.Expr.__and__ (   self,
  other 
)

◆ __contains__()

def miasm.expression.expression.Expr.__contains__ (   self,
  expr 
)

◆ __deepcopy__()

def miasm.expression.expression.Expr.__deepcopy__ (   self,
  _ 
)
Here is the call graph for this function:

◆ __div__()

def miasm.expression.expression.Expr.__div__ (   self,
  other 
)
Here is the caller graph for this function:

◆ __eq__()

def miasm.expression.expression.Expr.__eq__ (   self,
  other 
)
Here is the caller graph for this function:

◆ __floordiv__()

def miasm.expression.expression.Expr.__floordiv__ (   self,
  other 
)
Here is the call graph for this function:

◆ __getitem__()

def miasm.expression.expression.Expr.__getitem__ (   self,
  i 
)

◆ __hash__()

def miasm.expression.expression.Expr.__hash__ (   self)
Here is the call graph for this function:

◆ __invert__()

def miasm.expression.expression.Expr.__invert__ (   self)

◆ __lshift__()

def miasm.expression.expression.Expr.__lshift__ (   self,
  other 
)

◆ __lt__()

def miasm.expression.expression.Expr.__lt__ (   self,
  other 
)

◆ __mod__()

def miasm.expression.expression.Expr.__mod__ (   self,
  other 
)

◆ __mul__()

def miasm.expression.expression.Expr.__mul__ (   self,
  other 
)

◆ __ne__()

def miasm.expression.expression.Expr.__ne__ (   self,
  other 
)
Here is the call graph for this function:

◆ __neg__()

def miasm.expression.expression.Expr.__neg__ (   self)

◆ __or__()

def miasm.expression.expression.Expr.__or__ (   self,
  other 
)

◆ __pow__()

def miasm.expression.expression.Expr.__pow__ (   self,
  other 
)

◆ __repr__()

def miasm.expression.expression.Expr.__repr__ (   self)
Here is the call graph for this function:

◆ __rshift__()

def miasm.expression.expression.Expr.__rshift__ (   self,
  other 
)

◆ __str__()

◆ __sub__()

def miasm.expression.expression.Expr.__sub__ (   self,
  other 
)

◆ __xor__()

def miasm.expression.expression.Expr.__xor__ (   self,
  other 
)

◆ canonize()

def miasm.expression.expression.Expr.canonize (   self)

◆ copy()

◆ get_is_canon()

def miasm.expression.expression.Expr.get_is_canon (   self)

◆ get_object()

def miasm.expression.expression.Expr.get_object (   expr_cls,
  args 
)
static

◆ get_r()

def miasm.expression.expression.Expr.get_r (   self,
  mem_read = False,
  cst_read = False 
)

◆ get_size()

def miasm.expression.expression.Expr.get_size (   self)
Here is the caller graph for this function:

◆ get_w()

def miasm.expression.expression.Expr.get_w (   self,
  mem_read = False,
  cst_read = False 
)
Here is the call graph for this function:

◆ graph()

def miasm.expression.expression.Expr.graph (   self)
Return a DiGraph instance standing for Expr tree
Instance's display functions have been override for better visibility
Wrapper on graph_recursive
Here is the call graph for this function:

◆ graph_recursive()

def miasm.expression.expression.Expr.graph_recursive (   self,
  graph 
)
Recursive method used by graph
@graph: miasm.core.graph.DiGraph instance
Update @graph instance to include sons
This is an Abstract method

Reimplemented in miasm.expression.expression.ExprCompose, miasm.expression.expression.ExprSlice, miasm.expression.expression.ExprOp, miasm.expression.expression.ExprMem, miasm.expression.expression.ExprCond, miasm.expression.expression.ExprAssign, miasm.expression.expression.ExprLoc, miasm.expression.expression.ExprId, and miasm.expression.expression.ExprInt.

Here is the caller graph for this function:

◆ is_aff()

def miasm.expression.expression.Expr.is_aff (   self)

◆ is_assign()

def miasm.expression.expression.Expr.is_assign (   self)

Reimplemented in miasm.expression.expression.ExprAssign.

Here is the caller graph for this function:

◆ is_compose()

def miasm.expression.expression.Expr.is_compose (   self)

◆ is_cond()

def miasm.expression.expression.Expr.is_cond (   self)

◆ is_function_call()

def miasm.expression.expression.Expr.is_function_call (   self)
Returns true if the considered Expr is a function call

Reimplemented in miasm.expression.expression.ExprOp.

◆ is_id()

def miasm.expression.expression.Expr.is_id (   self,
  name = None 
)

◆ is_int()

def miasm.expression.expression.Expr.is_int (   self,
  value = None 
)

◆ is_loc()

def miasm.expression.expression.Expr.is_loc (   self,
  label = None 
)

◆ is_mem()

def miasm.expression.expression.Expr.is_mem (   self)

◆ is_mem_segm()

def miasm.expression.expression.Expr.is_mem_segm (   self)
Returns True if is ExprMem and ptr is_op_segm

Reimplemented in miasm.expression.expression.ExprMem.

◆ is_op()

def miasm.expression.expression.Expr.is_op (   self,
  op = None 
)

◆ is_op_segm()

def miasm.expression.expression.Expr.is_op_segm (   self)
Returns True if is ExprOp and op == 'segm'

Reimplemented in miasm.expression.expression.ExprOp.

◆ is_slice()

def miasm.expression.expression.Expr.is_slice (   self,
  start = None,
  stop = None 
)

◆ msb()

def miasm.expression.expression.Expr.msb (   self)

◆ replace_expr()

def miasm.expression.expression.Expr.replace_expr (   self,
  dct 
)
Find and replace sub expression using dct
@dct: dictionary associating replaced Expr to its new Expr value

◆ set_is_canon()

def miasm.expression.expression.Expr.set_is_canon (   self,
  value 
)

◆ set_mask()

def miasm.expression.expression.Expr.set_mask (   self,
  value 
)

◆ set_size()

def miasm.expression.expression.Expr.set_size (   self,
  _ 
)

◆ signExtend()

def miasm.expression.expression.Expr.signExtend (   self,
  size 
)
Sign extend to size
@size: int

◆ visit()

def miasm.expression.expression.Expr.visit (   self,
  callback 
)
Apply callback to all sub expression of @self
This function keeps a cache to avoid rerunning @callback on common sub
expressions.

@callback: fn(Expr) -> Expr
Here is the caller graph for this function:

◆ zeroExtend()

def miasm.expression.expression.Expr.zeroExtend (   self,
  size 
)
Zero extend to size
@size: int

Member Data Documentation

◆ args2expr

dictionary miasm.expression.expression.Expr.args2expr = {}
static

◆ canon_exprs

miasm.expression.expression.Expr.canon_exprs = set()
static

◆ use_singleton

bool miasm.expression.expression.Expr.use_singleton = True
static

Property Documentation

◆ is_canon

miasm.expression.expression.Expr.is_canon = property(get_is_canon, set_is_canon)
static

◆ mask

miasm.expression.expression.Expr.mask = property(lambda self: ExprInt(-1, self.size))
static

◆ size

miasm.expression.expression.Expr.size = property(lambda self: self._size)
static

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