From 7a4f30ca4eaba66b094d295ca47bf1b4e37a67c9 Mon Sep 17 00:00:00 2001 From: serpilliere Date: Mon, 26 Mar 2012 15:13:47 +0200 Subject: ia32_arch: add setalc mnmo --- example/disas_and_graph.py | 2 ++ miasm/arch/ia32_arch.py | 2 ++ miasm/arch/ia32_sem.py | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/example/disas_and_graph.py b/example/disas_and_graph.py index 03519a70..71f943ec 100755 --- a/example/disas_and_graph.py +++ b/example/disas_and_graph.py @@ -9,6 +9,7 @@ from miasm.core import parse_asm from elfesteem import pe from miasm.arch import ia32_arch from miasm.arch import arm_arch +from miasm.arch import ppc_arch from optparse import OptionParser try: @@ -133,6 +134,7 @@ if options.machine: machine_dct = {"ia32":ia32_arch.x86_mn, "arm":arm_arch.arm_mn, "java":java_mn, + "ppc":ppc_arch.ppc_mn, } if not options.machine in machine_dct: raise ValueError('unknown machine', options.machine) diff --git a/miasm/arch/ia32_arch.py b/miasm/arch/ia32_arch.py index 9eb8ba0e..2d20d2d5 100644 --- a/miasm/arch/ia32_arch.py +++ b/miasm/arch/ia32_arch.py @@ -1011,6 +1011,8 @@ class x86allmncs: addop("set", [0x0F, 0x90], cond , [rmr] , {} ,{w8:True} , {}, ) + addop("setalc",[0xd6], noafs, no_rm , {} ,{} , {}, ) + addop("qfence",[0x0F, 0xAE], d7 , no_rm , {} ,{} , {}, ) addop("sgdt", [0x0F, 0x01], d0 , no_rm , {} ,{} , {}, ) diff --git a/miasm/arch/ia32_sem.py b/miasm/arch/ia32_sem.py index 16d31dc9..2299f02b 100644 --- a/miasm/arch/ia32_sem.py +++ b/miasm/arch/ia32_sem.py @@ -1012,6 +1012,12 @@ def seto(info, a): e.append(ExprAff(a, ExprCond(ExprOp('==', of, ExprInt(uint32(1))), ExprInt(tab_uintsize[a.get_size()](1)), ExprInt(tab_uintsize[a.get_size()](0))))) return e +def setalc(info): + a = eax[0:8] + e = [] + e.append(ExprAff(a, ExprCond(ExprOp('==', cf, ExprInt(uint32(1))), ExprInt(tab_uintsize[a.get_size()](0xff)), ExprInt(tab_uintsize[a.get_size()](0))))) + return e + def bswap(info, a): e = [] @@ -2072,6 +2078,7 @@ mnemo_func = {'mov': mov, 'setns':setns, 'sets':sets, 'seto':seto, + 'setalc':setalc, 'bswap':bswap, 'cmpsb':cmps, 'cmpsw':cmps, -- cgit 1.4.1