2

For a long time now, I've been struggling with some functions generated with IDA HexRays plugin that seem to be corrupted.

Some of the decompiled generated plain C code, show as ASM code :/

i.e:

  sqrt(v4);
  __asm
  {
    fstp    [esp+24h+var_C]
    fld     [esp+24h+var_C]
    fstp    [esp+24h+var_14]
    fldz
  }

What could be the cause for this? possibly wrong stack pointers? I must admit that sometimes I also get the famous sp issue that I always fix by ALT + K and adjust the negative stack pointer, but the generated ASM code issue has happened to some functions before I even did that.

Note that when I load the same executable into another IDA instance and go to that same function memory, the decompiled code looks fine, so I'm guessing some how the database instance I'm working on due to one of my changes(probably structures layout) made that function failed?

Is there a way also fixing that so the generated code will look as plain C again? I already tried to undefine the corrupted function and re-analyze it, but the output code will still be as ASM.

Thanks in advance!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.