diff options
| author | Pierre LALET <pierre.lalet@cea.fr> | 2011-09-05 14:13:52 +0200 |
|---|---|---|
| committer | Pierre LALET <pierre.lalet@cea.fr> | 2011-09-05 14:13:52 +0200 |
| commit | fdb869856b6d83962935379044dc4e577cd8b933 (patch) | |
| tree | b654a58aaf93abae217f4c598162b2de3301be8e /example/disas_and_graph.py | |
| parent | 2daacc428034d3a5f364800e24e2b8bcb01cf440 (diff) | |
| parent | ef7c41c81f612fb225b79cb646f1d6eb8c8b722e (diff) | |
| download | miasm-fdb869856b6d83962935379044dc4e577cd8b933.tar.gz miasm-fdb869856b6d83962935379044dc4e577cd8b933.zip | |
merge
Diffstat (limited to 'example/disas_and_graph.py')
| -rwxr-xr-x | example/disas_and_graph.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/example/disas_and_graph.py b/example/disas_and_graph.py index 9a0e5527..23c92d0d 100755 --- a/example/disas_and_graph.py +++ b/example/disas_and_graph.py @@ -34,7 +34,7 @@ if data.startswith("MZ"): if len(sys.argv) <=2: ad_to_dis = e.rva2virt(e.Opthdr.AddressOfEntryPoint) else: - ad_to_dis = int(sys.argv[1], 16) + ad_to_dis = int(sys.argv[2], 16) in_str = bin_stream.bin_stream(e.virt) try: dll_dyn_funcs = get_import_address(e) @@ -47,7 +47,7 @@ elif data.startswith("\x7fELF") : if len(sys.argv) <=2: ad_to_dis = e.Ehdr.entry else: - ad_to_dis = int(sys.argv[1], 16) + ad_to_dis = int(sys.argv[2], 16) in_str = bin_stream.bin_stream(e.virt) try: dll_dyn_funcs = get_import_address_elf(e) @@ -69,7 +69,7 @@ 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.WCAttribute_code, m.attributes)[0].code + code = filter(lambda x: type(x) is jclass_init.CAttribute_code, m.attributes)[0].code methods[(name, descr)] = code if len(sys.argv) != 4: java_usage() @@ -127,9 +127,7 @@ def my_disasm_callback(ad): if hasattr(v, "pp"): o[k] = v.pp() else: - print repr(v) - fds - o[k] = "XX"#repr(v) + o[k] = repr(v) for b in all_bloc: for l in b.lines: l.set_args_symbols(o) |