about summary refs log tree commit diff stats
path: root/example/disas_and_graph.py
diff options
context:
space:
mode:
Diffstat (limited to 'example/disas_and_graph.py')
-rwxr-xr-xexample/disas_and_graph.py10
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)