X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugin%2Fsaveasm.cpp;h=aee282f7581fefde4c6077f88cf10dd8357c282b;hb=92d715b6fea5e3d8883b7f296b8b9b0246807896;hp=0732e092c0148d2bccb134ce710caeee0cef3a33;hpb=fc1c61f5af4e34ed1a813cfdcbe4b9f1b585763c;p=ia32rtools.git diff --git a/plugin/saveasm.cpp b/plugin/saveasm.cpp index 0732e09..aee282f 100644 --- a/plugin/saveasm.cpp +++ b/plugin/saveasm.cpp @@ -248,7 +248,10 @@ static void idaapi run(int /*arg*/) if (cmd.Operands[o].type == o_mem) { tmp_ea = cmd.Operands[o].addr; flags_t tmp_ea_flags = get_flags_novalue(tmp_ea); - if (!isUnknown(tmp_ea_flags)) { + // ..but base float is ok.. + int is_flt = isDwrd(tmp_ea_flags) || isFloat(tmp_ea_flags); + if (!is_flt && !isUnknown(tmp_ea_flags)) + { buf[0] = 0; get_name(ea, tmp_ea, buf, sizeof(buf)); msg("%x: undefining %x '%s'\n", ea, tmp_ea, buf); @@ -439,7 +442,7 @@ static void idaapi run(int /*arg*/) for (;;) { int drop_large = 0, do_rva = 0, set_scale = 0, jmp_near = 0; - int word_imm = 0, dword_imm = 0, do_pushf = 0; + int word_imm = 0, dword_imm = 0, do_pushf = 0, do_nops = 0; if ((ea >> 14) != ui_ea_block) { ui_ea_block = ea >> 14; @@ -497,6 +500,12 @@ static void idaapi run(int /*arg*/) if (get_word(ea + opr.offb) == (ushort)opr.value) word_imm = 1; } + else if (opr.type == o_displ && opr.addr == 0 + && opr.offb != 0 && opr.hasSIB && opr.sib == 0x24) + { + // uses [esp+0] with 0 encoded into op + do_nops++; + } } } else { // not code @@ -593,6 +602,9 @@ pass: qfprintf(fout, "%s\n", buf); } + while (do_nops-- > 0) + qfprintf(fout, " nop ; adj\n"); + // note: next_head skips some undefined stuff ea = next_not_tail(ea); // correct? if (ea == BADADDR)