diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2020-12-07 18:01:44 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2020-12-24 17:15:46 +0100 |
| commit | 52f22525a577028b0716957bf506e69858472831 (patch) | |
| tree | a7e1521fc4a2643f6a88a3d4473450c56fb7254c | |
| parent | 91b16391658eadd16e88c6bc20c06184e5353734 (diff) | |
| download | miasm-52f22525a577028b0716957bf506e69858472831.tar.gz miasm-52f22525a577028b0716957bf506e69858472831.zip | |
Rename LifterModelCallX86
| -rw-r--r-- | doc/ir/lift.ipynb | 6 | ||||
| -rw-r--r-- | example/expression/asm_to_ir.py | 4 | ||||
| -rw-r--r-- | example/expression/get_read_write.py | 4 | ||||
| -rw-r--r-- | miasm/analysis/disasm_cb.py | 4 | ||||
| -rw-r--r-- | miasm/analysis/machine.py | 12 | ||||
| -rw-r--r-- | miasm/arch/x86/lifter_model_call.py | 6 |
6 files changed, 18 insertions, 18 deletions
diff --git a/doc/ir/lift.ipynb b/doc/ir/lift.ipynb index 08d4dde6..933ed3b4 100644 --- a/doc/ir/lift.ipynb +++ b/doc/ir/lift.ipynb @@ -33,7 +33,7 @@ "from miasm.analysis.machine import Machine\n", "from miasm.arch.x86.arch import mn_x86\n", "from miasm.core import parse_asm, asmblock\n", - "from miasm.arch.x86.ira import ir_a_x86_32\n", + "from miasm.arch.x86.ira import LifterModelCall_x86_32\n", "from miasm.core.locationdb import LocationDB\n", "from miasm.loader.strpatchwork import StrPatchwork\n", "from miasm.analysis.binary import Container\n", @@ -87,7 +87,7 @@ " machine = Machine(\"x86_32\")\n", " # Get a lifter\n", " if ira and ira_custom is None:\n", - " ir_arch = ir_a_x86_32(asmcfg.loc_db)\n", + " ir_arch = LifterModelCall_x86_32(asmcfg.loc_db)\n", " elif ira_custom is not None:\n", " ir_arch = ira_custom(asmcfg.loc_db)\n", " else:\n", @@ -1802,7 +1802,7 @@ ], "source": [ "# Construct a custom ira lifter\n", - "class IRAFixCallStack(ir_a_x86_32):\n", + "class IRAFixCallStack(LifterModelCall_x86_32):\n", " def call_effects(self, addr, instr):\n", " if addr.is_loc():\n", " if self.loc_db.get_location_offset(addr.loc_key) == 0x11223344:\n", diff --git a/example/expression/asm_to_ir.py b/example/expression/asm_to_ir.py index 32d4ae8b..9be7d1b3 100644 --- a/example/expression/asm_to_ir.py +++ b/example/expression/asm_to_ir.py @@ -7,7 +7,7 @@ from miasm.arch.x86.arch import mn_x86 from miasm.core import parse_asm from miasm.expression.expression import * from miasm.core import asmblock -from miasm.arch.x86.lifter_model_call import ir_a_x86_32 +from miasm.arch.x86.lifter_model_call import LifterModelCall_x86_32 from miasm.analysis.data_flow import DeadRemoval from miasm.core.locationdb import LocationDB @@ -43,7 +43,7 @@ print(loc_db) patches = asmblock.asm_resolve_final(mn_x86, asmcfg) # Translate to IR -ir_arch = ir_a_x86_32(loc_db) +ir_arch = LifterModelCall_x86_32(loc_db) ircfg = ir_arch.new_ircfg_from_asmcfg(asmcfg) deadrm = DeadRemoval(ir_arch) diff --git a/example/expression/get_read_write.py b/example/expression/get_read_write.py index d6bb37c2..752c4272 100644 --- a/example/expression/get_read_write.py +++ b/example/expression/get_read_write.py @@ -4,7 +4,7 @@ from future.utils import viewitems from miasm.arch.x86.arch import mn_x86 from miasm.expression.expression import get_rw -from miasm.arch.x86.lifter_model_call import ir_a_x86_32 +from miasm.arch.x86.lifter_model_call import LifterModelCall_x86_32 from miasm.core.locationdb import LocationDB loc_db = LocationDB() @@ -16,7 +16,7 @@ Get read/written registers for a given instruction """) arch = mn_x86 -ir_arch = ir_a_x86_32(loc_db) +ir_arch = LifterModelCall_x86_32(loc_db) ircfg = ir_arch.new_ircfg() instr = arch.fromstring('LODSB', loc_db, 32) instr.offset, instr.l = 0, 15 diff --git a/miasm/analysis/disasm_cb.py b/miasm/analysis/disasm_cb.py index 76fa738b..f9274072 100644 --- a/miasm/analysis/disasm_cb.py +++ b/miasm/analysis/disasm_cb.py @@ -16,9 +16,9 @@ def get_lifter_model_call(arch, attrib): if arch == ("arm", "arm"): from miasm.arch.arm.lifter_model_call import ir_a_arm_base as lifter_model_call elif arch == ("x86", 32): - from miasm.arch.x86.lifter_model_call import ir_a_x86_32 as lifter_model_call + from miasm.arch.x86.lifter_model_call import LifterModelCall_x86_32 as lifter_model_call elif arch == ("x86", 64): - from miasm.arch.x86.lifter_model_call import ir_a_x86_64 as lifter_model_call + from miasm.arch.x86.lifter_model_call import LifterModelCall_x86_64 as lifter_model_call else: raise ValueError('unknown architecture: %s' % arch.name) return lifter_model_call diff --git a/miasm/analysis/machine.py b/miasm/analysis/machine.py index 5038d63b..6591ff54 100644 --- a/miasm/analysis/machine.py +++ b/miasm/analysis/machine.py @@ -102,8 +102,8 @@ class Machine(object): except ImportError: pass mn = arch.mn_x86 - from miasm.arch.x86.lifter_model_call import ir_a_x86_16 as lifter_model_call - from miasm.arch.x86.sem import Lifter_X86_16 as ir + from miasm.arch.x86.lifter_model_call import LifterModelCall_x86_16 as lifter_model_call + from miasm.arch.x86.sem import Lifter_X86_16 as lifter elif machine_name == "x86_32": from miasm.arch.x86.disasm import dis_x86_32 as dis_engine from miasm.arch.x86 import arch @@ -113,8 +113,8 @@ class Machine(object): except ImportError: pass mn = arch.mn_x86 - from miasm.arch.x86.lifter_model_call import ir_a_x86_32 as lifter_model_call - from miasm.arch.x86.sem import Lifter_X86_32 as ir + from miasm.arch.x86.lifter_model_call import LifterModelCall_x86_32 as lifter_model_call + from miasm.arch.x86.sem import Lifter_X86_32 as lifter try: from miasm.analysis.gdbserver import GdbServer_x86_32 as gdbserver except ImportError: @@ -128,8 +128,8 @@ class Machine(object): except ImportError: pass mn = arch.mn_x86 - from miasm.arch.x86.lifter_model_call import ir_a_x86_64 as lifter_model_call - from miasm.arch.x86.sem import Lifter_X86_64 as ir + from miasm.arch.x86.lifter_model_call import LifterModelCall_x86_64 as lifter_model_call + from miasm.arch.x86.sem import Lifter_X86_64 as lifter elif machine_name == "msp430": from miasm.arch.msp430.disasm import dis_msp430 as dis_engine from miasm.arch.msp430 import arch diff --git a/miasm/arch/x86/lifter_model_call.py b/miasm/arch/x86/lifter_model_call.py index ebcc9e2f..e75f8c69 100644 --- a/miasm/arch/x86/lifter_model_call.py +++ b/miasm/arch/x86/lifter_model_call.py @@ -6,7 +6,7 @@ from miasm.ir.analysis import LifterModelCall from miasm.arch.x86.sem import Lifter_X86_16, Lifter_X86_32, Lifter_X86_64 -class ir_a_x86_16(Lifter_X86_16, LifterModelCall): +class LifterModelCall_x86_16(Lifter_X86_16, LifterModelCall): def __init__(self, loc_db): Lifter_X86_16.__init__(self, loc_db) @@ -15,7 +15,7 @@ class ir_a_x86_16(Lifter_X86_16, LifterModelCall): def get_out_regs(self, _): return set([self.ret_reg, self.sp]) -class ir_a_x86_32(Lifter_X86_32, ir_a_x86_16): +class LifterModelCall_x86_32(Lifter_X86_32, LifterModelCall_x86_16): def __init__(self, loc_db): Lifter_X86_32.__init__(self, loc_db) @@ -37,7 +37,7 @@ class ir_a_x86_32(Lifter_X86_32, ir_a_x86_16): return 32 -class ir_a_x86_64(Lifter_X86_64, ir_a_x86_16): +class LifterModelCall_x86_64(Lifter_X86_64, LifterModelCall_x86_16): def __init__(self, loc_db): Lifter_X86_64.__init__(self, loc_db) |