about summary refs log tree commit diff stats
path: root/example/jitter/unpack_upx.py
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2016-01-26 17:45:24 +0100
committerserpilliere <serpilliere@users.noreply.github.com>2016-01-26 17:45:24 +0100
commitc1bc56754495e1c2a4176aaa486de9e58cb02a88 (patch)
tree1ca51aab9e0908e3f11b0cccc7ad7f50be349f67 /example/jitter/unpack_upx.py
parentb3fae7887d63bcdbb18b25ade6d20f152d802005 (diff)
parentd6222c4383891c6706ce70ec7750b42ee24e1cfc (diff)
downloadmiasm-c1bc56754495e1c2a4176aaa486de9e58cb02a88.tar.gz
miasm-c1bc56754495e1c2a4176aaa486de9e58cb02a88.zip
Merge pull request #309 from commial/feature-basicblocks
Feature AsmCFG
Diffstat (limited to '')
-rw-r--r--example/jitter/unpack_upx.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/example/jitter/unpack_upx.py b/example/jitter/unpack_upx.py
index 72a9feb3..d95c5a18 100644
--- a/example/jitter/unpack_upx.py
+++ b/example/jitter/unpack_upx.py
@@ -3,7 +3,7 @@ import logging
 from pdb import pm
 from elfesteem import pe
 from miasm2.analysis.sandbox import Sandbox_Win_x86_32
-from miasm2.core import asmbloc
+
 
 filename = os.environ.get('PYTHONSTARTUP')
 if filename and os.path.isfile(filename):
@@ -61,8 +61,7 @@ mdis = sb.machine.dis_engine(sb.jitter.bs)
 mdis.dont_dis_nulstart_bloc = True
 ab = mdis.dis_multibloc(sb.entry_point)
 
-bb = asmbloc.basicblocs(ab)
-leaves = bb.get_bad_dst()
+leaves = list(ab.get_bad_blocks_predecessors())
 assert(len(leaves) == 1)
 l = leaves.pop()
 logging.info(l)
@@ -73,8 +72,7 @@ logging.info(end_label)
 
 # Export CFG graph (dot format)
 if options.graph is True:
-    g = asmbloc.bloc2graph(ab)
-    open("graph.dot", "w").write(g)
+    open("graph.dot", "w").write(ab.graph.dot())
 
 
 if options.verbose is True: