java-runtime-decompiler-5.1
·
750 commits
to master
since this release
pre release of 5.0
- due to incompatible changes in compiler api and overall delay, JRD will now be jdk11+ only
- but build in jdk8 compatibility, so you should be able to explore and edit JVMs of JDK8
- added support for nested classes (for Fernflower and CFR only now)
- added jasm disassembler
- added jcoder disassembler
- added CFR (best, but slowest) decompiler. Recomended for usage with direct back-compilation
- manpage is generate dout of the box via
org.jrd.backend.data.Help
- inital implementation of back compilation into running JVM without local classpath (deps are pulled from running vm)
- added connection to classpath-less compiler, but its implementation is not yet done
- jasm and jcoder can assemble again the dissasembled code
- enhanced direct upload of modified classes into runing VM
- jasm/jcoder one click assembly + upload
- all generic decompiled java classes are compiled onthe fly by runtime classpath and uploaded by one click
- enhanced CLI
- classes can now be processed in bulks, and are supported regexes
- added hexview
- modified bytes can be attempted to be directly forced to jvm
- added possibilities too export/import bytecode/decompiled code
- added support for filesystem "vm", including nested jars
- by this, this tool can serve as superpowerfull localhost/desktop decompiler/compiler dissasembler/assembler
- eg:
Decompile:
$ JAVA_HOME=/usr/lib/jvm/java-11-openjdk sh start.sh -decompile ~/git/jc/tool/target/tool-1.0.jar Cfr '.*' -saveas /tmp/jc -savelike dir
INFO: Decompiling class org/jc/Tool
INFO: ... done
Saved: /tmp/jc/org/jc/Tool.java
...
Saved: /tmp/jc/org/jc/impl/InMemoryJavaClassFileObject.java
INFO: Decompiling class org/jc/impl/InMemoryJavaSourceFileObject
INFO: ... done
Saved: /tmp/jc/org/jc/impl/InMemoryJavaSourceFileObject.java
Compile:
JAVA_HOME=/usr/lib/jvm/java-11-openjdk sh start.sh -compile -cp ~/git/classpathless-compiler/target/classpathless-compiler-1.0-SNAPSHOT.jar /tmp/jc/org/terminusbrut/classpathless/impl/DebugPrinter.java -savelike fqn -saveas .
Default runtime compiler will be used
Saved: ./org.terminusbrut.classpathless.impl.DebugPrinter.class
Upload:
JAVA_HOME=/usr/lib/jvm/java-11-openjdk sh start.sh -overwrite ~/git/classpathless-compiler/target/classpathless-compiler-1.0-SNAPSHOT.jar org.terminusbrut.classpathless.impl.DebugPrinter org.terminusbrut.classpathless.impl.DebugPrinter.class
WARNING:Class package do not match directories.
Most likely done successfully.
Disassemble:
$ JAVA_HOME=/usr/lib/jvm/java-11-openjdk sh start.sh -decompile ~/git/jc/tool/target/tool-1.0.jar jasm '.*' -saveas /tmp/jc -savelike dir
Note: /home/.../plugins/JasmDecompilerWrapper.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Saved: /tmp/jc/org/jc/Tool.java
Saved: /tmp/jc/org/jc/Tool$Arguments.java
...
Saved: /tmp/jc/org/jc/impl/InMemoryJavaClassFileObject.java
Saved: /tmp/jc/org/jc/impl/InMemoryJavaSourceFileObject.java
Assemble:
$ JAVA_HOME=/usr/lib/jvm/java-11-openjdk sh start.sh -compile -p jasm /tmp/jc -r -saveas /tmp/bin
Note: /home/.../plugins/JasmDecompilerWrapper.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
jasm plugin is delivered with its own compiler!!
jasm compiler caled with input of: 16
...
Saved: /tmp/bin/org/jc/api/MessagesListener.class
Saved: /tmp/bin/org/jc/impl/Compiler$1.class
Saved: /tmp/bin/org/jc/impl/InMemoryJavaSourceFileObject.class
Saved: /tmp/bin/org/jc/api/InMemoryCompiler.class
Dont forget that all operations are same over classapth, remote vm, or process of VM - runtime compiler/decompiler!
Known bugs:
- when used in CLI, with stdout/in not all compilers/decompilers are able to log to stderr, and so stdout, can be poluted. We are working on it. If you enconter it, let us know the combination, and use -saveas + -savelike in meantime
- Inner classes, and generally back-compilation is heavily decompiler dependant. Use patiently, and fix the decompiled code on your own Usually Crf does best. But Inner classes have best handling in Fernflower. And Procyon can decompile also invalid code...