about summary refs log tree commit diff stats
path: root/miasm2/ir/analysis.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2017-01-05 15:37:58 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2017-01-06 14:15:15 +0100
commite9494c09013290a382b90e84cd363567d166f687 (patch)
treec6a973dd87be704676d588d5ca0a25b0e0c2535b /miasm2/ir/analysis.py
parentafdeb68de2b634c600c30f61422f9fd59286376c (diff)
downloadmiasm-e9494c09013290a382b90e84cd363567d166f687.tar.gz
miasm-e9494c09013290a382b90e84cd363567d166f687.zip
IR: Call_effects API modification
Old API:
    def call_effects(self, addr):
New API:
    def call_effects(self, addr, instr):

The addr is the address of the called function
'instr' is the instruction responsible for the call.
The new API is a bit more flexible for model a function.
Diffstat (limited to '')
-rw-r--r--miasm2/ir/analysis.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/miasm2/ir/analysis.py b/miasm2/ir/analysis.py
index 70fda11c..c606d958 100644
--- a/miasm2/ir/analysis.py
+++ b/miasm2/ir/analysis.py
@@ -29,11 +29,16 @@ class ira(ir):
         """Returns ids of all registers used in the IR"""
         return self.arch.regs.all_regs_ids + [self.IRDst]
 
-    def call_effects(self, ad):
-        """
-        Default simulation of a function call to @ad
+    def call_effects(self, ad, instr):
+        """Default modelisation of a function call to @ad. This may be used to:
+
+        * insert dependencies to arguments (stack base, registers, ...)
+        * add some side effects (stack clean, return value, ...)
+
         @ad: (Expr) address of the called function
+        @instr: native instruction which is responsible of the call
         """
+
         return [AssignBlock(
             [ExprAff(self.ret_reg, ExprOp('call_func_ret', ad, self.sp)),
              ExprAff(self.sp, ExprOp(