diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2016-09-07 21:56:08 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2016-09-07 21:56:08 +0200 |
| commit | 1c8f058dd74b04bb407962780b3e78cd120bfdd1 (patch) | |
| tree | 0ba5c8ea598a18aa0e2019803e202a2d6a99da25 | |
| parent | 292a5d639cdb64b0b2eb1d855cf93dc4d3c4d1d9 (diff) | |
| download | miasm-1c8f058dd74b04bb407962780b3e78cd120bfdd1.tar.gz miasm-1c8f058dd74b04bb407962780b3e78cd120bfdd1.zip | |
Arch/x86: fix sldt
| -rw-r--r-- | miasm2/arch/x86/arch.py | 2 | ||||
| -rw-r--r-- | miasm2/arch/x86/sem.py | 4 | ||||
| -rw-r--r-- | test/arch/x86/arch.py | 6 |
3 files changed, 8 insertions, 4 deletions
diff --git a/miasm2/arch/x86/arch.py b/miasm2/arch/x86/arch.py index ff7dc1ee..28cac255 100644 --- a/miasm2/arch/x86/arch.py +++ b/miasm2/arch/x86/arch.py @@ -3879,7 +3879,7 @@ addop("shrd", [bs8(0x0f), bs8(0xac)] + addop("shrd", [bs8(0x0f), bs8(0xad)] + rmmod(rmreg) + [d_cl], [rm_arg, rmreg, d_cl]) addop("sidt", [bs8(0x0f), bs8(0x01)] + rmmod(d1, modrm=mod_mem)) -addop("sldt", [bs8(0x0f), bs8(0x00)] + rmmod(d0, modrm=mod_mem)) +addop("sldt", [bs8(0x0f), bs8(0x00)] + rmmod(d0, rm_arg_x=rm_arg_reg_m16)) addop("smsw", [bs8(0x0f), bs8(0x01)] + rmmod(d4)) addop("stc", [bs8(0xf9)]) addop("std", [bs8(0xfd)]) diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index 565e63c5..17965fdc 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -2778,8 +2778,8 @@ def sidt(ir, instr, a): def sldt(ir, instr, a): - # XXX TOOD - e = [m2_expr.ExprAff(exception_flags, m2_expr.ExprInt32(EXCEPT_PRIV_INSN))] + print "DEFAULT SLDT ADDRESS %s!!" % str(a) + e = [m2_expr.ExprAff(a, m2_expr.ExprInt(0, a.size))] return e, [] diff --git a/test/arch/x86/arch.py b/test/arch/x86/arch.py index 80a8563d..e6797da2 100644 --- a/test/arch/x86/arch.py +++ b/test/arch/x86/arch.py @@ -2128,8 +2128,12 @@ reg_tests = [ (m32, "00000000 SIDT DWORD PTR [EAX]", "0f0108"), - (m32, "00000000 SLDT DWORD PTR [EAX]", + (m32, "00000000 SLDT WORD PTR [EAX]", "0f0000"), + (m32, "00000000 SLDT EAX", + "0f00C0"), + (m32, "00000000 SLDT AX", + "660f00C0"), (m32, "00000000 LGDT DWORD PTR [EAX]", |