about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2018-01-26 17:36:53 +0100
committerAjax <commial@gmail.com>2018-01-26 17:47:05 +0100
commit185d42afb5a3a596bba05dd0ca79c9c45afc757f (patch)
treea0330e59035f55743adb3cee396de29a8e7e80cb
parent8499e3cd1389426de6acbdac5783046554a9ca50 (diff)
downloadmiasm-185d42afb5a3a596bba05dd0ca79c9c45afc757f.tar.gz
miasm-185d42afb5a3a596bba05dd0ca79c9c45afc757f.zip
Add support for BNDMOV instruction (with an empty semantic)
Diffstat (limited to '')
-rw-r--r--miasm2/arch/x86/arch.py11
-rw-r--r--miasm2/arch/x86/sem.py4
-rw-r--r--test/arch/x86/arch.py5
3 files changed, 20 insertions, 0 deletions
diff --git a/miasm2/arch/x86/arch.py b/miasm2/arch/x86/arch.py
index 4d9d00c2..e86665f7 100644
--- a/miasm2/arch/x86/arch.py
+++ b/miasm2/arch/x86/arch.py
@@ -3414,6 +3414,17 @@ addop("and", [bs("100000"), se, w8] + rmmod(d4, rm_arg_w8) + [d_imm])
 addop("and", [bs("001000"), swapargs, w8] +
       rmmod(rmreg, rm_arg_w8), [rm_arg_w8, rmreg])
 
+addop("bndmov", [bs8(0x0f), bs8(0x1a), pref_66, bs_modeno64] +
+      rmmod(bnd_reg, rm_arg_bnd_m64), [bnd_reg, rm_arg_bnd_m64])
+addop("bndmov", [bs8(0x0f), bs8(0x1a), pref_66, bs_mode64] +
+      rmmod(bnd_reg, rm_arg_bnd_m128), [bnd_reg, rm_arg_bnd_m128])
+addop("bndmov", [bs8(0x0f), bs8(0x1b), pref_66, bs_modeno64] +
+      rmmod(bnd_reg, rm_arg_bnd_m64), [rm_arg_bnd_m64, bnd_reg])
+addop("bndmov", [bs8(0x0f), bs8(0x1b), pref_66, bs_mode64] +
+      rmmod(bnd_reg, rm_arg_bnd_m128), [rm_arg_bnd_m128, bnd_reg])
+
+
+
 addop("bsf", [bs8(0x0f), bs8(0xbc)] + rmmod(rmreg))
 addop("bsr", [bs8(0x0f), bs8(0xbd), mod,
     rmreg, rm, sib_scale, sib_index, sib_base, disp, rm_arg])
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py
index f2b75d03..6f2c7947 100644
--- a/miasm2/arch/x86/sem.py
+++ b/miasm2/arch/x86/sem.py
@@ -4129,6 +4129,9 @@ def smsw(ir, instr, dst):
     return e, []
 
 
+def bndmov(ir, instr, dst, src):
+    # Implemented as a NOP, because BND side effects are not yet supported
+    return [], []
 
 mnemo_func = {'mov': mov,
               'xchg': xchg,
@@ -4486,6 +4489,7 @@ mnemo_func = {'mov': mov,
 
 
 
+              "bndmov": bndmov,
 
 
 
diff --git a/test/arch/x86/arch.py b/test/arch/x86/arch.py
index 972a2e12..4d5d5a1c 100644
--- a/test/arch/x86/arch.py
+++ b/test/arch/x86/arch.py
@@ -2959,6 +2959,11 @@ reg_tests = [
     (m32, "00000000    AESDECLAST XMM1, XMM2",
      "660f38dfca"),
 
+    (m64, "00000000    BNDMOV     XMMWORD PTR [RSP + 0x80], BND0",
+     "660f1b842480000000"),
+    (m64, "00000000    BNDMOV     BND3, XMMWORD PTR [RSP + 0xB0]",
+     "660f1a9c24b0000000"),
+
 ]