+
+ // IDA vs masm float/mmx/xmm type incompatibility
+ if (isDouble(ea_flags) || isTbyt(ea_flags)
+ || isPackReal(ea_flags))
+ {
+ do_undef = 1;
+ }
+ else if (isOwrd(ea_flags)) {
+ buf[0] = 0;
+ get_name(BADADDR, ea, buf, sizeof(buf));
+ if (IS_START(buf, "xmm"))
+ do_undef = 1;
+ }
+ // masm doesn't understand IDA's unicode
+ else if (isASCII(ea_flags) && ea_size >= 4
+ && (get_long(ea) & 0xff00ff00) == 0) // lame..
+ {
+ do_undef = 1;
+ }
+ // masm doesn't understand large aligns
+ else if (isAlign(ea_flags) && ea_size > 0x10) {
+ msg("%x: undefining align %d\n", ea, ea_size);
+ do_unknown(ea, DOUNK_EXPAND);
+ }
+
+ if (do_undef) {
+ buf[0] = 0;
+ get_name(BADADDR, ea, buf, sizeof(buf));
+ msg("%x: undefining '%s'\n", ea, buf);
+ do_unknown(ea, DOUNK_EXPAND);
+ }
+ }
+ }
+
+ // check namelist for reserved names
+ n = get_nlist_size();
+ for (i = 0; i < n; i++) {
+ ea = get_nlist_ea(i);
+ name = get_nlist_name(i);
+ if (name == NULL) {
+ msg("%x: null name?\n", ea);
+ continue;
+ }
+
+ // 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);