about summary refs log tree commit diff stats
path: root/miasm2/arch
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/arch')
-rw-r--r--miasm2/arch/ppc/ira.py13
-rw-r--r--miasm2/arch/ppc/sem.py1
2 files changed, 14 insertions, 0 deletions
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/arch/ppc/sem.py b/miasm2/arch/ppc/sem.py
index 3c9d0e83..4434efa7 100644
--- a/miasm2/arch/ppc/sem.py
+++ b/miasm2/arch/ppc/sem.py
@@ -845,6 +845,7 @@ class ir_ppc32b(IntermediateRepresentation):
         self.pc = mn_ppc.getpc()
         self.sp = mn_ppc.getsp()
         self.IRDst = expr.ExprId('IRDst', 32)
+        self.addrsize = 32
 
     def get_ir(self, instr):
         args = instr.args[:]