All Projects → QuiltMC → quiltflower

QuiltMC / quiltflower

Licence: Apache-2.0 license
Modern Java decompiler aiming to be as accurate as possible, with an emphasis on output quality. Fork of the Fernflower decompiler.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to quiltflower

Bytecode Viewer
A Java 8+ Jar & Android APK Reverse Engineering Suite (Decompiler, Editor, Debugger & More)
Stars: ✭ 12,606 (+3720%)
Mutual labels:  decompiler, fernflower
vandal
Static program analysis framework for Ethereum smart contract bytecode.
Stars: ✭ 121 (-63.33%)
Mutual labels:  decompiler
Recaf
The modern Java bytecode editor
Stars: ✭ 3,374 (+922.42%)
Mutual labels:  decompiler
php-enphp-decoder
EnPHP Decoder written in PHP
Stars: ✭ 105 (-68.18%)
Mutual labels:  decompiler
FIDL
A sane API for IDA Pro's decompiler. Useful for malware RE and vulnerability research
Stars: ✭ 421 (+27.58%)
Mutual labels:  decompiler
ghidra-r2web
Ghidra plugin to start an r2 webserver to let r2 interact with it
Stars: ✭ 38 (-88.48%)
Mutual labels:  decompiler
Rellic
Rellic produces goto-free C output from LLVM bitcode
Stars: ✭ 234 (-29.09%)
Mutual labels:  decompiler
IDR
Interactive Delphi Reconstructor (Pascal version)
Stars: ✭ 40 (-87.88%)
Mutual labels:  decompiler
ethdasm
Tool for auditing Ethereum contracts
Stars: ✭ 52 (-84.24%)
Mutual labels:  decompiler
unbox
🎁 unbox - Unpack and Decompile the $h*! out of things
Stars: ✭ 39 (-88.18%)
Mutual labels:  decompiler
ghidra2dwarf
🐉 Export ghidra decompiled code to dwarf sections inside ELF binary
Stars: ✭ 135 (-59.09%)
Mutual labels:  decompiler
binsync
A collaborative reversing plugin for cross-decompiler collaboration, built on git.
Stars: ✭ 266 (-19.39%)
Mutual labels:  decompiler
sleigh
Unofficial CMake build for Ghidra SLEIGH
Stars: ✭ 54 (-83.64%)
Mutual labels:  decompiler
Dnpatch
.NET Patcher library using dnlib
Stars: ✭ 249 (-24.55%)
Mutual labels:  decompiler
tools.decompiler
A decompiler for clojure, in clojure
Stars: ✭ 66 (-80%)
Mutual labels:  decompiler
Jpexs Decompiler
JPEXS Free Flash Decompiler
Stars: ✭ 2,939 (+790.61%)
Mutual labels:  decompiler
SDA
SDA is a rich cross-platform tool for reverse engineering that focused firstly on analysis of computer games. I'm trying to create a mix of the Ghidra, Cheat Engine and x64dbg. My tool will combine static and dynamic analysis of programs. Now SDA is being developed.
Stars: ✭ 98 (-70.3%)
Mutual labels:  decompiler
LuaToolkit
Lua Encode/Decoder/Decompiler/Obfuscator in C#
Stars: ✭ 48 (-85.45%)
Mutual labels:  decompiler
doc
Design documents related to the decompilation pipeline.
Stars: ✭ 23 (-93.03%)
Mutual labels:  decompiler
react-native-decompiler
Decompile React Native Android/IOS Bundle.
Stars: ✭ 78 (-76.36%)
Mutual labels:  decompiler

Quiltflower

Quiltflower is a modern, general purpose decompiler focused on improving code quality, speed, and usability. Quiltflower is a fork of Fernflower and Forgeflower.

Changes include:

  • New language features (Try with resources, switch expressions, pattern matching, and more)
  • Better control flow generation (loops, try-catch, and switch, etc.)
  • More configurability
  • Better error messages
  • Javadoc application
  • Multithreading
  • Optimization
  • Many other miscellaneous features and fixes

Use

Want to use Quiltflower? There are a few ways! For Fabric and Architectury projects, Loom Quiltflower allows you to run genSources with Quiltflower. The Quiltflower Intellij IDEA plugin replaces Fernflower in IDEA with Quiltflower, and allows you to modify its settings. Or, if you want to run Quiltflower from the commandline, head over to the Releases tab and grab the latest, and then follow the instructions further down the readme. Make sure to report any issues to the Issues tab!

For support or questions, please join the Quilt toolchain discord.

Contributing

To contribute, please check out CONTRIBUTING.md and ARCHITECTURE.md!

When pulling from upstream, use https://github.com/fesh0r/fernflower

Special Thanks

  • Jetbrains- For maintaining Fernflower
  • Forge Team- For maintaining ForgeFlower
  • CFR- For it's large suite of very useful tests

Fernflower's readme is preserved below:

About Fernflower

Fernflower is the first actually working analytical decompiler for Java and probably for a high-level programming language in general. Naturally it is still under development, please send your bug reports and improvement suggestions to the issue tracker.

Licence

Fernflower is licenced under the Apache Licence Version 2.0.

Running from command line

java -jar quiltflower.jar [-<option>=<value>]* [<source>]+ <destination>

* means 0 or more times
+ means 1 or more times

<source>: file or directory with files to be decompiled. Directories are recursively scanned. Allowed file extensions are class, zip and jar. Sources prefixed with -e= mean "library" files that won't be decompiled, but taken into account when analysing relationships between classes or methods. Especially renaming of identifiers (s. option 'ren') can benefit from information about external classes.

<destination>: destination directory

<option>, <value>: a command-line option with the corresponding value (see "Command-line options" below).

Examples:

java -jar quiltflower.jar -hes=0 -hdc=0 c:\Temp\binary\ -e=c:\Java\rt.jar c:\Temp\source\

java -jar quiltflower.jar -dgs=1 c:\Temp\binary\library.jar c:\Temp\binary\Boot.class c:\Temp\source\

Command-line options

To force saving as a file or folder, --file and --folder can be provided. If not specified, Quiltflower will try to guess based on the file name.

With the exception of mpm, urc, ind, thr and log, the value of 1 means the option is activated, 0 - deactivated. Default value, if any, is given between parentheses.

Typically, the following options will be changed by user, if any: hes, hdc, dgs, mpm, ren, urc, ind, thr, tlf, tco The rest of options can be left as they are: they are aimed at professional reverse engineers.

  • rbr (1): hide bridge methods
  • rsy (1): hide synthetic class members
  • din (1): decompile inner classes
  • dc4 (1): collapse 1.4 class references
  • das (1): decompile assertions
  • hes (1): hide empty super invocation
  • hdc (1): hide empty default constructor
  • dgs (1): decompile generic signatures
  • ner (1): assume return not throwing exceptions
  • den (1): decompile enumerations
  • rgn (1): remove getClass() invocation, when it is part of a qualified new statement
  • lit (0): output numeric literals "as-is"
  • asc (0): encode non-ASCII characters in string and character literals as Unicode escapes
  • bto (1): interpret int 1 as boolean true (workaround to a compiler bug)
  • nns (0): allow for not set synthetic attribute (workaround to a compiler bug)
  • uto (1): consider nameless types as java.lang.Object (workaround to a compiler architecture flaw)
  • udv (1): reconstruct variable names from debug information, if present
  • rer (1): remove empty exception ranges
  • fdi (1): de-inline finally structures
  • mpm (0): maximum allowed processing time per decompiled method, in seconds. 0 means no upper limit
  • ren (0): rename ambiguous (resp. obfuscated) classes and class elements
  • urc (-): full name of a user-supplied class implementing IIdentifierRenamer interface. It is used to determine which class identifiers should be renamed and provides new identifier names (see "Renaming identifiers")
  • inn (1): check for IntelliJ IDEA-specific @NotNull annotation and remove inserted code if found
  • lac (0): decompile lambda expressions to anonymous classes
  • bsm (0): add mappings for source bytecode instructions to decompiled code lines
  • iib (0): ignore invalid bytecode
  • vac (0): verify that anonymous classes can be anonymous
  • tcs (0): simplify boolean constants in ternary operations
  • pam (0): decompile pattern matching
  • tlf (0): Experimental try loop enhancements (may cause some methods to decompile wrong or not at all!)
  • tco (1): Allow ternaries to be generated in if and loop conditions
  • isl (1): inline simple lambdas
  • jvn (0): use jad variable naming
  • sef (0): skip copying non-class files from the input folder or file to the output
  • win (1): warn about inconsistent inner class attributes
  • thr: maximum number of threads (default is number of threads available to the JVM)
  • jrt (0): add the currently used Java runtime as a library
  • dbe (1): dump bytecode on errors
  • dee (1): dump exceptions on errors
  • nls (0): define new line character to be used for output. 0 - '\r\n' (Windows), 1 - '\n' (Unix), default is OS-dependent
  • ind: indentation string (default is 3 spaces)
  • log (INFO): a logging level, possible values are TRACE, INFO, WARN, ERROR

Renaming identifiers

Some obfuscators give classes and their member elements short, meaningless and above all ambiguous names. Recompiling of such code leads to a great number of conflicts. Therefore it is advisable to let the decompiler rename elements in its turn, ensuring uniqueness of each identifier.

Option 'ren' (i.e. -ren=1) activates renaming functionality. Default renaming strategy goes as follows:

  • rename an element if its name is a reserved word or is shorter than 3 characters
  • new names are built according to a simple pattern: (class|method|field)_<consecutive unique number>
    You can overwrite this rules by providing your own implementation of the 4 key methods invoked by the decompiler while renaming. Simply pass a class that implements org.jetbrains.java.decompiler.main.extern.IIdentifierRenamer in the option 'urc' (e.g. -urc=com.example.MyRenamer) to Fernflower. The class must be available on the application classpath.

The meaning of each method should be clear from naming: toBeRenamed determine whether the element will be renamed, while the other three provide new names for classes, methods and fields respectively.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].