about summary refs log tree commit diff stats
path: root/miasm2/arch/x86/arch.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--miasm2/arch/x86/arch.py40
1 files changed, 20 insertions, 20 deletions
diff --git a/miasm2/arch/x86/arch.py b/miasm2/arch/x86/arch.py
index 28cac255..4a07571f 100644
--- a/miasm2/arch/x86/arch.py
+++ b/miasm2/arch/x86/arch.py
@@ -554,7 +554,7 @@ class instruction_x86(instruction):
         if not isinstance(expr, ExprInt):
             log.warning('dynamic dst %r', expr)
             return
-        self.args[0] = ExprInt(int(expr.arg) - self.offset, self.mode)
+        self.args[0] = ExprInt(int(expr) - self.offset, self.mode)
 
     def get_info(self, c):
         self.additional_info.g1.value = c.g1.value
@@ -1139,7 +1139,7 @@ class x86_s08to16(x86_imm):
     def expr2int(self, e):
         if not isinstance(e, ExprInt):
             return None
-        v = int(e.arg)
+        v = int(e)
         if v & ~((1 << self.l) - 1) != 0:
             return None
         return v
@@ -1158,7 +1158,7 @@ class x86_s08to16(x86_imm):
     def encode(self):
         if not isinstance(self.expr, ExprInt):
             return False
-        v = int(self.expr.arg)
+        v = int(self.expr)
         opmode = self.parent.v_opmode()
 
         out_size = self.out_size
@@ -1701,7 +1701,7 @@ def exprfindmod(e, o=None):
                 out = r
             return out
         elif e.op == "*":
-            mul = int(e.args[1].arg)
+            mul = int(e.args[1])
             a = e.args[0]
             i = size2gpregs[a.size].expr.index(a)
             o[i] = mul
@@ -1767,16 +1767,16 @@ def parse_mem(expr, parent, w8, sx=0, xmm=0, mm=0):
                                            (False, f_u08, ExprInt8),
                                            (False, f_u16, ExprInt16),
                                            (False, f_u32, ExprInt32)]:
-            value = cast_int(int(disp.arg))
+            value = cast_int(int(disp))
             if admode < value.size:
                 if signed:
-                    if int(disp.arg) != sign_ext(int(value.arg), admode, disp.size):
+                    if int(disp.arg) != sign_ext(int(value), admode, disp.size):
                         continue
                 else:
-                    if int(disp.arg) != int(value.arg):
+                    if int(disp.arg) != int(value):
                         continue
             else:
-                if int(disp.arg) != sign_ext(int(value.arg), value.size, admode):
+                if int(disp.arg) != sign_ext(int(value), value.size, admode):
                     continue
             x1 = dict(dct_expr)
             x1[f_imm] = (encoding, value)
@@ -1900,7 +1900,7 @@ def modrm2expr(modrm, parent, w8, sx=0, xmm=0, mm=0):
     if f_imm in modrm:
         if parent.disp.value is None:
             return None
-        o.append(ExprInt(int(parent.disp.expr.arg), admode))
+        o.append(ExprInt(int(parent.disp.expr), admode))
     expr = ExprOp('+', *o)
     if w8 == 0:
         opmode = 8
@@ -1972,7 +1972,7 @@ class x86_rm_arg(m_arg):
         moddd = False
         for v in v_cand:
             new_v_cand.append(v)
-            if f_imm in v and int(v[f_imm][1].arg) == 0:
+            if f_imm in v and int(v[f_imm][1]) == 0:
                 v = dict(v)
                 del(v[f_imm])
                 new_v_cand.append(v)
@@ -1986,7 +1986,7 @@ class x86_rm_arg(m_arg):
             # patch value in modrm
             if f_imm in v:
                 size, disp = v[f_imm]
-                disp = int(disp.arg)
+                disp = int(disp)
 
                 v[f_imm] = size
             vo = v
@@ -2580,7 +2580,7 @@ class bs_cl1(bsi, m_arg):
     def encode(self):
         if self.expr == regs08_expr[1]:
             self.value = 1
-        elif isinstance(self.expr, ExprInt) and int(self.expr.arg) == 1:
+        elif isinstance(self.expr, ExprInt) and int(self.expr) == 1:
             self.value = 0
         else:
             return False
@@ -2703,7 +2703,7 @@ class bs_cond_imm(bs_cond_scale, m_arg):
         else:
             l = self.parent.v_opmode()
         if isinstance(self.expr, ExprInt):
-            v = int(self.expr.arg)
+            v = int(self.expr)
             mask = ((1 << l) - 1)
             self.expr = ExprInt(v & mask, l)
 
@@ -2733,7 +2733,7 @@ class bs_cond_imm(bs_cond_scale, m_arg):
         self.parent.rex_w.value = 0
         # special case for push
         if len(self.parent.args) == 1:
-            v = int(self.expr.arg)
+            v = int(self.expr)
             l = self.parent.v_opmode()
             l = min(l, self.max_size)
 
@@ -2750,7 +2750,7 @@ class bs_cond_imm(bs_cond_scale, m_arg):
             self.parent.rex_w.value = 1
 
         l = self.parent.v_opmode()
-        v = int(self.expr.arg)
+        v = int(self.expr)
         if arg0_expr.size == 8:
             if not hasattr(self.parent, 'w8'):
                 raise StopIteration
@@ -2826,7 +2826,7 @@ class bs_rel_off(bs_cond_imm):
         self.expr = expr
         l = self.parent.mode
         if isinstance(self.expr, ExprInt):
-            v = int(self.expr.arg)
+            v = int(self.expr)
             mask = ((1 << l) - 1)
             self.expr = ExprInt(v & mask, l)
         return start, stop
@@ -2889,7 +2889,7 @@ class bs_s08(bs_rel_off):
             l = self.parent.v_opmode()
             self.l = l
         l = offsize(self.parent)
-        v = int(self.expr.arg)
+        v = int(self.expr)
         mask = ((1 << self.l) - 1)
         if self.l > l:
             raise StopIteration
@@ -2936,7 +2936,7 @@ class bs_moff(bsi):
             self.l = 16
         else:
             self.l = 32
-        v = int(m.args[1].arg)
+        v = int(m.args[1])
         mask = ((1 << self.l) - 1)
         if v != sign_ext(v & mask, self.l, l):
             raise StopIteration
@@ -2995,7 +2995,7 @@ class bs_movoff(m_arg):
         if not isinstance(self.expr, ExprMem) or not isinstance(self.expr.arg, ExprInt):
             raise StopIteration
         self.l = p.v_admode()
-        v = int(self.expr.arg.arg)
+        v = int(self.expr.arg)
         mask = ((1 << self.l) - 1)
         if v != mask & v:
             raise StopIteration
@@ -3051,7 +3051,7 @@ class bs_msegoff(m_arg):
         if not isinstance(self.expr.args[1], ExprInt):
             raise StopIteration
         l = self.parent.v_opmode()
-        v = int(self.expr.args[0].arg)
+        v = int(self.expr.args[0])
         mask = ((1 << self.l) - 1)
         if v != sign_ext(v & mask, self.l, l):
             raise StopIteration