miasm
Reverse engineering framework
|
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 | |
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)) } }
def miasm.analysis.data_flow.ReachingDefinitions.__init__ | ( | self, | |
ircfg | |||
) |
def miasm.analysis.data_flow.ReachingDefinitions.compute | ( | self | ) |
This is the main fixpoint
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
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).
def miasm.analysis.data_flow.ReachingDefinitions.process_block | ( | self, | |
block | |||
) |
Fetch reach definitions from predecessors and propagate it to the assignblk in block @block.
|
static |