20 comments

[ 2.6 ms ] story [ 40.6 ms ] thread
The correct name is Fernflower, not FernFlower.

I found this amusing, from a Java perspective. The 3-character command-line options are also very "not Java-ish". However, since this one is also written in Java, a good test is if it can decompile itself perfectly and the result recompiled to a matching binary; much like how bootstrapping a compiler involves compiling itself and checking for the existence of the fixed-point.

I know you probably don’t want an LLM in your decompiler, but assigning meaningful names could be a good task for an LLM.
One day I was using ghidra to decompile something to find out how it works, and the LLM helped a lot. It was a game changer in refactoring of the decompiled assembly-that-looked-like-c language.
That'd make sense if the jar is obfuscated. Java preserves method and class names by default.
> Fernflower is the first actually working analytical decompiler for Java and probably for a high-level programming language in general.

That really deserves a link. What is an “analytical” decompiler?

As far as I can tell (although I"m a novice at RE), in the native world all non-trivial decompilers are "analytical", doing things like control-flow recovery and such. I guess the only reason why the first java decompiler was "non-analytical" is that the bytecode (at least in early days) was simple enough that you could basically pattern-match it back to instructions.

So if I'd have to give a definition I pulled out of my ass:

* non-analytical compiler: "local", works only at the instruction or basic-block level, probably done by just pattern matching templates

* analytical: anything that does non-local transformations, working across basic-blocks to recover logic and control flow

Is it only me or fernflower does not put the code in the correct lines, and the debugging fails to navigate over the code in the IntelliJ IDEA?
(comment deleted)
Can the decompiled result be compiled again?
(comment deleted)
I'm using this decompiler in my project right now. Its the best of the bunch and Jetbrains actively maintains it with good support.
...written in Java! Recursion going strong :)