diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-06-11 23:01:16 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-06-11 23:01:40 +0200 |
| commit | cdeff572e86fcf2db5efbd0b3c89646d0180ce8c (patch) | |
| tree | 0a12f9890af6b046ab7ffd01a1aa8116582710d0 /example/jitter/unpack_upx.py | |
| parent | daeb87008fef7b051b18b46a5b4684334786c214 (diff) | |
| download | focaccia-miasm-cdeff572e86fcf2db5efbd0b3c89646d0180ce8c.tar.gz focaccia-miasm-cdeff572e86fcf2db5efbd0b3c89646d0180ce8c.zip | |
Example/upx: fix & updt
Diffstat (limited to 'example/jitter/unpack_upx.py')
| -rw-r--r-- | example/jitter/unpack_upx.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/example/jitter/unpack_upx.py b/example/jitter/unpack_upx.py index b86724d6..cd0818ec 100644 --- a/example/jitter/unpack_upx.py +++ b/example/jitter/unpack_upx.py @@ -53,21 +53,21 @@ if options.verbose is True: # Ensure there is one and only one leave (for OEP discovering) mdis = sb.machine.dis_engine(sb.jitter.bs) mdis.dont_dis_nulstart_bloc = True -ab = mdis.dis_multiblock(sb.entry_point) +asmcfg = mdis.dis_multiblock(sb.entry_point) -leaves = list(ab.get_bad_blocks_predecessors()) +leaves = list(asmcfg.get_bad_blocks_predecessors()) assert(len(leaves) == 1) l = leaves.pop() logging.info(l) -end_loc_key = mdis.symbol_pool.loc_key_to_offset(l) +end_offset = mdis.symbol_pool.loc_key_to_offset(l) -logging.info('final loc_key') -logging.info(end_loc_key) +logging.info('final offset') +logging.info(hex(end_offset)) # Export CFG graph (dot format) if options.graph is True: - open("graph.dot", "w").write(ab.graph.dot()) + open("graph.dot", "w").write(asmcfg.dot()) if options.verbose is True: @@ -86,7 +86,7 @@ def update_binary(jitter): return False # Set callbacks -sb.jitter.add_breakpoint(end_loc_key, update_binary) +sb.jitter.add_breakpoint(end_offset, update_binary) # Run sb.run() |