diff options
| author | Camille Mougey <commial@gmail.com> | 2016-09-08 13:41:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-08 13:41:06 +0200 |
| commit | 66244d2922adab3b9fe85ba3fb3cfd4a2ba98559 (patch) | |
| tree | 392ee115bfb91f39c0d8409b04888234ec49bb7c | |
| parent | 80da9c3c07130f80ad2ecc6f70b80093b601a423 (diff) | |
| parent | 1c8f058dd74b04bb407962780b3e78cd120bfdd1 (diff) | |
| download | miasm-66244d2922adab3b9fe85ba3fb3cfd4a2ba98559.tar.gz miasm-66244d2922adab3b9fe85ba3fb3cfd4a2ba98559.zip | |
Merge pull request #423 from serpilliere/fix_x86_sldt
Arch/x86: fix sldt
Diffstat (limited to '')
| -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]", |