about summary refs log tree commit diff stats
path: root/example/jitter
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2018-05-18 14:43:57 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2018-06-09 00:33:48 +0200
commit61551fa78e9dd22ed1f982b4fe171fd6383c39a6 (patch)
treeb10543391f9a66ddd5e3f6852c30d96b169b623d /example/jitter
parenta2637cdf0b40df074865d23a7fd71f082ad7f40a (diff)
downloadmiasm-61551fa78e9dd22ed1f982b4fe171fd6383c39a6.tar.gz
miasm-61551fa78e9dd22ed1f982b4fe171fd6383c39a6.zip
Core: replace AsmLabel by LocKey
Diffstat (limited to 'example/jitter')
-rw-r--r--example/jitter/sandbox_call.py3
-rw-r--r--example/jitter/unpack_upx.py9
2 files changed, 7 insertions, 5 deletions
diff --git a/example/jitter/sandbox_call.py b/example/jitter/sandbox_call.py
index dc64af15..7a9fd946 100644
--- a/example/jitter/sandbox_call.py
+++ b/example/jitter/sandbox_call.py
@@ -15,7 +15,8 @@ sb = Sandbox_Linux_arml(options.filename, options, globals())
 
 with open(options.filename, "rb") as fdesc:
     cont = Container.from_stream(fdesc)
-    addr_to_call = cont.symbol_pool.getby_name("md5_starts").offset
+    loc_key = cont.symbol_pool.getby_name("md5_starts")
+    addr_to_call = cont.symbol_pool.loc_key_to_offset(loc_key)
 
 # Calling md5_starts(malloc(0x64))
 addr = linobjs.heap.alloc(sb.jitter, 0x64)
diff --git a/example/jitter/unpack_upx.py b/example/jitter/unpack_upx.py
index f9b0aed1..b86724d6 100644
--- a/example/jitter/unpack_upx.py
+++ b/example/jitter/unpack_upx.py
@@ -59,10 +59,11 @@ leaves = list(ab.get_bad_blocks_predecessors())
 assert(len(leaves) == 1)
 l = leaves.pop()
 logging.info(l)
-end_label = l.label.offset
 
-logging.info('final label')
-logging.info(end_label)
+end_loc_key = mdis.symbol_pool.loc_key_to_offset(l)
+
+logging.info('final loc_key')
+logging.info(end_loc_key)
 
 # Export CFG graph (dot format)
 if options.graph is True:
@@ -85,7 +86,7 @@ def update_binary(jitter):
     return False
 
 # Set callbacks
-sb.jitter.add_breakpoint(end_label, update_binary)
+sb.jitter.add_breakpoint(end_loc_key, update_binary)
 
 # Run
 sb.run()