about summary refs log tree commit diff stats
path: root/miasm2
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2016-04-25 15:25:36 +0200
committerCamille Mougey <commial@gmail.com>2016-04-25 15:25:36 +0200
commit1d2b008cfd6f8ea92c5af3e18081d8c56e43820e (patch)
tree97abff982dbc36116a0adec12eb22b78d78b71b5 /miasm2
parentb127dbdfe5832a12f7f328dc560344a9900e8918 (diff)
parent09b8308dddcd52aec8e899674d124122ce8555f5 (diff)
downloadmiasm-1d2b008cfd6f8ea92c5af3e18081d8c56e43820e.tar.gz
miasm-1d2b008cfd6f8ea92c5af3e18081d8c56e43820e.zip
Merge pull request #356 from serpilliere/x86_fix_64_modrm
X86/arch: fix call @imm
Diffstat (limited to '')
-rw-r--r--miasm2/arch/x86/arch.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/miasm2/arch/x86/arch.py b/miasm2/arch/x86/arch.py
index 724f6b86..b5c72d32 100644
--- a/miasm2/arch/x86/arch.py
+++ b/miasm2/arch/x86/arch.py
@@ -1738,7 +1738,9 @@ def parse_mem(expr, parent, w8, sx=0, xmm=0, mm=0):
         else:
             return None, None, False
 
-    if (parent.mode == 64 and ptr.size == 32 and
+    if (not isinstance(ptr, ExprInt) and
+        parent.mode == 64 and
+        ptr.size == 32 and
         parent.admode != 1):
         return None, None, False
     dct_expr = {f_isad: True}
@@ -1980,6 +1982,7 @@ class x86_rm_arg(m_arg):
             v = v.items()
             v.sort()
             v = tuple(v)
+            admode = 64 if p.mode == 64 else admode
             if not v in modrm2byte[admode]:
                 continue
             xx = modrm2byte[admode][v]