about summary refs log tree commit diff stats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--miasm/arch/ia32_arch.py24
1 files changed, 20 insertions, 4 deletions
diff --git a/miasm/arch/ia32_arch.py b/miasm/arch/ia32_arch.py
index 83c7e612..ee0f7ca6 100644
--- a/miasm/arch/ia32_arch.py
+++ b/miasm/arch/ia32_arch.py
@@ -1784,6 +1784,26 @@ class x86_mn:
         for a in args:
             if x86_afs.segm in a:
                 prefix.append(x86_afs.reg_sg.index(a[x86_afs.segm]))
+
+        # special case ommiting 1 as argument
+        if len(args) == 1 and name in ["sal", "sar", "shl", "shr"]:
+            args.append("1")
+        # special case when the first argument should be omitted
+        if len(args) == 2 and name in ["fcomi", "fcomip", "fucomi", "fucomip"]:
+            args[0:1] = []
+        # special case when the second argument should be omitted
+        if len(args) == 2 and name in ["fdivp"]:
+            args[1:2] = []
+        # special case when the argument should be omitted
+        if len(args) == 1 and name in [
+                "stosb", "lodsb", "scasb",
+                "stosd", "lodsd", "scasd",
+                ]:
+            args[0:2] = []
+        # special case when both arguments should be omitted
+        if len(args) == 2 and name in [ "movsb", "movsd", "cmpsb", "cmpsd", ]:
+            args[0:2] = []
+
         return prefix, name, args
 
     @classmethod
@@ -1799,10 +1819,6 @@ class x86_mn:
         log.debug("name: %s"%name)
         log.debug("args: %s"%str(args))
 
-        # special case ommiting 1 as argument
-        if len(args) == 1 and name in ["sal", "sar", "shl", "shr"]:
-            args.append("1")
-
         args_eval = []
         for a in args:
             args_eval.append(x86_mn.parse_address(a))