diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2017-01-29 15:39:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-29 15:39:12 +0100 |
| commit | f29701d3965d2e307fb085dff0593b150001682d (patch) | |
| tree | 3924b6b59d624747a4817b62efb6ed6fa6d376fe /miasm2/ir/analysis.py | |
| parent | f0ceb21611c5ca5f218b21bcc2de5108bf0f9c35 (diff) | |
| parent | 69baa6b83d9a2404ea33f3d16e2b25cfb3ef7caf (diff) | |
| download | miasm-f29701d3965d2e307fb085dff0593b150001682d.tar.gz miasm-f29701d3965d2e307fb085dff0593b150001682d.zip | |
Merge pull request #478 from commial/refactor/pre_add_instr
Let x86 'pre_add_instr' be the default behavior
Diffstat (limited to 'miasm2/ir/analysis.py')
| -rw-r--r-- | miasm2/ir/analysis.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/miasm2/ir/analysis.py b/miasm2/ir/analysis.py index 0913019b..73391bb2 100644 --- a/miasm2/ir/analysis.py +++ b/miasm2/ir/analysis.py @@ -44,6 +44,17 @@ class ira(ir): 'call_func_stack', ad, self.sp)), ])] + def pre_add_instr(self, block, instr, irb_cur, ir_blocks_all, gen_pc_update): + """Replace function call with corresponding call effects, + inside the IR block""" + if not instr.is_subcall(): + return irb_cur + call_effects = self.call_effects(instr.args[0], instr) + for assignblk in call_effects: + irb_cur.irs.append(assignblk) + irb_cur.lines.append(instr) + return None + def remove_dead_instr(self, irb, useful): """Remove dead affectations using previous reaches analysis @irb: irbloc instance |