diff options
Diffstat (limited to 'example/ida')
| -rw-r--r-- | example/ida/ctype_propagation.py | 12 | ||||
| -rw-r--r-- | example/ida/depgraph.py | 16 | ||||
| -rw-r--r-- | example/ida/graph_ir.py | 6 | ||||
| -rw-r--r-- | example/ida/symbol_exec.py | 6 |
4 files changed, 20 insertions, 20 deletions
diff --git a/example/ida/ctype_propagation.py b/example/ida/ctype_propagation.py index 1f55a975..3de81d0d 100644 --- a/example/ida/ctype_propagation.py +++ b/example/ida/ctype_propagation.py @@ -222,9 +222,9 @@ class CTypeEngineFixer(SymbExecCTypeFix): cst_propag_link) -def get_ira_call_fixer(ira): +def get_lifter_model_call_call_fixer(lifter_model_call): - class iraCallStackFixer(ira): + class lifter_model_callCallStackFixer(lifter_model_call): def call_effects(self, ad, instr): print(hex(instr.offset), instr) @@ -241,7 +241,7 @@ def get_ira_call_fixer(ira): ) return [call_assignblk], [] - return iraCallStackFixer + return lifter_model_callCallStackFixer def analyse_function(): @@ -262,7 +262,7 @@ def analyse_function(): # Init machine = guess_machine(addr=addr) - mn, dis_engine, ira = machine.mn, machine.dis_engine, machine.ira + mn, dis_engine, lifter_model_call = machine.mn, machine.dis_engine, machine.lifter_model_call bs = bin_stream_ida() loc_db = LocationDB() @@ -272,8 +272,8 @@ def analyse_function(): mdis.dont_dis = [end] - iraCallStackFixer = get_ira_call_fixer(ira) - ir_arch = iraCallStackFixer(loc_db) + lifter_model_callCallStackFixer = get_lifter_model_call_call_fixer(lifter_model_call) + ir_arch = lifter_model_callCallStackFixer(loc_db) asmcfg = mdis.dis_multiblock(addr) # Generate IR diff --git a/example/ida/depgraph.py b/example/ida/depgraph.py index e98d64c5..4a0fb1e9 100644 --- a/example/ida/depgraph.py +++ b/example/ida/depgraph.py @@ -26,9 +26,9 @@ from utils import guess_machine class depGraphSettingsForm(ida_kernwin.Form): - def __init__(self, ira, ircfg, mn): + def __init__(self, lifter_model_call, ircfg, mn): - self.ira = ira + self.lifter_model_call = lifter_model_call self.ircfg = ircfg self.mn = mn self.stk_args = {'ARG%d' % i:i for i in range(10)} @@ -51,7 +51,7 @@ class depGraphSettingsForm(ida_kernwin.Form): assert line_nb is not None cur_loc_key = str(cur_block.loc_key) loc_keys = sorted(map(str, ircfg.blocks)) - regs = sorted(ira.arch.regs.all_regs_ids_byname) + regs = sorted(lifter_model_call.arch.regs.all_regs_ids_byname) regs += list(self.stk_args) reg_default = regs[0] for i in range(10): @@ -130,13 +130,13 @@ Method to use: line = self.ircfg.blocks[self.loc_key][self.line_nb].instr arg_num = self.stk_args[value] stk_high = m2_expr.ExprInt(idc.get_spd(line.offset), ir_arch.sp.size) - stk_off = m2_expr.ExprInt(self.ira.sp.size // 8 * arg_num, ir_arch.sp.size) - element = m2_expr.ExprMem(self.mn.regs.regs_init[ir_arch.sp] + stk_high + stk_off, self.ira.sp.size) + stk_off = m2_expr.ExprInt(self.lifter_model_call.sp.size // 8 * arg_num, ir_arch.sp.size) + element = m2_expr.ExprMem(self.mn.regs.regs_init[ir_arch.sp] + stk_high + stk_off, self.lifter_model_call.sp.size) element = expr_simp(element) # Force stack unaliasing self.stk_unalias_force = True elif value: - element = self.ira.arch.regs.all_regs_ids_byname.get(value, None) + element = self.lifter_model_call.arch.regs.all_regs_ids_byname.get(value, None) else: raise ValueError("Unknown element '%s'!" % value) @@ -214,13 +214,13 @@ def launch_depgraph(): # Init machine = guess_machine(addr=func.start_ea) - mn, dis_engine, ira = machine.mn, machine.dis_engine, machine.ira + mn, dis_engine, lifter_model_call = machine.mn, machine.dis_engine, machine.lifter_model_call bs = bin_stream_ida() loc_db = LocationDB() mdis = dis_engine(bs, loc_db=loc_db, dont_dis_nulstart_bloc=True) - ir_arch = ira(loc_db) + ir_arch = lifter_model_call(loc_db) # Populate symbols with ida names for ad, name in idautils.Names(): diff --git a/example/ida/graph_ir.py b/example/ida/graph_ir.py index d10e1ebd..c827bbe2 100644 --- a/example/ida/graph_ir.py +++ b/example/ida/graph_ir.py @@ -180,9 +180,9 @@ def is_addr_ro_variable(bs, addr, size): def build_graph(start_addr, type_graph, simplify=False, use_ida_stack=True, dontmodstack=False, loadint=False, verbose=False): machine = guess_machine(addr=start_addr) - dis_engine, ira = machine.dis_engine, machine.ira + dis_engine, lifter_model_call = machine.dis_engine, machine.lifter_model_call - class IRADelModCallStack(ira): + class IRADelModCallStack(lifter_model_call): def call_effects(self, addr, instr): assignblks, extra = super(IRADelModCallStack, self).call_effects(addr, instr) if use_ida_stack: @@ -281,7 +281,7 @@ def build_graph(start_addr, type_graph, simplify=False, use_ida_stack=True, dont return - class IRAOutRegs(ira): + class IRAOutRegs(lifter_model_call): def get_out_regs(self, block): regs_todo = super(IRAOutRegs, self).get_out_regs(block) out = {} diff --git a/example/ida/symbol_exec.py b/example/ida/symbol_exec.py index b51ef9ee..ef5db082 100644 --- a/example/ida/symbol_exec.py +++ b/example/ida/symbol_exec.py @@ -150,11 +150,11 @@ def symbolic_exec(): mdis.dont_dis = [end] asmcfg = mdis.dis_multiblock(start) - ira = machine.ira(loc_db=loc_db) - ircfg = ira.new_ircfg_from_asmcfg(asmcfg) + lifter_model_call = machine.lifter_model_call(loc_db=loc_db) + ircfg = lifter_model_call.new_ircfg_from_asmcfg(asmcfg) print("Run symbolic execution...") - sb = SymbolicExecutionEngine(ira, machine.mn.regs.regs_init) + sb = SymbolicExecutionEngine(lifter_model_call, machine.mn.regs.regs_init) sb.run_at(ircfg, start) modified = {} |