about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2020-04-29 10:00:27 +0200
committerGitHub <noreply@github.com>2020-04-29 10:00:27 +0200
commit2adf7557872f7d50f1cc5a4b6214c1c4f1e98734 (patch)
tree78a3d87b8dbf1445717d54679070fec04a52b105
parenta9c0b506f0116342972996689dd5a043bddc2ade (diff)
parentd4b1aea9d54dfeb5d410d917d429eeb16349ffcf (diff)
downloadmiasm-2adf7557872f7d50f1cc5a4b6214c1c4f1e98734.tar.gz
miasm-2adf7557872f7d50f1cc5a4b6214c1c4f1e98734.zip
Merge pull request #1204 from IridiumXOR/mips_buf_ins
Fix bug 'ins' MIPS opcode and PPC "byte_swap()"
Diffstat (limited to '')
-rw-r--r--miasm/arch/mips32/sem.py8
-rw-r--r--miasm/arch/ppc/sem.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/miasm/arch/mips32/sem.py b/miasm/arch/mips32/sem.py
index 5fc491a7..35fc5315 100644
--- a/miasm/arch/mips32/sem.py
+++ b/miasm/arch/mips32/sem.py
@@ -327,12 +327,12 @@ def ins(ir, instr, a, b, c, d):
 
     my_slices = []
     if pos != 0:
-        my_slices.append((a[:pos], 0, pos))
+        my_slices.append(a[:pos])
     if l != 0:
-        my_slices.append((b[:l], pos, pos+l))
+        my_slices.append(b[:l])
     if pos + l != 32:
-        my_slices.append((a[pos+l:], pos+l, 32))
-    r = m2_expr.ExprCompose(my_slices)
+        my_slices.append(a[pos+l:])
+    r = m2_expr.ExprCompose(*my_slices)
     e.append(m2_expr.ExprAssign(a, r))
     return e, []
 
diff --git a/miasm/arch/ppc/sem.py b/miasm/arch/ppc/sem.py
index 0157fce1..b2ca54b7 100644
--- a/miasm/arch/ppc/sem.py
+++ b/miasm/arch/ppc/sem.py
@@ -248,8 +248,8 @@ def mn_do_exts(ir, instr, ra, rs):
 
 def byte_swap(expr):
     nbytes = expr.size // 8
-    bytes = [ expr[i*8:i*8+8] for i in range(nbytes - 1, -1, -1) ]
-    return ExprCompose(bytes)
+    lbytes = [ expr[i*8:i*8+8] for i in range(nbytes - 1, -1, -1) ]
+    return ExprCompose(*lbytes)
 
 def mn_do_load(ir, instr, arg1, arg2, arg3=None):
     assert instr.name[0] == 'L'