From 99d52112060b795d26a27f70135aaedbc79d2c8c Mon Sep 17 00:00:00 2001 From: serpilliere Date: Wed, 19 Oct 2011 11:35:10 +0200 Subject: fix eop detection --- example/unpack_upx.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'example/unpack_upx.py') diff --git a/example/unpack_upx.py b/example/unpack_upx.py index 4d66be58..765ff4d8 100644 --- a/example/unpack_upx.py +++ b/example/unpack_upx.py @@ -55,7 +55,7 @@ decomp_buf_len_in = decomp_func - decomp_buf_ad_in decomp_buf_len_out = decomp_buf_ad_in - decomp_buf_ad_out print "in l", hex(decomp_buf_len_in), "out l", hex(decomp_buf_len_out) -dont_dis = [(decomp_buf_ad_out, decomp_buf_ad_in)] +dont_dis = asmbloc.interval([(decomp_buf_ad_out, decomp_buf_ad_in)]) g = asmbloc.bloc2graph(all_bloc) open("graph.txt" , "w").write(g) @@ -68,7 +68,8 @@ all_bloc = asmbloc.dis_bloc_all(x86_mn, in_str, decomp_func, job_done, symbol_po end_label = None for b in all_bloc: - if len(b.bto) == 1 and asmbloc.getblocby_label(all_bloc, b.bto[0].label)== None: + if len(b.bto) == 1 and abs(b.label.offset - b.bto[0].label.offset) > 0x1000: + # asmbloc.getblocby_label(all_bloc, b.bto[0].label)== None: end_label = b.bto[0].label.offset break if not end_label: -- cgit 1.4.1