diff options
Diffstat (limited to 'miasm2/ir')
| -rw-r--r-- | miasm2/ir/analysis.py | 9 | ||||
| -rw-r--r-- | miasm2/ir/ir.py | 19 |
2 files changed, 24 insertions, 4 deletions
diff --git a/miasm2/ir/analysis.py b/miasm2/ir/analysis.py index 11e6eebd..2108cc53 100644 --- a/miasm2/ir/analysis.py +++ b/miasm2/ir/analysis.py @@ -3,7 +3,7 @@ import logging from miasm2.ir.symbexec import SymbolicExecutionEngine -from miasm2.ir.ir import ir, AssignBlock +from miasm2.ir.ir import IntermediateRepresentation, AssignBlock from miasm2.expression.expression \ import ExprAff, ExprCond, ExprId, ExprInt, ExprMem, ExprOp @@ -14,14 +14,17 @@ log.addHandler(console_handler) log.setLevel(logging.WARNING) -class ira(ir): +class ira(IntermediateRepresentation): """IR Analysis This class provides higher level manipulations on IR, such as dead instruction removals. - This class can be used as a common parent with `miasm2.ir.ir::ir` class. + This class can be used as a common parent with + `miasm2.ir.ir::IntermediateRepresentation` class. + For instance: class ira_x86_16(ir_x86_16, ira) + """ def ira_regs_ids(self): diff --git a/miasm2/ir/ir.py b/miasm2/ir/ir.py index b06a8136..b993c356 100644 --- a/miasm2/ir/ir.py +++ b/miasm2/ir/ir.py @@ -320,7 +320,12 @@ class DiGraphIR(DiGraph): return super(DiGraphIR, self).dot() -class ir(object): +class IntermediateRepresentation(object): + """ + Intermediate representation object + + Allow native assembly to intermediate representation traduction + """ def __init__(self, arch, attrib, symbol_pool=None): if symbol_pool is None: @@ -602,3 +607,15 @@ class ir(object): if self._graph is None: self._gen_graph() return self._graph + + + +class ir(IntermediateRepresentation): + """ + DEPRECATED object + Use IntermediateRepresentation instead of ir + """ + + def __init__(self, label, irs, lines=None): + warnings.warn('DEPRECATION WARNING: use "IntermediateRepresentation" instead of "ir"') + super(ir, self).__init__(label, irs, lines) |