diff options
| -rw-r--r-- | miasm/analysis/cst_propag.py | 4 | ||||
| -rw-r--r-- | miasm/analysis/data_flow.py | 2 | ||||
| -rw-r--r-- | miasm/analysis/depgraph.py | 2 | ||||
| -rw-r--r-- | miasm/arch/aarch64/sem.py | 8 | ||||
| -rw-r--r-- | miasm/arch/arm/sem.py | 12 | ||||
| -rw-r--r-- | miasm/arch/mep/sem.py | 8 | ||||
| -rw-r--r-- | miasm/arch/mips32/sem.py | 8 | ||||
| -rw-r--r-- | miasm/arch/msp430/sem.py | 6 | ||||
| -rw-r--r-- | miasm/arch/ppc/sem.py | 4 | ||||
| -rw-r--r-- | miasm/arch/x86/sem.py | 10 | ||||
| -rw-r--r-- | miasm/ir/analysis.py | 6 | ||||
| -rw-r--r-- | miasm/ir/ir.py | 10 |
12 files changed, 40 insertions, 40 deletions
diff --git a/miasm/analysis/cst_propag.py b/miasm/analysis/cst_propag.py index ba9b3aee..dd7733b0 100644 --- a/miasm/analysis/cst_propag.py +++ b/miasm/analysis/cst_propag.py @@ -122,7 +122,7 @@ def compute_cst_propagation_states(ir_arch, ircfg, init_addr, init_infos): The attribute "constant expression" is true if the expression is based on constants or "init" regs values. - @ir_arch: IntermediateRepresentation instance + @ir_arch: Lifter instance @init_addr: analysis start address @init_infos: dictionary linking expressions to their values at @init_addr """ @@ -169,7 +169,7 @@ def propagate_cst_expr(ir_arch, ircfg, addr, init_infos): The attribute "constant expression" is true if the expression is based on constants or "init" regs values. - @ir_arch: IntermediateRepresentation instance + @ir_arch: Lifter instance @addr: analysis start address @init_infos: dictionary linking expressions to their values at @init_addr diff --git a/miasm/analysis/data_flow.py b/miasm/analysis/data_flow.py index 4f369965..c68e9e65 100644 --- a/miasm/analysis/data_flow.py +++ b/miasm/analysis/data_flow.py @@ -370,7 +370,7 @@ class DeadRemoval(object): Source : Kennedy, K. (1979). A survey of data flow analysis techniques. IBM Thomas J. Watson Research Division, page 43 - @ircfg: IntermediateRepresentation instance + @ircfg: Lifter instance """ modified = False diff --git a/miasm/analysis/depgraph.py b/miasm/analysis/depgraph.py index ae853756..8b5c87e2 100644 --- a/miasm/analysis/depgraph.py +++ b/miasm/analysis/depgraph.py @@ -285,7 +285,7 @@ class DependencyResult(DependencyState): def emul(self, ir_arch, ctx=None, step=False): """Symbolic execution of relevant nodes according to the history Return the values of inputs nodes' elements - @ir_arch: IntermediateRepresentation instance + @ir_arch: Lifter instance @ctx: (optional) Initial context as dictionary @step: (optional) Verbose execution Warning: The emulation is not sound if the inputs nodes depend on loop diff --git a/miasm/arch/aarch64/sem.py b/miasm/arch/aarch64/sem.py index 6629cf0d..7f7c861d 100644 --- a/miasm/arch/aarch64/sem.py +++ b/miasm/arch/aarch64/sem.py @@ -3,7 +3,7 @@ from future.utils import viewitems from miasm.expression.expression import ExprId, ExprInt, ExprLoc, ExprMem, \ ExprCond, ExprCompose, ExprOp, ExprAssign -from miasm.ir.ir import IntermediateRepresentation, IRBlock, AssignBlock +from miasm.ir.ir import Lifter, IRBlock, AssignBlock from miasm.arch.aarch64.arch import mn_aarch64, conds_expr, replace_regs from miasm.arch.aarch64.regs import * from miasm.core.sembuilder import SemBuilder @@ -2285,10 +2285,10 @@ class aarch64info(object): # offset -class ir_aarch64l(IntermediateRepresentation): +class ir_aarch64l(Lifter): def __init__(self, loc_db): - IntermediateRepresentation.__init__(self, mn_aarch64, "l", loc_db) + Lifter.__init__(self, mn_aarch64, "l", loc_db) self.pc = PC self.sp = SP self.IRDst = ExprId('IRDst', 64) @@ -2374,7 +2374,7 @@ class ir_aarch64l(IntermediateRepresentation): class ir_aarch64b(ir_aarch64l): def __init__(self, loc_db): - IntermediateRepresentation.__init__(self, mn_aarch64, "b", loc_db) + Lifter.__init__(self, mn_aarch64, "b", loc_db) self.pc = PC self.sp = SP self.IRDst = ExprId('IRDst', 64) diff --git a/miasm/arch/arm/sem.py b/miasm/arch/arm/sem.py index fd82df23..b36d151a 100644 --- a/miasm/arch/arm/sem.py +++ b/miasm/arch/arm/sem.py @@ -2,7 +2,7 @@ from builtins import range from future.utils import viewitems, viewvalues from miasm.expression.expression import * -from miasm.ir.ir import IntermediateRepresentation, IRBlock, AssignBlock +from miasm.ir.ir import Lifter, IRBlock, AssignBlock from miasm.arch.arm.arch import mn_arm, mn_armt from miasm.arch.arm.regs import * @@ -1932,9 +1932,9 @@ class arminfo(object): # offset -class ir_arml(IntermediateRepresentation): +class ir_arml(Lifter): def __init__(self, loc_db): - IntermediateRepresentation.__init__(self, mn_arm, "l", loc_db) + Lifter.__init__(self, mn_arm, "l", loc_db) self.pc = PC self.sp = SP self.IRDst = ExprId('IRDst', 32) @@ -2131,7 +2131,7 @@ class ir_arml(IntermediateRepresentation): class ir_armb(ir_arml): def __init__(self, loc_db): - IntermediateRepresentation.__init__(self, mn_arm, "b", loc_db) + Lifter.__init__(self, mn_arm, "b", loc_db) self.pc = PC self.sp = SP self.IRDst = ExprId('IRDst', 32) @@ -2140,7 +2140,7 @@ class ir_armb(ir_arml): class ir_armtl(ir_arml): def __init__(self, loc_db): - IntermediateRepresentation.__init__(self, mn_armt, "l", loc_db) + Lifter.__init__(self, mn_armt, "l", loc_db) self.pc = PC self.sp = SP self.IRDst = ExprId('IRDst', 32) @@ -2166,7 +2166,7 @@ class ir_armtl(ir_arml): class ir_armtb(ir_armtl): def __init__(self, loc_db): - IntermediateRepresentation.__init__(self, mn_armt, "b", loc_db) + Lifter.__init__(self, mn_armt, "b", loc_db) self.pc = PC self.sp = SP self.IRDst = ExprId('IRDst', 32) diff --git a/miasm/arch/mep/sem.py b/miasm/arch/mep/sem.py index 221d18f8..62ca3c77 100644 --- a/miasm/arch/mep/sem.py +++ b/miasm/arch/mep/sem.py @@ -2,7 +2,7 @@ # Guillaume Valadon <guillaume@valadon.net> from miasm.core.sembuilder import SemBuilder -from miasm.ir.ir import IntermediateRepresentation +from miasm.ir.ir import Lifter from miasm.arch.mep.arch import mn_mep from miasm.arch.mep.regs import PC, SP, LP, SAR, TP, RPB, RPE, RPC, EPC, NPC, \ take_jmp, in_erepeat @@ -1199,7 +1199,7 @@ def get_mnemo_expr(ir, instr, *args): return ir, extra_ir -class ir_mepb(IntermediateRepresentation): +class ir_mepb(Lifter): """Toshiba MeP miasm IR - Big Endian It transforms an instructon into an IR. @@ -1208,7 +1208,7 @@ class ir_mepb(IntermediateRepresentation): addrsize = 32 def __init__(self, loc_db): - IntermediateRepresentation.__init__(self, mn_mep, "b", loc_db) + Lifter.__init__(self, mn_mep, "b", loc_db) self.pc = mn_mep.getpc() self.sp = mn_mep.getsp() self.IRDst = ExprId("IRDst", 32) @@ -1234,7 +1234,7 @@ class ir_mepl(ir_mepb): """Toshiba MeP miasm IR - Little Endian""" def __init__(self, loc_db): - IntermediateRepresentation.__init__(self, mn_mep, "l", loc_db) + Lifter.__init__(self, mn_mep, "l", loc_db) self.pc = mn_mep.getpc() self.sp = mn_mep.getsp() self.IRDst = ExprId("IRDst", 32) diff --git a/miasm/arch/mips32/sem.py b/miasm/arch/mips32/sem.py index 65af7a38..9445c27d 100644 --- a/miasm/arch/mips32/sem.py +++ b/miasm/arch/mips32/sem.py @@ -1,5 +1,5 @@ import miasm.expression.expression as m2_expr -from miasm.ir.ir import IntermediateRepresentation, IRBlock, AssignBlock +from miasm.ir.ir import Lifter, IRBlock, AssignBlock from miasm.arch.mips32.arch import mn_mips32 from miasm.arch.mips32.regs import R_LO, R_HI, PC, RA, ZERO, exception_flags from miasm.core.sembuilder import SemBuilder @@ -618,10 +618,10 @@ def get_mnemo_expr(ir, instr, *args): instr, extra_ir = mnemo_func[instr.name.lower()](ir, instr, *args) return instr, extra_ir -class ir_mips32l(IntermediateRepresentation): +class ir_mips32l(Lifter): def __init__(self, loc_db): - IntermediateRepresentation.__init__(self, mn_mips32, 'l', loc_db) + Lifter.__init__(self, mn_mips32, 'l', loc_db) self.pc = mn_mips32.getpc() self.sp = mn_mips32.getsp() self.IRDst = m2_expr.ExprId('IRDst', 32) @@ -655,7 +655,7 @@ class ir_mips32l(IntermediateRepresentation): class ir_mips32b(ir_mips32l): def __init__(self, loc_db): self.addrsize = 32 - IntermediateRepresentation.__init__(self, mn_mips32, 'b', loc_db) + Lifter.__init__(self, mn_mips32, 'b', loc_db) self.pc = mn_mips32.getpc() self.sp = mn_mips32.getsp() self.IRDst = m2_expr.ExprId('IRDst', 32) diff --git a/miasm/arch/msp430/sem.py b/miasm/arch/msp430/sem.py index 196e09f1..93d46720 100644 --- a/miasm/arch/msp430/sem.py +++ b/miasm/arch/msp430/sem.py @@ -3,7 +3,7 @@ from miasm.expression.expression import * from miasm.arch.msp430.regs import * from miasm.arch.msp430.arch import mn_msp430 -from miasm.ir.ir import IntermediateRepresentation +from miasm.ir.ir import Lifter # Utils @@ -473,10 +473,10 @@ def ComposeExprAssign(dst, src): return e -class ir_msp430(IntermediateRepresentation): +class ir_msp430(Lifter): def __init__(self, loc_db): - IntermediateRepresentation.__init__(self, mn_msp430, None, loc_db) + Lifter.__init__(self, mn_msp430, None, loc_db) self.pc = PC self.sp = SP self.IRDst = ExprId('IRDst', 16) diff --git a/miasm/arch/ppc/sem.py b/miasm/arch/ppc/sem.py index 6d18777c..8318ed89 100644 --- a/miasm/arch/ppc/sem.py +++ b/miasm/arch/ppc/sem.py @@ -2,7 +2,7 @@ from __future__ import print_function from builtins import range import miasm.expression.expression as expr -from miasm.ir.ir import AssignBlock, IntermediateRepresentation, IRBlock +from miasm.ir.ir import AssignBlock, Lifter, IRBlock from miasm.arch.ppc.arch import mn_ppc from miasm.arch.ppc.regs import * from miasm.core.sembuilder import SemBuilder @@ -897,7 +897,7 @@ sem_dir = { } -class ir_ppc32b(IntermediateRepresentation): +class ir_ppc32b(Lifter): def __init__(self, loc_db): super(ir_ppc32b, self).__init__(mn_ppc, 'b', loc_db) diff --git a/miasm/arch/x86/sem.py b/miasm/arch/x86/sem.py index 45eb5135..b41d5543 100644 --- a/miasm/arch/x86/sem.py +++ b/miasm/arch/x86/sem.py @@ -25,7 +25,7 @@ import miasm.expression.expression as m2_expr from miasm.expression.simplifications import expr_simp from miasm.arch.x86.regs import * from miasm.arch.x86.arch import mn_x86, repeat_mn, replace_regs, is_mem_segm -from miasm.ir.ir import IntermediateRepresentation, IRBlock, AssignBlock +from miasm.ir.ir import Lifter, IRBlock, AssignBlock from miasm.core.sembuilder import SemBuilder from miasm.jitter.csts import EXCEPT_DIV_BY_ZERO, EXCEPT_ILLEGAL_INSN, \ EXCEPT_PRIV_INSN, EXCEPT_SOFT_BP, EXCEPT_INT_XX, EXCEPT_INT_1, \ @@ -5748,10 +5748,10 @@ mnemo_func = {'mov': mov, } -class ir_x86_16(IntermediateRepresentation): +class ir_x86_16(Lifter): def __init__(self, loc_db): - IntermediateRepresentation.__init__(self, mn_x86, 16, loc_db) + Lifter.__init__(self, mn_x86, 16, loc_db) self.do_stk_segm = False self.do_ds_segm = False self.do_str_segm = False @@ -5894,7 +5894,7 @@ class ir_x86_16(IntermediateRepresentation): class ir_x86_32(ir_x86_16): def __init__(self, loc_db): - IntermediateRepresentation.__init__(self, mn_x86, 32, loc_db) + Lifter.__init__(self, mn_x86, 32, loc_db) self.do_stk_segm = False self.do_ds_segm = False self.do_str_segm = False @@ -5908,7 +5908,7 @@ class ir_x86_32(ir_x86_16): class ir_x86_64(ir_x86_16): def __init__(self, loc_db): - IntermediateRepresentation.__init__(self, mn_x86, 64, loc_db) + Lifter.__init__(self, mn_x86, 64, loc_db) self.do_stk_segm = False self.do_ds_segm = False self.do_str_segm = False diff --git a/miasm/ir/analysis.py b/miasm/ir/analysis.py index 9aa61f59..ada4f281 100644 --- a/miasm/ir/analysis.py +++ b/miasm/ir/analysis.py @@ -3,7 +3,7 @@ import warnings import logging -from miasm.ir.ir import IntermediateRepresentation, AssignBlock +from miasm.ir.ir import Lifter, AssignBlock from miasm.expression.expression import ExprOp, ExprAssign @@ -14,13 +14,13 @@ log.addHandler(console_handler) log.setLevel(logging.WARNING) -class ira(IntermediateRepresentation): +class ira(Lifter): """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 - `miasm.ir.ir::IntermediateRepresentation` class. + `miasm.ir.ir::Lifter` class. For instance: class ira_x86_16(ir_x86_16, ira) diff --git a/miasm/ir/ir.py b/miasm/ir/ir.py index aed5cb65..b80d5f8b 100644 --- a/miasm/ir/ir.py +++ b/miasm/ir/ir.py @@ -706,7 +706,7 @@ class DiGraphIR(IRCFG): raise NotImplementedError("Deprecated") -class IntermediateRepresentation(object): +class Lifter(object): """ Intermediate representation object @@ -837,7 +837,7 @@ class IntermediateRepresentation(object): Use add_asmblock_to_ircfg instead of add_block """ warnings.warn("""DEPRECATION WARNING - ircfg is now out of IntermediateRepresentation + ircfg is now out of Lifter Use: ircfg = ir_arch.new_ircfg() ir_arch.add_asmblock_to_ircfg(block, ircfg) @@ -921,12 +921,12 @@ class IntermediateRepresentation(object): return new_irblocks -class ir(IntermediateRepresentation): +class ir(Lifter): """ DEPRECATED object - Use IntermediateRepresentation instead of ir + Use Lifter instead of ir """ def __init__(self, loc_key, irs, lines=None): - warnings.warn('DEPRECATION WARNING: use "IntermediateRepresentation" instead of "ir"') + warnings.warn('DEPRECATION WARNING: use "Lifter" instead of "ir"') super(ir, self).__init__(loc_key, irs, lines) |