miasm
Reverse engineering framework
|
Variables | |
parser = ArgumentParser("Constant expression propagation") | |
help | |
action | |
args = parser.parse_args() | |
machine = Machine("x86_32") | |
loc_db = LocationDB() | |
cont = Container.from_stream(open(args.filename, 'rb'), loc_db) | |
mdis = machine.dis_engine(cont.bin_stream, loc_db=loc_db) | |
ir_arch = machine.ira(mdis.loc_db) | |
addr = int(args.address, 0) | |
deadrm = DeadRemoval(ir_arch) | |
asmcfg = mdis.dis_multiblock(addr) | |
ircfg = ir_arch.new_ircfg_from_asmcfg(asmcfg) | |
entry_points = set([mdis.loc_db.get_offset_location(addr)]) | |
init_infos = ir_arch.arch.regs.regs_init | |
cst_propag_link = propagate_cst_expr(ir_arch, ircfg, addr, init_infos) | |
bool | modified = True |
Example of "constant expression" propagation. A "constant expression" is an expression based on constants or init regs.
constant_propagation.action |
constant_propagation.addr = int(args.address, 0) |
constant_propagation.args = parser.parse_args() |
constant_propagation.asmcfg = mdis.dis_multiblock(addr) |
constant_propagation.cont = Container.from_stream(open(args.filename, 'rb'), loc_db) |
constant_propagation.cst_propag_link = propagate_cst_expr(ir_arch, ircfg, addr, init_infos) |
constant_propagation.deadrm = DeadRemoval(ir_arch) |
constant_propagation.entry_points = set([mdis.loc_db.get_offset_location(addr)]) |
constant_propagation.help |
constant_propagation.init_infos = ir_arch.arch.regs.regs_init |
constant_propagation.ir_arch = machine.ira(mdis.loc_db) |
constant_propagation.ircfg = ir_arch.new_ircfg_from_asmcfg(asmcfg) |
constant_propagation.loc_db = LocationDB() |
constant_propagation.machine = Machine("x86_32") |
bool constant_propagation.modified = True |
constant_propagation.parser = ArgumentParser("Constant expression propagation") |