about summary refs log tree commit diff stats
path: root/example/jitter/unpack_upx.py
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2016-01-25 11:05:29 +0100
committerAjax <commial@gmail.com>2016-01-26 17:09:18 +0100
commit455cfbe8b7aed7cb5be8e1b9aa1917a9f7d51821 (patch)
tree58c354de7afe7b4b0ca6af923616941ba9c2e79e /example/jitter/unpack_upx.py
parent01b1f292c84d4cbda38b6c308fc7b1af52595cec (diff)
downloadmiasm-455cfbe8b7aed7cb5be8e1b9aa1917a9f7d51821.tar.gz
miasm-455cfbe8b7aed7cb5be8e1b9aa1917a9f7d51821.zip
BasicBlocks: update examples with the new API
Diffstat (limited to 'example/jitter/unpack_upx.py')
-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: