diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-03-02 10:31:20 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-03-04 02:44:17 +0100 |
| commit | 21604c8e0541ea03a38f15831eafaf5793396887 (patch) | |
| tree | 6dbc82cae269b2fe33742f809b12b73fa18df8d9 | |
| parent | a3013003b9f77b017036bd1d46797052d875efbe (diff) | |
| download | miasm-21604c8e0541ea03a38f15831eafaf5793396887.tar.gz miasm-21604c8e0541ea03a38f15831eafaf5793396887.zip | |
PPC32: integration
| -rw-r--r-- | example/ida/utils.py | 2 | ||||
| -rw-r--r-- | miasm2/arch/ppc/ira.py | 13 | ||||
| -rw-r--r-- | miasm2/jitter/jitcore_llvm.py | 1 | ||||
| -rw-r--r-- | miasm2/jitter/loader/elf.py | 1 |
4 files changed, 17 insertions, 0 deletions
diff --git a/example/ida/utils.py b/example/ida/utils.py index b147cde2..585d86a9 100644 --- a/example/ida/utils.py +++ b/example/ida/utils.py @@ -57,6 +57,8 @@ def guess_machine(): machine = Machine("mips32l") elif processor_name == "mipsb": machine = Machine("mips32b") + elif processor_name == "PPC": + machine = Machine("ppc32b") else: print repr(processor_name) raise NotImplementedError('not fully functional') diff --git a/miasm2/arch/ppc/ira.py b/miasm2/arch/ppc/ira.py index 2459c0e4..76a979ae 100644 --- a/miasm2/arch/ppc/ira.py +++ b/miasm2/arch/ppc/ira.py @@ -22,6 +22,19 @@ class ir_a_ppc32b(ir_ppc32b, ira): for irblock in leaves: self.set_dead_regs(irblock) + def call_effects(self, ad, instr): + return [AssignBlock([ExprAff(self.ret_reg, ExprOp('call_func_ret', ad, + self.sp, + self.arch.regs.R3, + self.arch.regs.R4, + self.arch.regs.R5, + )), + ExprAff(self.sp, ExprOp('call_func_stack', + ad, self.sp)), + ], + instr + )] + def pre_add_instr(self, block, instr, assignments, ir_blocks_all, gen_pc_update): """Replace function call with corresponding call effects, inside the IR block""" diff --git a/miasm2/jitter/jitcore_llvm.py b/miasm2/jitter/jitcore_llvm.py index 53f1b37f..452b6d84 100644 --- a/miasm2/jitter/jitcore_llvm.py +++ b/miasm2/jitter/jitcore_llvm.py @@ -17,6 +17,7 @@ class JitCore_LLVM(jitcore.JitCore): "msp430": "JitCore_msp430.so", "mips32": "JitCore_mips32.so", "aarch64": "JitCore_aarch64.so", + "ppc32": "JitCore_ppc32.so", } def __init__(self, ir_arch, bs=None): diff --git a/miasm2/jitter/loader/elf.py b/miasm2/jitter/loader/elf.py index 336f522a..deaebd09 100644 --- a/miasm2/jitter/loader/elf.py +++ b/miasm2/jitter/loader/elf.py @@ -100,6 +100,7 @@ ELF_machine = {(elf_csts.EM_ARM, 32, elf_csts.ELFDATA2LSB): "arml", (elf_csts.EM_386, 32, elf_csts.ELFDATA2LSB): "x86_32", (elf_csts.EM_X86_64, 64, elf_csts.ELFDATA2LSB): "x86_64", (elf_csts.EM_SH, 32, elf_csts.ELFDATA2LSB): "sh4", + (elf_csts.EM_PPC, 32, elf_csts.ELFDATA2MSB): "ppc32b", } |