miasm
Reverse engineering framework
reduce_graph Namespace Reference

Classes

class  Arch
 
class  IRATest
 
class  Regs
 

Functions

def gen_irblock (label, exprs_list)
 
def cmp_ir_graph (g1, g2)
 

Variables

 loc_db = LocationDB()
 
 A = ExprId("a", 32)
 
 B = ExprId("b", 32)
 
 C = ExprId("c", 32)
 
 D = ExprId("d", 32)
 
 R = ExprId("r", 32)
 
 A_INIT = ExprId("a_init", 32)
 
 B_INIT = ExprId("b_init", 32)
 
 C_INIT = ExprId("c_init", 32)
 
 D_INIT = ExprId("d_init", 32)
 
 IRDst = ExprId("IRDst", 32)
 
 PC = ExprId("pc", 32)
 
 SP = ExprId("sp", 32)
 
 CST0 = ExprInt(0x0, 32)
 
 CST1 = ExprInt(0x1, 32)
 
 CST2 = ExprInt(0x2, 32)
 
 CST3 = ExprInt(0x3, 32)
 
 CST22 = ExprInt(0x22, 32)
 
 CST23 = ExprInt(0x23, 32)
 
 CST24 = ExprInt(0x24, 32)
 
 CST33 = ExprInt(0x33, 32)
 
 CST35 = ExprInt(0x35, 32)
 
 CST37 = ExprInt(0x37, 32)
 
 LBL0 = loc_db.add_location("lbl0", 0)
 
 LBL1 = loc_db.add_location("lbl1", 1)
 
 LBL2 = loc_db.add_location("lbl2", 2)
 
 LBL3 = loc_db.add_location("lbl3", 3)
 
 LBL4 = loc_db.add_location("lbl4", 4)
 
 LBL5 = loc_db.add_location("lbl5", 5)
 
 LBL6 = loc_db.add_location("lbl6", 6)
 
 IRA = IRATest(loc_db)
 Tests #############. More...
 
 G1 = IRA.new_ircfg()
 G1 ########## Input. More...
 
def G1_IRB0
 
def G1_IRB1
 
def G1_IRB2
 
 G1_RES = IRA.new_ircfg()
 
def G1_RES_IRB0
 
 G2 = IRA.new_ircfg()
 G2 ########## Input. More...
 
def G2_IRB0
 
def G2_IRB1
 
 G2_RES = IRA.new_ircfg()
 
def G2_RES_IRB0
 
 G3 = IRA.new_ircfg()
 G3 ########## Input. More...
 
def G3_IRB0
 
def G3_IRB1
 
def G3_IRB2
 
 G3_RES = IRA.new_ircfg()
 
def G3_RES_IRB0
 
 G4 = IRA.new_ircfg()
 G4 ########## Input. More...
 
def G4_IRB0
 
def G4_IRB1
 
def G4_IRB2
 
 G4_RES = IRA.new_ircfg()
 
def G4_RES_IRB0
 
def G4_RES_IRB1
 
 G5 = IRA.new_ircfg()
 G5 ########## Input. More...
 
def G5_IRB0
 
def G5_IRB1
 
def G5_IRB2
 
def G5_IRB3
 
 G5_RES = IRA.new_ircfg()
 
def G5_RES_IRB0
 
def G5_RES_IRB1
 
def G5_RES_IRB3
 
 G6 = IRA.new_ircfg()
 G6 ########## Input. More...
 
def G6_IRB0
 
def G6_IRB1
 
def G6_IRB2
 
def G6_IRB3
 
 G6_RES = IRA.new_ircfg()
 
def G6_RES_IRB0
 
def G6_RES_IRB2
 
def G6_RES_IRB3
 
 G7 = IRA.new_ircfg()
 G7 ########## Input. More...
 
def G7_IRB0
 
def G7_IRB1
 
 G7_RES = IRA.new_ircfg()
 
def G7_RES_IRB0
 
def G7_RES_IRB1
 
 G8 = IRA.new_ircfg()
 G8 ########## Input. More...
 
def G8_IRB0
 
def G8_IRB1
 
 G8_RES = IRA.new_ircfg()
 
def G8_RES_IRB0
 
def G8_RES_IRB1
 
 heads = g_test.heads()
 Tests. More...
 

Detailed Description

Regression test module for DependencyGraph

Function Documentation

◆ cmp_ir_graph()

def reduce_graph.cmp_ir_graph (   g1,
  g2 
)

◆ gen_irblock()

def reduce_graph.gen_irblock (   label,
  exprs_list 
)
 Returns an IRBlock.
Used only for tests purpose

Variable Documentation

◆ A

reduce_graph.A = ExprId("a", 32)

◆ A_INIT

reduce_graph.A_INIT = ExprId("a_init", 32)

◆ B

reduce_graph.B = ExprId("b", 32)

◆ B_INIT

reduce_graph.B_INIT = ExprId("b_init", 32)

◆ C

reduce_graph.C = ExprId("c", 32)

◆ C_INIT

reduce_graph.C_INIT = ExprId("c_init", 32)

◆ CST0

reduce_graph.CST0 = ExprInt(0x0, 32)

◆ CST1

reduce_graph.CST1 = ExprInt(0x1, 32)

◆ CST2

reduce_graph.CST2 = ExprInt(0x2, 32)

◆ CST22

reduce_graph.CST22 = ExprInt(0x22, 32)

◆ CST23

reduce_graph.CST23 = ExprInt(0x23, 32)

◆ CST24

reduce_graph.CST24 = ExprInt(0x24, 32)

◆ CST3

reduce_graph.CST3 = ExprInt(0x3, 32)

◆ CST33

reduce_graph.CST33 = ExprInt(0x33, 32)

◆ CST35

reduce_graph.CST35 = ExprInt(0x35, 32)

◆ CST37

reduce_graph.CST37 = ExprInt(0x37, 32)

◆ D

reduce_graph.D = ExprId("d", 32)

◆ D_INIT

reduce_graph.D_INIT = ExprId("d_init", 32)

◆ G1

reduce_graph.G1 = IRA.new_ircfg()

G1 ########## Input.

◆ G1_IRB0

def reduce_graph.G1_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(B, C),
6  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
7  ]
8  ]
9 )

◆ G1_IRB1

def reduce_graph.G1_IRB1
Initial value:
2  LBL1,
3  [
4  [
5  ExprAssign(IRDst, ExprLoc(LBL2, 32)),
6  ]
7  ]
8 )

◆ G1_IRB2

def reduce_graph.G1_IRB2
Initial value:
2  LBL2,
3  [
4  [
5  ExprAssign(A, B),
6  ExprAssign(IRDst, C),
7  ]
8  ]
9 )

◆ G1_RES

reduce_graph.G1_RES = IRA.new_ircfg()

◆ G1_RES_IRB0

def reduce_graph.G1_RES_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(B, C),
6  ],
7  [
8  ExprAssign(A, B),
9  ExprAssign(IRDst, C),
10  ]
11 
12  ]
13 )

◆ G2

reduce_graph.G2 = IRA.new_ircfg()

G2 ########## Input.

◆ G2_IRB0

def reduce_graph.G2_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
6  ]
7  ]
8 )

◆ G2_IRB1

def reduce_graph.G2_IRB1
Initial value:
2  LBL1,
3  [
4  [
5  ExprAssign(A, C),
6  ExprAssign(IRDst, C),
7  ]
8  ]
9 )

◆ G2_RES

reduce_graph.G2_RES = IRA.new_ircfg()

◆ G2_RES_IRB0

def reduce_graph.G2_RES_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(A, C),
6  ExprAssign(IRDst, C),
7  ]
8  ]
9 )

◆ G3

reduce_graph.G3 = IRA.new_ircfg()

G3 ########## Input.

◆ G3_IRB0

def reduce_graph.G3_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
6  ]
7  ]
8 )

◆ G3_IRB1

def reduce_graph.G3_IRB1
Initial value:
2  LBL1,
3  [
4  [
5  ExprAssign(A, C),
6  ExprAssign(IRDst, ExprLoc(LBL2, 32)),
7  ]
8  ]
9 )

◆ G3_IRB2

def reduce_graph.G3_IRB2
Initial value:
2  LBL2,
3  [
4  [
5  ExprAssign(D, A),
6  ExprAssign(IRDst, C),
7  ]
8  ]
9 )

◆ G3_RES

reduce_graph.G3_RES = IRA.new_ircfg()

◆ G3_RES_IRB0

def reduce_graph.G3_RES_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(A, C),
6  ],
7  [
8  ExprAssign(D, A),
9  ExprAssign(IRDst, C),
10  ]
11  ]
12 )

◆ G4

reduce_graph.G4 = IRA.new_ircfg()

G4 ########## Input.

◆ G4_IRB0

def reduce_graph.G4_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
6  ]
7  ]
8 )

◆ G4_IRB1

def reduce_graph.G4_IRB1
Initial value:
2  LBL1,
3  [
4  [
5  ExprAssign(A, C),
6  ExprAssign(IRDst, ExprLoc(LBL2, 32)),
7  ]
8  ]
9 )

◆ G4_IRB2

def reduce_graph.G4_IRB2
Initial value:
2  LBL2,
3  [
4  [
5  ExprAssign(D, A),
6  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
7  ]
8  ]
9 )

◆ G4_RES

reduce_graph.G4_RES = IRA.new_ircfg()

◆ G4_RES_IRB0

def reduce_graph.G4_RES_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
6  ]
7  ]
8 )

◆ G4_RES_IRB1

def reduce_graph.G4_RES_IRB1
Initial value:
2  LBL1,
3  [
4  [
5  ExprAssign(A, C),
6  ],
7  [
8  ExprAssign(D, A),
9  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
10  ]
11  ]
12 )

◆ G5

reduce_graph.G5 = IRA.new_ircfg()

G5 ########## Input.

◆ G5_IRB0

def reduce_graph.G5_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
6  ]
7  ]
8 )

◆ G5_IRB1

def reduce_graph.G5_IRB1
Initial value:
2  LBL1,
3  [
4  [
5  ExprAssign(A, C),
6  ExprAssign(IRDst, ExprLoc(LBL2, 32)),
7  ]
8  ]
9 )

◆ G5_IRB2

def reduce_graph.G5_IRB2
Initial value:
2  LBL2,
3  [
4  [
5  ExprAssign(D, A),
6  ExprAssign(IRDst, ExprCond(C, ExprLoc(LBL1, 32), ExprLoc(LBL3, 32))),
7  ]
8  ]
9 )

◆ G5_IRB3

def reduce_graph.G5_IRB3
Initial value:
2  LBL3,
3  [
4  [
5  ExprAssign(D, A),
6  ExprAssign(IRDst, C),
7  ]
8  ]
9 )

◆ G5_RES

reduce_graph.G5_RES = IRA.new_ircfg()

◆ G5_RES_IRB0

def reduce_graph.G5_RES_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
6  ]
7  ]
8 )

◆ G5_RES_IRB1

def reduce_graph.G5_RES_IRB1
Initial value:
2  LBL1,
3  [
4  [
5  ExprAssign(A, C),
6  ],
7  [
8  ExprAssign(D, A),
9  ExprAssign(IRDst, ExprCond(C, ExprLoc(LBL1, 32), ExprLoc(LBL3, 32))),
10  ]
11  ]
12 )

◆ G5_RES_IRB3

def reduce_graph.G5_RES_IRB3
Initial value:
2  LBL3,
3  [
4  [
5  ExprAssign(D, A),
6  ExprAssign(IRDst, C),
7  ]
8  ]
9 )

◆ G6

reduce_graph.G6 = IRA.new_ircfg()

G6 ########## Input.

◆ G6_IRB0

def reduce_graph.G6_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(IRDst, ExprCond(C, ExprLoc(LBL1, 32), ExprLoc(LBL2, 32))),
6  ]
7  ]
8 )

◆ G6_IRB1

def reduce_graph.G6_IRB1
Initial value:
2  LBL1,
3  [
4  [
5  ExprAssign(IRDst, ExprLoc(LBL3, 32)),
6  ]
7  ]
8 )

◆ G6_IRB2

def reduce_graph.G6_IRB2
Initial value:
2  LBL2,
3  [
4  [
5  ExprAssign(D, A),
6  ExprAssign(IRDst, D),
7  ]
8  ]
9 )

◆ G6_IRB3

def reduce_graph.G6_IRB3
Initial value:
2  LBL3,
3  [
4  [
5  ExprAssign(A, D),
6  ExprAssign(IRDst, ExprLoc(LBL3, 32)),
7  ]
8  ]
9 )

◆ G6_RES

reduce_graph.G6_RES = IRA.new_ircfg()

◆ G6_RES_IRB0

def reduce_graph.G6_RES_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(IRDst, ExprCond(C, ExprLoc(LBL3, 32), ExprLoc(LBL2, 32))),
6  ]
7  ]
8 )

◆ G6_RES_IRB2

def reduce_graph.G6_RES_IRB2
Initial value:
2  LBL2,
3  [
4  [
5  ExprAssign(D, A),
6  ExprAssign(IRDst, D),
7  ]
8  ]
9 )

◆ G6_RES_IRB3

def reduce_graph.G6_RES_IRB3
Initial value:
2  LBL3,
3  [
4  [
5  ExprAssign(A, D),
6  ExprAssign(IRDst, ExprLoc(LBL3, 32)),
7  ]
8  ]
9 )

◆ G7

reduce_graph.G7 = IRA.new_ircfg()

G7 ########## Input.

◆ G7_IRB0

def reduce_graph.G7_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(A, C),
6  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
7  ]
8  ]
9 )

◆ G7_IRB1

def reduce_graph.G7_IRB1
Initial value:
2  LBL1,
3  [
4  [
5  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
6  ]
7  ]
8 )

◆ G7_RES

reduce_graph.G7_RES = IRA.new_ircfg()

◆ G7_RES_IRB0

def reduce_graph.G7_RES_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(A, C),
6  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
7  ]
8  ]
9 )

◆ G7_RES_IRB1

def reduce_graph.G7_RES_IRB1
Initial value:
2  LBL1,
3  [
4  [
5  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
6  ]
7  ]
8 )

◆ G8

reduce_graph.G8 = IRA.new_ircfg()

G8 ########## Input.

◆ G8_IRB0

def reduce_graph.G8_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
6  ]
7  ]
8 )

◆ G8_IRB1

def reduce_graph.G8_IRB1
Initial value:
2  LBL1,
3  [
4  [
5  ExprAssign(A, C),
6  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
7  ]
8  ]
9 )

◆ G8_RES

reduce_graph.G8_RES = IRA.new_ircfg()

◆ G8_RES_IRB0

def reduce_graph.G8_RES_IRB0
Initial value:
2  LBL0,
3  [
4  [
5  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
6  ]
7  ]
8 )

◆ G8_RES_IRB1

def reduce_graph.G8_RES_IRB1
Initial value:
2  LBL1,
3  [
4  [
5  ExprAssign(A, C),
6  ExprAssign(IRDst, ExprLoc(LBL1, 32)),
7  ]
8  ]
9 )

◆ heads

reduce_graph.heads = g_test.heads()

Tests.

◆ IRA

reduce_graph.IRA = IRATest(loc_db)

Tests #############.

◆ IRDst

reduce_graph.IRDst = ExprId("IRDst", 32)

◆ LBL0

reduce_graph.LBL0 = loc_db.add_location("lbl0", 0)

◆ LBL1

reduce_graph.LBL1 = loc_db.add_location("lbl1", 1)

◆ LBL2

reduce_graph.LBL2 = loc_db.add_location("lbl2", 2)

◆ LBL3

reduce_graph.LBL3 = loc_db.add_location("lbl3", 3)

◆ LBL4

reduce_graph.LBL4 = loc_db.add_location("lbl4", 4)

◆ LBL5

reduce_graph.LBL5 = loc_db.add_location("lbl5", 5)

◆ LBL6

reduce_graph.LBL6 = loc_db.add_location("lbl6", 6)

◆ loc_db

reduce_graph.loc_db = LocationDB()

◆ PC

reduce_graph.PC = ExprId("pc", 32)

◆ R

reduce_graph.R = ExprId("r", 32)

◆ SP

reduce_graph.SP = ExprId("sp", 32)
reduce_graph.gen_irblock
def gen_irblock(label, exprs_list)
Definition: reduce_graph.py:87