Decompiling - the process of recreating the source code by the decompiler
Recently I wondered: Which decompiler is better?
Began to torment Google, experiment. In the end, I found a great solution. How to decompile any program and get working "sources"? About this in the subject.
Overview of Popular Decompilers
Mocha
Mocha (by Hanpeter van Vliet) is probably one of the first Java decompilers released. Provides a console user interface. Its release took place in the 1996th year, even before the Java Development Kit version 1.1 appeared.
JAva Decompiler
JAva Decompiler, JAD (by Pavel Kouznetsov) is the most
popular Java decompiler. Like Mocha, this decompiler provides a console interface that has not been updated and supported for a long time, but a large number of graphical tools for working with it, including the JadClipse plugin for the Eclipse development environment, make it still used as an improvised tool for decompiling small classes.
In addition to decompiling, JAva Decompiler has the ability to disassemble .class files.
')
DJ Java Decompiler
DJ Java Decompiler (by Atanas Neshkov) - for a long time, contrary to the name, was only a graphical shell for the previous decompiler, which made it easy and convenient to select command-line arguments for calling JAD. The current version adds support for annotations, but the decompiler has become shareware (purchase is required after 10 trial uses).
Jd-core
JD-Core (by Emmanuel Dupuy) is a very powerful and functional library for decompiling and analyzing Java bytecode, developed as part of the “Java Decompiler project”.
It has the following features:
- Fully written in C ++, which makes decompiling extremely fast.
- Does not require Java Runtime Environment to work and therefore does not require special installation.
- Decompiles correctly the .class files generated by most compilers.
Perhaps the disadvantages of JD-Core can only be attributed to the fact that it is distributed as
part of a standalone JD-GUI graphical application, also developed in C ++ and linked statically to it, or the JD-Eclipse plugin for the Eclipse development environment, which makes it almost impossible to use it in a third-party non-commercial project, especially developed in Java. The use of the library in commercial software products is prohibited by the author.
Fernflower
Fernflower is one of the best decompilers for the Java programming language today.
It has the following features:
1. Supports a variety of language constructs:
- Parametric types
- Annotations
- Enumerated types
- Statements
2. Correctly decompiles bytecode generated due to some known compiler bugs.
My choice
JD-GUI
- for viewing, no moreFernflower
- full recovery
I will stop on the second. In general, the author of this decompiler didn’t seem to be sharing the offline version (or I missed this fact by reading his blog), until recently it was only online. But for me it was a pleasant surprise to find her on one forum!
Download:
fernflower.jarQuote from
the author's blog :
Fernflower will develop towards deobfuscator
...
There are no special Fernflower deobfuscation functions now, they will be connected in the future by separate modules
Since for unknown reasons, the online version does not work, and it’s hard to say anything offline (except that the decompilation quality is excellent), there can be no talk about any modules at the moment.
Not enough rename module
This is yes. Let's look for something on the Internet.
Proguard will come to the rescue, but an extraordinary
ProGuardDeobfuscator is a small modification of the ProGuard program that turns it into a quasi-deobfuscator. During processing, short obfuscated names of packages, classes, fields, and methods are replaced with more meaningful and unique names within the Jar file.
Download the sources and deobfuscator itself:
projectd8.org/Programs/Java/PGDI have all the tools, but personally, I use the beloved Netbeans IDE to make it easier to recreate sorts - it helps a lot with its hints, especially when there are a lot of classes.
Thanks for attention!
Links
se.math.spbu.ru/SE/YearlyProjects/2011/YearlyProjects/2011/345/345_Mikhailov_report.pdfru-java.livejournal.comUPD:I apologize, in the offline version of Fernflower there is a module for renaming and a lot of other pieces -
Readme