diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-12-23 18:19:03 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-12-23 19:54:31 +0100 |
| commit | f39a91b146c4a2eb8424f4ad8dec53b96a2a56ab (patch) | |
| tree | b6690e4c93a682aca03405077db4d7aee26ef9ce /miasm2/arch/x86/sem.py | |
| parent | 7e29868e5c637c0608ba257ac6a524ceb3e19e96 (diff) | |
| download | miasm-f39a91b146c4a2eb8424f4ad8dec53b96a2a56ab.tar.gz miasm-f39a91b146c4a2eb8424f4ad8dec53b96a2a56ab.zip | |
X86: add pushfb
Diffstat (limited to 'miasm2/arch/x86/sem.py')
| -rw-r--r-- | miasm2/arch/x86/sem.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index 802b6283..62b6b6b3 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -3422,6 +3422,25 @@ def ucomiss(ir, instr, a, b): return e, [] + +def pshufb(ir, instr, a, b): + e = [] + if a.size == 64: + bit_l = 3 + elif a.size == 128: + bit_l = 4 + else: + raise NotImplementedError("bad size") + for i in xrange(0, b.size, 8): + index = b[i:i+bit_l].zeroExtend(a.size) << m2_expr.ExprInt(3, a.size) + value = (a >> index)[:8] + e.append(m2_expr.ExprAff(a[i:i+8], + m2_expr.ExprCond(b[i+7:i+8], + m2_expr.ExprInt8(0), + value))) + return e, [] + + def iret(ir, instr): """IRET implementation XXX: only support "no-privilege change" @@ -3846,7 +3865,7 @@ mnemo_func = {'mov': mov, "rdmsr": rdmsr, "wrmsr": wrmsr, - + "pshufb" : pshufb, } |