2

I've spent about a month trying out Ghidra, IDA and BinaryNinja and I'm somewhat frustrated

I need to transform decompiler's output without changing resulting code's behaviour (i.e. to make it more readable, more aesthetically pleasing, less cluttered)

But it seems that these tools are primarily for interacting with assembly, despite waving the name "decompiler" around.

None of the three provide any UI facilities to transform pseudocode. For example consider some trivialities:

  • None of them can help with transforming while-loop into for-loop
  • None of them can help transform nested-ifs into early returns
  • None of them are even able to switch if-else blocks around by inverting the condition

It feels like a lot of UX is spent making editing programs easy - e.g. right clicking if-condition in BinaryNinja allows one to invert it /in the program/.
But any sort of "advanced decompiling" is severely lacking


I feel like straight up giving up - pressing "decompile all", getting moderately awful result and continuing with normal text editor/IDE

Are there any tutorials/plugins/straight up different programs that can maybe help?

2 Answers 2

2

Check GitHub: Here is what I've found:

https://github.com/igogo-x86/HexRaysPyTools

Seems to have the option to invert if statements.

https://github.com/HexRaysSA/goomba

And the above seem to be able to optimize complex expressions sometimes leading to a single return.

Can't seem to find one for changing loops though.

You may need to enhance/write your own.

0

You can do all of those things with Hex-Rays. As for the last one, there's even an example in the SDK that does exactly that.

3
  • what's hex-rays? are you talking about IDA? and I'm asking for UI solutions Commented Jun 8 at 20:55
  • Well maybe there is some plugin that have more functionality. Check their plugin contests. Commented Jun 12 at 0:14
  • @NooneAtAll3 Hex-Rays is both the name of the company and the name of the decompiler plugin that you can license with IDA. So yeah, they're related, but not the same. Commented Jun 15 at 15:14

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.