From 3a0df3103860ae32f3fac4d72f07d12e08886d4d Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 17 Oct 2015 00:46:55 +0300 Subject: [PATCH] plugin: don't rename stdcall names func@4 and the likes --- ida/saveasm/saveasm.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ida/saveasm/saveasm.cpp b/ida/saveasm/saveasm.cpp index 5a6a2a6..38eb480 100644 --- a/ida/saveasm/saveasm.cpp +++ b/ida/saveasm/saveasm.cpp @@ -240,6 +240,7 @@ static void idaapi run(int /*arg*/) char buf[MAXSTR]; char buf2[MAXSTR]; const char *name; + const char *cp; struc_t *frame; func_t *func; ea_t ui_ea_block = 0, ea_size; @@ -524,8 +525,16 @@ static void idaapi run(int /*arg*/) // rename vars with '?@' (funcs are ok) int change_qat = 0; ea_flags = get_flags_novalue(ea); - if (!isCode(ea_flags) && strpbrk(name, "?@")) - change_qat = 1; + if (!isCode(ea_flags)) { + if (strchr(name, '?')) + change_qat = 1; + else if ((cp = strchr(name, '@'))) { + char *endp = NULL; + strtol(cp + 1, &endp, 10); + if (endp == NULL || *endp != 0) + change_qat = 1; + } + } if (need_rename || change_qat) { msg("%x: renaming name '%s'\n", ea, name); -- 2.39.5