diff options
| author | serpilliere <devnull@localhost> | 2011-09-12 11:24:10 +0200 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2011-09-12 11:24:10 +0200 |
| commit | 12dee192c2dd95f1aa81fd29a633f9b24cbc262d (patch) | |
| tree | a452dd753dc3f54b9fed40f75850572149d43381 /example/disas_and_graph.py | |
| parent | be5ff3e34535c96b7761e73655d911e665a07d77 (diff) | |
| download | miasm-12dee192c2dd95f1aa81fd29a633f9b24cbc262d.tar.gz miasm-12dee192c2dd95f1aa81fd29a633f9b24cbc262d.zip | |
fix disasm java code
Diffstat (limited to 'example/disas_and_graph.py')
| -rwxr-xr-x | example/disas_and_graph.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/example/disas_and_graph.py b/example/disas_and_graph.py index 23c92d0d..ba68c44f 100755 --- a/example/disas_and_graph.py +++ b/example/disas_and_graph.py @@ -69,7 +69,10 @@ elif data.startswith("\xca\xfe\xba\xbe"): for m in e.description.methods: name = m.name descr = m.descriptor - code = filter(lambda x: type(x) is jclass_init.CAttribute_code, m.attributes)[0].code + c = filter(lambda x: type(x) is jclass_init.CAttribute_code, m.attributes) + if not c: + continue + code = c[0].code methods[(name, descr)] = code if len(sys.argv) != 4: java_usage() @@ -109,8 +112,7 @@ for (n,f), ad in dll_dyn_funcs.items(): def my_disasm_callback(ad): all_bloc = asmbloc.dis_bloc_all(mnemo, in_str, ad, set(), - symbol_pool=symbol_pool, - dont_dis_nulstart_bloc=True) + symbol_pool=symbol_pool) if mnemo == ia32_arch.x86_mn: for b in all_bloc: for l in b.lines: |