Is it possible to configure the decomplier so it will generate code for the entire function and not just the parts it thinks can be reached?

The disassemblier sees the alternate code path, but the decomplier won't generate the code for it.

  • Can you post the whole function and its control flow graph ? – w s May 17 '16 at 10:00
  • Which decompiler? – Vitaly Osipov May 19 '16 at 6:32

As far as I know there is no such configuration for hex rays decompiler. However it is possible that this code was not generated because of incorrect definition of function prototype (for example the list of parameters of the function is incomplete). You can see a bit more details about this in decompler FAQ .

Another reason I can imagine is incomplete control flow graph of the function. This may happen because a lot of reasons, for example incorrectly defined switch statement in it.

| improve this answer | |
  • For some systems, dead code can in fact be quite useful. An excerpt from: rocky.github.io/Deparsing-Paper.pdf : A decompiler can sometimes determine which form was used in the source code by using idiosyncrasies of the compiler. In many interpreters, since there is very little in the way of compilation and analysis, there are two constructs and the template for these will be different in order to cover the most generic situations. Even though the templates are different, after instantiation the semantics are often the same. ... – rocky Nov 19 '18 at 13:08

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.