diff options
| author | Camille Mougey <commial@gmail.com> | 2018-07-05 17:52:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-07-05 17:52:12 +0200 |
| commit | a3961b92c47a9cc47510601b57267822fcbdcbdf (patch) | |
| tree | ac39a9859983baff15d52533829d95ffa760f633 /example/symbol_exec/depgraph.py | |
| parent | f5fd096d35a9b3811097c40f553c90d3036cc035 (diff) | |
| parent | 045182c94d6bb1c9417b612d88fd469e0f87872f (diff) | |
| download | miasm-a3961b92c47a9cc47510601b57267822fcbdcbdf.tar.gz miasm-a3961b92c47a9cc47510601b57267822fcbdcbdf.zip | |
Merge pull request #784 from serpilliere/split_ir_graph
Split ir graph
Diffstat (limited to 'example/symbol_exec/depgraph.py')
| -rw-r--r-- | example/symbol_exec/depgraph.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/example/symbol_exec/depgraph.py b/example/symbol_exec/depgraph.py index 88540a83..f306e6e3 100644 --- a/example/symbol_exec/depgraph.py +++ b/example/symbol_exec/depgraph.py @@ -62,18 +62,19 @@ if args.rename_args: asmcfg = mdis.dis_multiblock(int(args.func_addr, 0)) # Generate IR -for block in asmcfg.blocks: - ir_arch.add_block(block) +ircfg = ir_arch.new_ircfg_from_asmcfg(asmcfg) # Get the instance -dg = DependencyGraph(ir_arch, implicit=args.implicit, - apply_simp=not args.do_not_simplify, - follow_mem=not args.unfollow_mem, - follow_call=not args.unfollow_call) +dg = DependencyGraph( + ircfg, implicit=args.implicit, + apply_simp=not args.do_not_simplify, + follow_mem=not args.unfollow_mem, + follow_call=not args.unfollow_call +) # Build information target_addr = int(args.target_addr, 0) -current_block = list(ir_arch.getby_offset(target_addr))[0] +current_block = list(ircfg.getby_offset(target_addr))[0] assignblk_index = 0 for assignblk_index, assignblk in enumerate(current_block): if assignblk.instr.offset == target_addr: @@ -86,7 +87,7 @@ for sol_nb, sol in enumerate(dg.get(current_block.loc_key, elements, assignblk_i with open(fname, "w") as fdesc: fdesc.write(sol.graph.dot()) - results = sol.emul(ctx=init_ctx) + results = sol.emul(ir_arch, ctx=init_ctx) tokens = {str(k): str(v) for k, v in results.iteritems()} if not args.json: result = ", ".join("=".join(x) for x in tokens.iteritems()) |