miasm
Reverse engineering framework
asmblock.py File Reference

Namespaces

 asmblock
 

Functions

def asmblock.remove_useless_blocks (d_g, graph)
 Check final state. More...
 

Variables

 asmblock.data = decode_hex("5589e583ec10837d08007509c745fc01100000eb73837d08017709c745fc02100000eb64837d08057709c745fc03100000eb55837d080774138b450801c083f80e7509c745fc04100000eb3c8b450801c083f80e7509c745fc05100000eb298b450883e03085c07409c745fc06100000eb16837d08427509c745fc07100000eb07c745fc081000008b45fcc9c3")
 
 asmblock.loc_db = LocationDB()
 
 asmblock.cont = Container.from_string(data, loc_db)
 
 asmblock.machine = Machine("x86_32")
 
 asmblock.mdis = machine.dis_engine(cont.bin_stream, loc_db=loc_db)
 
 asmblock.first_block = mdis.dis_block(0)
 Disassembly of one block. More...
 
 asmblock.first_block_bis = mdis.dis_block(0)
 Test redisassemble asmcfg. More...
 
 asmblock.asmcfg = mdis.dis_multiblock(0)
 Disassembly of several block, with cache. More...
 
 asmblock.leaves = asmcfg.leaves()
 Equality between assembly lines is not yet implemented. More...
 
 asmblock.last_block_loc_key = leaves.pop()
 
bool asmblock.good = False
 Modification must be reported from the graph. More...
 
 asmblock.dg = DiGraphSimplifier()
 Use a graph simplifier to recursively apply the simplification pass. More...
 
 asmblock.testlabel = loc_db.get_or_create_name_location("testlabel")
 Only two asmcfg should remain. More...
 
 asmblock.my_block = AsmBlock(loc_db, testlabel)
 
 asmblock.testlabel_bad = loc_db.get_or_create_name_location("testlabel_bad")
 Bad asmcfg. More...
 
 asmblock.my_bad_block = AsmBlockBad(loc_db, testlabel_bad)
 
 asmblock.testlabel_nextitself = loc_db.get_or_create_name_location("testlabel_nextitself")
 Link the bad block and update edges Indeed, a sub-element has been modified (bto from a block from asmcfg) More...
 
 asmblock.my_block_ni = AsmBlock(loc_db, testlabel_nextitself)
 
bool asmblock.error_raised = False
 OK for now. More...
 
 asmblock.testlabel_target = loc_db.get_or_create_name_location("testlabel_target")
 Back to a normal state. More...
 
 asmblock.my_block_target = AsmBlock(loc_db, testlabel_target)
 
 asmblock.testlabel_src1 = loc_db.get_or_create_name_location("testlabel_src1")
 
 asmblock.testlabel_src2 = loc_db.get_or_create_name_location("testlabel_src2")
 
 asmblock.my_block_src1 = AsmBlock(loc_db, testlabel_src1)
 
 asmblock.my_block_src2 = AsmBlock(loc_db, testlabel_src2)
 
 asmblock.testlabel_pend_src = loc_db.get_or_create_name_location("testlabel_pend_src")
 Guess block size Initial state. More...
 
 asmblock.testlabel_pend_dst = loc_db.get_or_create_name_location("testlabel_pend_dst")
 
 asmblock.my_block_src = AsmBlock(loc_db, testlabel_pend_src)
 
 asmblock.my_block_dst = AsmBlock(loc_db, testlabel_pend_dst)
 
 asmblock.pending = list(asmcfg.pendings[my_block_dst.loc_key])[0]
 Check resulting state. More...
 
 asmblock.data2 = decode_hex("31c0eb0c31c9750c31d2eb0c31ffebf831dbebf031edebfc31f6ebf031e4c3")
 Pending must disappeared when adding expected block. More...
 
 asmblock.cont2 = Container.from_string(data2, loc_db)
 
 asmblock.entry_asmcfg = asmcfg.heads()
 Dump the graph after merging. More...
 
 asmblock.bad_block_lbl
 
 asmblock.alone_block
 
 asmblock.entry_block = asmcfg.loc_key_to_block(entry_asmcfg.pop())
 Check resulting function. More...
 
 asmblock.nextb
 
 asmblock.tob
 
 asmblock.asmcfg_bef = asmcfg.copy()
 Without condition for a split, no change. More...
 
 asmblock.inside_firstbbl = loc_db.get_offset_location(4)
 Create conditions for a block split. More...
 
 asmblock.lbl_newb = asmcfg.successors(entry_block.loc_key)[0]
 Check result. More...
 
 asmblock.newb = asmcfg.loc_key_to_block(lbl_newb)
 
 asmblock.preds = asmcfg.predecessors(lbl_newb)
 
 asmblock.bbl0 = MatchGraphJoker(name="0")
 Check resulting disasm. More...
 
 asmblock.bbl2 = MatchGraphJoker(name="2")
 
 asmblock.bbl4 = MatchGraphJoker(name="4")
 
 asmblock.bbl9 = MatchGraphJoker(name="9")
 
 asmblock.bblB = MatchGraphJoker(name="B")
 
 asmblock.bbl10 = MatchGraphJoker(name="10")
 
 asmblock.matcher = bbl0 >> bbl2 >> bbl4 >> bbl9 >> bblB >> bbl10
 
 asmblock.solutions = list(matcher.match(asmcfg))
 
 asmblock.solution = solutions.pop()
 
 asmblock.offset = loc_db.get_location_offset(label)
 
 asmblock.loc_key_dum = loc_db.get_or_create_name_location("dummy_loc")