From 24308ec5980e38f0870e9487b63c6d2704899d23 Mon Sep 17 00:00:00 2001 From: serpilliere Date: Thu, 1 Sep 2011 11:06:34 +0200 Subject: fix elfesteem api modif --- example/disas_and_graph.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'example') diff --git a/example/disas_and_graph.py b/example/disas_and_graph.py index 9a0e5527..1984bd49 100755 --- a/example/disas_and_graph.py +++ b/example/disas_and_graph.py @@ -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) -- cgit 1.4.1 From 271cc69e7f8f4411b2021830efbddca305cd690f Mon Sep 17 00:00:00 2001 From: serpilliere Date: Mon, 5 Sep 2011 13:16:58 +0200 Subject: fix x86_asm ep --- example/asm_x86.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'example') diff --git a/example/asm_x86.py b/example/asm_x86.py index 8e911676..79b61886 100755 --- a/example/asm_x86.py +++ b/example/asm_x86.py @@ -16,7 +16,7 @@ my_mn = x86_mn my_mn = x86_mn e = pe_init.PE() -e.SHList.add_section(name = "text", addr = 0x1000, rawsize = 0x4000) +s_text = e.SHList.add_section(name = "text", addr = 0x1000, rawsize = 0x4000) ####filelogger sc#### all_bloc, symbol_pool = parse_asm.parse_txt(my_mn,r''' @@ -56,6 +56,7 @@ eend: #fix shellcode addr symbol_pool.add(asmbloc.asm_label('base_address', 0x400000)) symbol_pool.getby_name("main").offset = 0x401000 +e.Opthdr.AddressOfEntryPoint = s_text.addr for b in all_bloc[0]: print b -- cgit 1.4.1 From ef7c41c81f612fb225b79cb646f1d6eb8c8b722e Mon Sep 17 00:00:00 2001 From: serpilliere Date: Mon, 5 Sep 2011 13:26:15 +0200 Subject: fix disasm graph tipo --- example/disas_and_graph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'example') diff --git a/example/disas_and_graph.py b/example/disas_and_graph.py index 1984bd49..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) -- cgit 1.4.1