about summary refs log tree commit diff stats
path: root/example/expression
diff options
context:
space:
mode:
Diffstat (limited to 'example/expression')
-rw-r--r--example/expression/basic_simplification.py2
-rw-r--r--example/expression/expr_grapher.py2
-rw-r--r--example/expression/simplification_tools.py12
-rw-r--r--example/expression/solve_condition_stp.py3
4 files changed, 10 insertions, 9 deletions
diff --git a/example/expression/basic_simplification.py b/example/expression/basic_simplification.py
index 17b1a35b..ef904686 100644
--- a/example/expression/basic_simplification.py
+++ b/example/expression/basic_simplification.py
@@ -10,7 +10,7 @@ a = ExprId('eax')
 b = ExprId('ebx')
 
 exprs = [a + b - a,
-         ExprInt32(0x12) + ExprInt32(0x30) - a,
+         ExprInt(0x12, 32) + ExprInt(0x30, 32) - a,
          ExprCompose(a[:8], a[8:16])]
 
 for e in exprs:
diff --git a/example/expression/expr_grapher.py b/example/expression/expr_grapher.py
index 3137e6d2..0de2142b 100644
--- a/example/expression/expr_grapher.py
+++ b/example/expression/expr_grapher.py
@@ -9,7 +9,7 @@ d = ExprId("D")
 m = ExprMem(a + b + c + a)
 
 e1 = ExprCompose(a + b - (c * a) / m | b, a + m)
-e2 = ExprInt64(15)
+e2 = ExprInt(15, 64)
 e = ExprCond(d, e1, e2)[0:32]
 
 print "[+] Expression:"
diff --git a/example/expression/simplification_tools.py b/example/expression/simplification_tools.py
index 9b8aeed5..6a4ff715 100644
--- a/example/expression/simplification_tools.py
+++ b/example/expression/simplification_tools.py
@@ -21,8 +21,8 @@ e = ExprId('e')
 m = ExprMem(a)
 s = a[:8]
 
-i1 = ExprInt(uint32(0x1))
-i2 = ExprInt(uint32(0x2))
+i1 = ExprInt(0x1, 32)
+i2 = ExprInt(0x2, 32)
 cc = ExprCond(a, b, c)
 
 o = ExprCompose(a[8:16], a[:8])
@@ -33,12 +33,12 @@ l = [a[:8], b[:8], c[:8], m[:8], s, i1[:8], i2[:8], o[:8]]
 l2 = l[::-1]
 
 
-x = ExprMem(a + b + ExprInt32(0x42))
+x = ExprMem(a + b + ExprInt(0x42, 32))
 
 
 def replace_expr(e):
     # print 'visit', e
-    dct = {c + ExprInt32(0x42): d,
+    dct = {c + ExprInt(0x42, 32): d,
            a + b: c, }
     if e in dct:
         return dct[e]
@@ -60,9 +60,9 @@ print z.copy()
 print z[:31].copy().visit(replace_expr)
 
 print 'replace'
-print x.replace_expr({c + ExprInt32(0x42): d,
+print x.replace_expr({c + ExprInt(0x42, 32): d,
                       a + b: c, })
-print z.replace_expr({c + ExprInt32(0x42): d,
+print z.replace_expr({c + ExprInt(0x42, 32): d,
                       a + b: c, })
 
 
diff --git a/example/expression/solve_condition_stp.py b/example/expression/solve_condition_stp.py
index 03d652cf..0ca17faa 100644
--- a/example/expression/solve_condition_stp.py
+++ b/example/expression/solve_condition_stp.py
@@ -11,6 +11,7 @@ from miasm2.arch.x86.sem import *
 from miasm2.core.bin_stream import bin_stream_str
 from miasm2.core import asmblock
 from miasm2.expression.expression import get_rw
+from miasm2.expression.modint import uint32
 from miasm2.ir.symbexec import SymbolicExecutionEngine
 from miasm2.expression.simplifications import expr_simp
 from miasm2.expression import stp
@@ -134,7 +135,7 @@ if __name__ == '__main__':
     reg_and_id = dict(mn_x86.regs.all_regs_ids_byname)
 
     def my_ast_int2expr(a):
-        return ExprInt32(a)
+        return ExprInt(a, 32)
 
     # Modifify parser to avoid label creation in PUSH argc
     def my_ast_id2expr(string_parsed):