4

In IDA 6.6, is it possible to condense, or otherwise re-arrange, lines of pseudocode given by the Hex-Rays decompiler? For example

if ( !iFile2Size
  || *pFile2BufferCopy == *pFile3BufferCopy
  && (iFile2Size <= 1
   || pFile2BufferCopy[1] == pFile3BufferCopy[1]
   && (iFile2Size <= 2 || pFile2BufferCopy[2] == pFile3BufferCopy[2])) )
  blah;

is a bit eye bleedy. I can't for the life of me figure out how to re-arrange it though.

1 Answer 1

2

The only reliable way I know about requires writing HexRays plugin. Here and here you have an examples of such plugins that manipulates output of the decompiler - not exactly in a way you need, but probably it will give you some direction. Examples of such a plugins in IdaPython (probably not working and outdated) may be found in its old Google Code repository (see v*.py here )

In addition you can manipulate decompiler configuration. As it wrote here you can reduce or increase RIGHT_MARGIN parameter, and this will probably give you an ability to manipulate single line size of decompiler output (which will change representation of your condition among others). The same setting can be accessed via edit/plugins/something related to hexrays/ (sorry, I don't have HexRay installed right now) menu.

1
  • 1
    Thanks w s. For anyone else reading this, the decompiler settings w s mentions are found under edit/plugins/Hex-Rays Decompiler, then pressing the "Options" button allows you to change the Comment Indent / Block Comment / Right Margins. Commented Nov 9, 2015 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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