X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugin%2Fsaveasm.cpp;h=5f704ef31b2aab7a6eb5c50e578e439cdf01d39f;hb=60fe410ce8c940b42a341f8dfebd365b76a77c14;hp=2d07728603af1301ea2a0d7a882a483af5a84d91;hpb=94cd6e34c1fe0411c4e79a89490caea768975bc4;p=ia32rtools.git diff --git a/plugin/saveasm.cpp b/plugin/saveasm.cpp index 2d07728..5f704ef 100644 --- a/plugin/saveasm.cpp +++ b/plugin/saveasm.cpp @@ -43,6 +43,8 @@ static const char *reserved_names[] = { "offset", "aam", "text", + "size", + "c", }; static int is_name_reserved(const char *name) @@ -386,11 +388,6 @@ static void idaapi run(int /*arg*/) do_def_line(buf, sizeof(buf), ln.down(), ea); if (strstr(buf, "include")) continue; - p = strstr(buf, "assume cs"); - if (p != NULL) { - memmove(p + 1, p, strlen(p) + 1); - *p = ';'; - } fout_line++; qfprintf(fout, "%s\n", buf); @@ -406,7 +403,8 @@ static void idaapi run(int /*arg*/) qstrncpy(p, "include imports.inc", sizeof(buf) - (p - buf)); fout_line++; qfprintf(fout, "\n%s\n", buf); - continue; + i++; + break; } } pl.lnnum = i; @@ -551,7 +549,12 @@ pass: } } - if (fw[0] == 'e' && IS_START(fw, "end") && fw[3] == ' ') { + if (fw[0] == 'a' && IS_START(fw, "assume cs")) { + // "assume cs" causes problems with ext syms + memmove(fw + 1, fw, strlen(fw) + 1); + *fw = ';'; + } + else if (fw[0] == 'e' && IS_START(fw, "end") && fw[3] == ' ') { fout_line++; qfprintf(fout, "include public.inc\n\n");