X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugin%2Fsaveasm.cpp;h=3622cc8e0c893f7d4a60d65a4b98b726f141b659;hb=b25f320a4cbf26d2b28d9f74ff7c495516a710d0;hp=efe8e9d8b26d8c22677b68a0715a651b1d4c775d;hpb=cb6623274360357225526abaf285e5b500dbef97;p=ia32rtools.git diff --git a/plugin/saveasm.cpp b/plugin/saveasm.cpp index efe8e9d..3622cc8 100644 --- a/plugin/saveasm.cpp +++ b/plugin/saveasm.cpp @@ -333,9 +333,26 @@ static void idaapi run(int /*arg*/) continue; } - if (is_name_reserved(name)) { + // 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 (change_qat || is_name_reserved(name)) { msg("%x: renaming name '%s'\n", ea, name); qsnprintf(buf, sizeof(buf), "%s_g", name); + + if (change_qat) { + for (p = buf; *p != 0; p++) { + if (*p == '?' || *p == '@') { + qsnprintf(buf2, sizeof(buf2), "%02x", (unsigned char)*p); + memmove(p + 1, p, strlen(p) + 1); + memcpy(p, buf2, 2); + } + } + } + set_name(ea, buf); } }