miasm
Reverse engineering framework
simplifications.py File Reference

Namespaces

 simplifications
 

Functions

def simplifications.check (expr_in, expr_out)
 

Variables

 simplifications.parser = ArgumentParser("Expression simplification regression tests")
 
 simplifications.action
 
 simplifications.help
 
 simplifications.args = parser.parse_args()
 
 simplifications.trans = Translator.to_language("z3")
 
 simplifications.check = lambda expr_in, expr_out: None
 
 simplifications.a = ExprId('a', 32)
 
 simplifications.b = ExprId('b', 32)
 
 simplifications.c = ExprId('c', 32)
 
 simplifications.d = ExprId('d', 32)
 
 simplifications.e = ExprId('e', 32)
 
 simplifications.f = ExprId('f', size=64)
 
 simplifications.b_msb_null = b[:31].zeroExtend(32)
 
 simplifications.c_msb_null = c[:31].zeroExtend(32)
 
 simplifications.a31 = ExprId('a31', 31)
 
 simplifications.b31 = ExprId('b31', 31)
 
 simplifications.c31 = ExprId('c31', 31)
 
 simplifications.b31_msb_null = ExprId('b31', 31)[:30].zeroExtend(31)
 
 simplifications.c31_msb_null = ExprId('c31', 31)[:30].zeroExtend(31)
 
 simplifications.a8 = ExprId('a8', 8)
 
 simplifications.b8 = ExprId('b8', 8)
 
 simplifications.c8 = ExprId('c8', 8)
 
 simplifications.d8 = ExprId('d8', 8)
 
 simplifications.e8 = ExprId('e8', 8)
 
 simplifications.m = ExprMem(a, 32)
 
 simplifications.s = a[:8]
 
 simplifications.i0 = ExprInt(0, 32)
 
 simplifications.i1 = ExprInt(1, 32)
 
 simplifications.i2 = ExprInt(2, 32)
 
 simplifications.i3 = ExprInt(3, 32)
 
 simplifications.im1 = ExprInt(-1, 32)
 
 simplifications.im2 = ExprInt(-2, 32)
 
 simplifications.bi0 = ExprInt(0, 1)
 
 simplifications.bi1 = ExprInt(1, 1)
 
 simplifications.icustom = ExprInt(0x12345678, 32)
 
 simplifications.cc = ExprCond(a, b, c)
 
 simplifications.o = ExprCompose(a[8:16], a[:8])
 
 simplifications.o2 = ExprCompose(a[8:16], a[:8])
 
list simplifications.l = [a[:8], b[:8], c[:8], m[:8], s, i1[:8], i2[:8], o[:8]]
 
list simplifications.l2 = l[::-1]
 
 simplifications.x = ExprMem(a + b + ExprInt(0x42, 32), 32)
 
list simplifications.to_test
 
 simplifications.e_new = expr_simp_explicit(e_input)
 
 simplifications.rez = e_check
 
 simplifications.e_check = expr_simp(e_check)
 
 simplifications.x1 = ExprId("x1", 32)
 
 simplifications.x2 = ExprId("x2", 32)
 
 simplifications.i1_tmp = ExprInt(1, 1)
 
 simplifications.x1_z3 = trans.from_expr(x1)
 
 simplifications.x2_z3 = trans.from_expr(x2)
 
 simplifications.i1_z3 = trans.from_expr(i1_tmp)
 
list simplifications.tests
 
 simplifications.solver = z3.Solver()
 
 simplifications.y = ExprId('y', 32)
 
 simplifications.z = ExprId('z', 32)
 
 simplifications.jra = ExprId('jra', 32)
 
 simplifications.jrb = ExprId('jrb', 32)
 
 simplifications.jrint1 = ExprId('jrint1', 32)
 
 simplifications.e1 = ExprMem((a & ExprInt(0xFFFFFFFC, 32)) + ExprInt(0x10, 32), 32)
 
 simplifications.e2 = ExprMem((a & ExprInt(0xFFFFFFFC, 32)) + b, 32)
 
tuple simplifications.e3 = (a ^ b ^ ((a ^ b) & (b ^ (b - a))) ^ (b - a)).canonize()
 
list simplifications.match_tests
 
list simplifications.get_tests