about summary refs log tree commit diff stats
path: root/miasm2/core
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/core')
-rw-r--r--miasm2/core/cpu.py10
-rw-r--r--miasm2/core/sembuilder.py11
2 files changed, 11 insertions, 10 deletions
diff --git a/miasm2/core/cpu.py b/miasm2/core/cpu.py
index 8b906027..3502397d 100644
--- a/miasm2/core/cpu.py
+++ b/miasm2/core/cpu.py
@@ -196,7 +196,7 @@ def ast_id2expr(a):
 
 
 def ast_int2expr(a):
-    return m2_expr.ExprInt32(a)
+    return m2_expr.ExprInt(a, 32)
 
 
 
@@ -1558,19 +1558,19 @@ class imm_noarg(object):
 
 
 class imm08_noarg(object):
-    int2expr = lambda self, x: m2_expr.ExprInt08(x)
+    int2expr = lambda self, x: m2_expr.ExprInt(x, 8)
 
 
 class imm16_noarg(object):
-    int2expr = lambda self, x: m2_expr.ExprInt16(x)
+    int2expr = lambda self, x: m2_expr.ExprInt(x, 16)
 
 
 class imm32_noarg(object):
-    int2expr = lambda self, x: m2_expr.ExprInt32(x)
+    int2expr = lambda self, x: m2_expr.ExprInt(x, 32)
 
 
 class imm64_noarg(object):
-    int2expr = lambda self, x: m2_expr.ExprInt64(x)
+    int2expr = lambda self, x: m2_expr.ExprInt(x, 64)
 
 
 class int32_noarg(imm_noarg):
diff --git a/miasm2/core/sembuilder.py b/miasm2/core/sembuilder.py
index f101d94c..138e4552 100644
--- a/miasm2/core/sembuilder.py
+++ b/miasm2/core/sembuilder.py
@@ -32,7 +32,7 @@ class MiasmTransformer(ast.NodeTransformer):
         node = self.generic_visit(node)
 
         if isinstance(node.func, ast.Name):
-            # iX(Y) -> ExprIntX(Y)
+            # iX(Y) -> ExprInt(Y, X)
             fc_name = node.func.id
 
             # Match the function name
@@ -41,10 +41,11 @@ class MiasmTransformer(ast.NodeTransformer):
 
             # Do replacement
             if integer is not None:
-                new_name = "ExprInt%s" % integer.groups()[0]
-
-            # Replace in the node
-            node.func.id = new_name
+                size = int(integer.groups()[0])
+                new_name = "ExprInt"
+                # Replace in the node
+                node.func.id = new_name
+                node.args.append(ast.Num(n=size))
 
         elif (isinstance(node.func, ast.Str) or
               (isinstance(node.func, ast.BinOp) and