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

Public Member Functions

def __init__ (self, ircfg)
 
def get_definitions (self, block_lbl, assignblk_index)
 
def compute (self)
 
def process_block (self, block)
 
def process_assignblock (self, block, assignblk_index)
 

Static Public Attributes

 ircfg = None
 

Detailed Description

Computes for each assignblock the set of reaching definitions.
Example:
IR block:
lbl0:
   0 A = 1
     B = 3
   1 B = 2
   2 A = A + B + 4

Reach definition of lbl0:
(lbl0, 0) => {}
(lbl0, 1) => {A: {(lbl0, 0)}, B: {(lbl0, 0)}}
(lbl0, 2) => {A: {(lbl0, 0)}, B: {(lbl0, 1)}}
(lbl0, 3) => {A: {(lbl0, 2)}, B: {(lbl0, 1)}}

Source set 'REACHES' in: Kennedy, K. (1979).
A survey of data flow analysis techniques.
IBM Thomas J. Watson Research Division,  Algorithm MK

This class is usable as a dictionary whose structure is
{ (block, index): { lvalue: set((block, index)) } }

Constructor & Destructor Documentation

◆ __init__()

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

Member Function Documentation

◆ compute()

def miasm.analysis.data_flow.ReachingDefinitions.compute (   self)
This is the main fixpoint
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_definitions()

def miasm.analysis.data_flow.ReachingDefinitions.get_definitions (   self,
  block_lbl,
  assignblk_index 
)
Returns the dict { lvalue: set((def_block_lbl, def_index)) }
associated with self.ircfg.@block.assignblks[@assignblk_index]
or {} if it is not yet computed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_assignblock()

def miasm.analysis.data_flow.ReachingDefinitions.process_assignblock (   self,
  block,
  assignblk_index 
)
Updates the reach definitions with values defined at
assignblock @assignblk_index in block @block.
NB: the effect of assignblock @assignblk_index in stored at index
(@block, @assignblk_index + 1).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_block()

def miasm.analysis.data_flow.ReachingDefinitions.process_block (   self,
  block 
)
Fetch reach definitions from predecessors and propagate it to
the assignblk in block @block.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ircfg

miasm.analysis.data_flow.ReachingDefinitions.ircfg = None
static

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