miasm
Reverse engineering framework
miasm.analysis.data_flow.DeadRemoval Class Reference
Inheritance diagram for miasm.analysis.data_flow.DeadRemoval:
Collaboration diagram for miasm.analysis.data_flow.DeadRemoval:

Public Member Functions

def __init__ (self, ir_arch, expr_to_original_expr=None)
 
def add_expr_to_original_expr (self, expr_to_original_expr)
 
def is_unkillable_destination (self, lval, rval)
 
def get_block_useful_destinations (self, block)
 
def is_tracked_var (self, lval, variable)
 
def find_definitions_from_worklist (self, worklist, ircfg)
 
def find_out_regs_definitions_from_block (self, block, ircfg)
 
def add_def_for_incomplete_leaf (self, block, ircfg, reaching_defs)
 
def get_useful_assignments (self, ircfg, defuse, reaching_defs)
 
def do_dead_removal (self, ircfg)
 
def __call__ (self, ircfg)
 

Public Attributes

 ir_arch
 
 expr_to_original_expr
 

Detailed Description

Do dead removal

Constructor & Destructor Documentation

◆ __init__()

def miasm.analysis.data_flow.DeadRemoval.__init__ (   self,
  ir_arch,
  expr_to_original_expr = None 
)

Member Function Documentation

◆ __call__()

def miasm.analysis.data_flow.DeadRemoval.__call__ (   self,
  ircfg 
)
Here is the call graph for this function:

◆ add_def_for_incomplete_leaf()

def miasm.analysis.data_flow.DeadRemoval.add_def_for_incomplete_leaf (   self,
  block,
  ircfg,
  reaching_defs 
)
Add valid definitions at end of @block plus out regs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_expr_to_original_expr()

def miasm.analysis.data_flow.DeadRemoval.add_expr_to_original_expr (   self,
  expr_to_original_expr 
)

◆ do_dead_removal()

def miasm.analysis.data_flow.DeadRemoval.do_dead_removal (   self,
  ircfg 
)
Remove useless assignments.

This function is used to analyse relation of a * complete function *
This means the blocks under study represent a solid full function graph.

Source : Kennedy, K. (1979). A survey of data flow analysis techniques.
IBM Thomas J. Watson Research Division, page 43

@ircfg: IntermediateRepresentation instance
Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_definitions_from_worklist()

def miasm.analysis.data_flow.DeadRemoval.find_definitions_from_worklist (   self,
  worklist,
  ircfg 
)
Find variables definition in @worklist by browsing the @ircfg
Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_out_regs_definitions_from_block()

def miasm.analysis.data_flow.DeadRemoval.find_out_regs_definitions_from_block (   self,
  block,
  ircfg 
)
Find definitions of out regs starting from @block
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_block_useful_destinations()

def miasm.analysis.data_flow.DeadRemoval.get_block_useful_destinations (   self,
  block 
)
Force keeping of specific cases
block: IRBlock instance
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_useful_assignments()

def miasm.analysis.data_flow.DeadRemoval.get_useful_assignments (   self,
  ircfg,
  defuse,
  reaching_defs 
)
Mark useful statements using previous reach analysis and defuse

Return a set of triplets (block, assignblk number, lvalue) of
useful definitions
PRE: compute_reach(self)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_tracked_var()

def miasm.analysis.data_flow.DeadRemoval.is_tracked_var (   self,
  lval,
  variable 
)
Here is the caller graph for this function:

◆ is_unkillable_destination()

def miasm.analysis.data_flow.DeadRemoval.is_unkillable_destination (   self,
  lval,
  rval 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ expr_to_original_expr

miasm.analysis.data_flow.DeadRemoval.expr_to_original_expr

◆ ir_arch

miasm.analysis.data_flow.DeadRemoval.ir_arch

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