about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2016-04-26 13:24:22 +0200
committerCamille Mougey <commial@gmail.com>2016-04-26 13:24:22 +0200
commit62dafd021ec985fa9d8564a916c43c6e79c8631f (patch)
treeefd4dbf82a27102c86aa657ce1a1eecf7630380e
parent2c02857fa8f1dae2a5ecccbe399640b2ae0d446c (diff)
parente5557e2d8a9195998dee5c9a529321fe26615ec7 (diff)
downloadmiasm-62dafd021ec985fa9d8564a916c43c6e79c8631f.tar.gz
miasm-62dafd021ec985fa9d8564a916c43c6e79c8631f.zip
Merge pull request #359 from serpilliere/fix_x86_lodsq
x86/sem: Fix lodsq
-rw-r--r--miasm2/arch/x86/sem.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py
index f66570a7..e843cd2b 100644
--- a/miasm2/arch/x86/sem.py
+++ b/miasm2/arch/x86/sem.py
@@ -1664,7 +1664,10 @@ def lods(ir, instr, size):
     e1 = irbloc(lbl_df_1.name, [e1])
 
     e = []
-    e.append(m2_expr.ExprAff(b, m2_expr.ExprMem(addr, size)))
+    if instr.mode == 64 and b.size == 32:
+        e.append(m2_expr.ExprAff(mRAX[instr.mode], m2_expr.ExprMem(addr, size).zeroExtend(64)))
+    else:
+        e.append(m2_expr.ExprAff(b, m2_expr.ExprMem(addr, size)))
 
     e.append(m2_expr.ExprAff(ir.IRDst,
                              m2_expr.ExprCond(df, lbl_df_1, lbl_df_0)))