From: notaz Date: Sun, 19 Apr 2015 20:45:59 +0000 (+0300) Subject: plugin: add hints on 'jmp $5' for translate X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a84bddd1182981dada1173feb749131fd55029e9;p=ia32rtools.git plugin: add hints on 'jmp $5' for translate --- diff --git a/ida/saveasm/saveasm.cpp b/ida/saveasm/saveasm.cpp index 5be0dda..f922483 100644 --- a/ida/saveasm/saveasm.cpp +++ b/ida/saveasm/saveasm.cpp @@ -309,6 +309,18 @@ static void idaapi run(int /*arg*/) } } + // detect tailcalls to next func with 'jmp $+5' (offset 0) + if (f_area.endEA - f_area.startEA >= 5 + && decode_insn(f_area.endEA - 5) && cmd.itype == NN_jmp + && cmd.Operands[0].type == o_near + && cmd.Operands[0].addr == f_area.endEA + && get_name(BADADDR, f_area.endEA, buf, sizeof(buf)) + && get_cmt(f_area.endEA - 5, false, buf2, sizeof(buf2)) <= 0) + { + qsnprintf(buf2, sizeof(buf2), "sctpatch: jmp %s", buf); + set_cmt(f_area.endEA - 5, buf2, false); + } + func = get_next_func(ea); }