fernflower | Unofficial mirror of FernFlower Java decompiler | Reverse Engineering library
kandi X-RAY | fernflower Summary
kandi X-RAY | fernflower Summary
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.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Convert a class to a Java class
- Convert a lambda declaration to Java code
- Get the mapping between a line number and an unmapped line number
- Add a tracer for a method
- Simplifies a switch on a switch statement
- Searches the case values for a case
- Evaluates a mapping of case labels to a mapping of case labels
- Return a string representation of this block
- Get the exception range
- Serialize the array
- Finds a method in the classpath
- Returns true if the statement is a choice statement
- Check the expression bounds of the expression
- Returns a string representation of this exception
- Main entry point
- Converts an expression into a text buffer
- Retrieves the default map of default values
- Checks if the given list of statements contains any exceptions
- Initializes the destination instruction
- Transform a list of expressions into a text buffer
- Convert a JMP statement into a text buffer
- Attempt to guess the type of the given integer
- Recursively visits the tree
- Generates the bytecode for the assert statement
- Copies an entry from source archive to the given source archive
- Build the basic blocks from the given instruction sequence
fernflower Key Features
fernflower Examples and Code Snippets
Community Discussions
Trending Discussions on fernflower
QUESTION
I am decompiling java application, and i have already done with 99% .class files. But, I have a problem with couple of them: error while decompilation (errors are same type). Example:
Procyon: java.lang.IllegalArgumentException: Argument 'index' must be in the range [0, 63], but value was: 15873...
CFR:
...ANSWER
Answered 2022-Feb-25 at 12:29There is nothing wrong with all decompilers i have mentioned before.
It was a constant_pool_count issue. It happened because of some JPHP decompiler offset troubles. So, if you are trying to reverse jphp applications, use your own software to delim .phb to .class blocks with couple of bytes before each of them
QUESTION
I am trying to create a custom Minecraft client but first I need to decompile the source files with MCP but it fails. It fails with a JavaOutOfMemoryError
. Here is the error:
ANSWER
Answered 2021-Dec-06 at 05:49Go to conf/mcp.cfg
. Find this line
QUESTION
I never did that before but yesterday I actually wanted to see what happens with Type Erasure - a lot of Books give Examples like this (this one is form OCP 11)
...ANSWER
Answered 2021-Nov-21 at 08:26The point that the book is trying to make, is that the runtime doesn't care about generic type parameters. It shows that this is the case by pedagogically "lying" to you that the class file does not contain any generic type variables or arguments, which is understandable, but also not true.
The class file does contain type variables and generic arguments used in field, method, and class declarations. You can even get them with reflection!
QUESTION
I am very new to Java
My claas is:
...ANSWER
Answered 2021-Nov-01 at 08:35ArrayList internally uses 'equals' method in 'contains' method to identify if the object is inside the ArrayList. So in this case, you need to override 'equals' with the logic you need (may be, in your case, comparing value in Menu Item). That should resolve this issue.
QUESTION
I've just noticed in a library module, that compileSdkVersion
and buildToolsVersion
had recently been deprecated. These are the two configurations, which it complains about (strikethrough text). This currently only affects com.android.library
, not com.android.application
:
ANSWER
Answered 2021-Sep-22 at 08:22It builds alike this (the library module needs to be changed):
QUESTION
Im trying to decompile the MCP v1.8.8 on mac but when I run the decompile.sh file I get this error:
...ANSWER
Answered 2021-Apr-13 at 14:07Turns out the decompiled code was in the src folder
Dragging the contents from that into the Client folder worked
I have no idea why it didn't decompile into the Eclipse folder
QUESTION
I was wondering, when exception occurs how try with resource statement manages to close resources before entering catch block.
When exception occurs execution immediately jumps to catch block. So where actually try-with-resource closes the resources.
To get better understanding of how it works I decided to see how compiler implements it. I wrote following code and and compiled it.
ANSWER
Answered 2021-Mar-30 at 13:53The behavior of try-with-resources is fully documented in the Java Language Specification, section 14.20.3. try-with-resources.
It specifically shows that the following abbreviated version of the question code:
QUESTION
Current situation & context
For a school assignment, we have to write our own programming language. Currently, I am stuck trying at the point of making a method call.
I can successfully make a method, but at the point where I am trying to call it, the program breaks.
Test code
The code that I am using to test is
...ANSWER
Answered 2020-Aug-10 at 14:02As explained by @apangin in the comments, you are trying to call an instance method, so you need an object to call it on, but you did not supply one. You need to create a test
instance and push it to the stack prior to calling testMethod
, or alternatively mark testMethod
as static and invoke it via invokestatic
, which is probably easier in this case.
That being said, I would also recommend using the Krakatau assembler rather than Jasmin. Krakatau uses a slightly modified form of Jasmin's syntax which is simpler and less error prone. In particular, in Krakatau, the class name, method name, and method descriptor are separated by spaces, removing a lot of the confusion you had about where you need to put the slashes when calling a method. Krakatau also has other advantages like full support for the bytecode format including Java 14 features, as well as a round trip disassembler which greatly assists with troubleshooting bytecode related issues.
QUESTION
So I Downloaded mcp940 a few weeks ago and have been having massive problems, first when I tried using the newest version (1.12) it gave me an error:
C:\Program Files (x86)\Java\jdk1.8.0_251\bin\java" -jar runtime\bin\fernflower.jar -din=1 -rbr=1 -dgs=1 -asc=1 -rsy=1 -iec=1 -jvn=1 -log=TRACE "-e=jars\libraries\net/java/jinput\jinput\2.0.5\jinput-2.0.5.jar" "-e=jars\libraries\com/ibm/icu\icu4j-core-mojang\51.2\icu4j-core-mojang-51.2.jar" "-e=jars\libraries\org/apache/httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar" "-e=jars\libraries\org/apache/logging/log4j\log4j-api\2.8.1\log4j-api-2.8.1.jar" "-e=jars\libraries\org/apache/commons\commons-lang3\3.5\commons-lang3-3.5.jar" "-e=jars\libraries\net/java/dev/jna\jna\4.4.0\jna-4.4.0.jar" "-e=jars\libraries\org/lwjgl/lwjgl\lwjgl-platform\2.9.4-nightly-20150209\lwjgl-platform-2.9.4-nightly-20150209-natives-windows.jar" "-e=jars\libraries\com/paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar" "-e=jars\libraries\net/sf/jopt-simple\jopt-simple\5.0.3\jopt-simple-5.0.3.jar" "-e=jars\libraries\com/mojang\text2speech\1.10.3\text2speech-1.10.3.jar" "-e=jars\libraries\com/google/guava\guava\21.0\guava-21.0.jar" "-e=jars\libraries\oshi-project\oshi-core\1.1\oshi-core-1.1.jar" "-e=jars\libraries\org/apache/httpcomponents\httpclient\4.3.3\httpclient-4.3.3.jar" "-e=jars\libraries\org/apache/commons\commons-compress\1.8.1\commons-compress-1.8.1.jar" "-e=jars\libraries\com/mojang\text2speech\1.10.3\text2speech-1.10.3-natives-windows.jar" "-e=jars\libraries\it/unimi/dsi\fastutil\7.1.0\fastutil-7.1.0.jar" "-e=jars\libraries\net/java/dev/jna\platform\3.4.0\platform-3.4.0.jar" "-e=jars\libraries\com/paulscode\codecjorbis\20101023\codecjorbis-20101023.jar" "-e=jars\libraries\com/paulscode\soundsystem\20120107\soundsystem-20120107.jar" "-e=jars\libraries\com/paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar" "-e=jars\libraries\org/lwjgl/lwjgl\lwjgl_util\2.9.4-nightly-20150209\lwjgl_util-2.9.4-nightly-20150209.jar" "-e=jars\libraries\commons-codec\commons-codec\1.10\commons-codec-1.10.jar" "-e=jars\libraries\net/java/jutils\jutils\1.0.0\jutils-1.0.0.jar" "-e=jars\libraries\com/mojang\patchy\1.1\patchy-1.1.jar" "-e=jars\libraries\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar" "-e=jars\libraries\org/lwjgl/lwjgl\lwjgl\2.9.4-nightly-20150209\lwjgl-2.9.4-nightly-20150209.jar" "-e=jars\libraries\commons-io\commons-io\2.5\commons-io-2.5.jar" "-e=jars\libraries\com/mojang\realms\1.10.17\realms-1.10.17.jar" "-e=jars\libraries\com/mojang\authlib\1.5.25\authlib-1.5.25.jar" "-e=jars\libraries\com/google/code/gson\gson\2.8.0\gson-2.8.0.jar" "-e=jars\libraries\net/java/jinput\jinput-platform\2.0.5\jinput-platform-2.0.5-natives-windows.jar" "-e=jars\libraries\com/paulscode\codecwav\20101023\codecwav-20101023.jar" "-e=jars\libraries\org/apache/logging/log4j\log4j-core\2.8.1\log4j-core-2.8.1.jar" "-e=jars\libraries\io/netty\netty-all\4.1.9.Final\netty-all-4.1.9.Final.jar" temp/minecraft_ff_in.jar temp\src\minecraft' failed : 1
Decompile failed
I've been searching around and have had no luck, first I found someone saying I should add -Xmx2G
to the beginning of a string in mcp.cfg
Here it is before and after
CmdFernflower = %s -jar %s -din=1 -rbr=1 -dgs=1 -asc=1 -rsy=1 -iec=1 -jvn=1 -log=TRACE {extra} {indir} {outdir}
CmdFernflower = %s -Xmx2G -jar %s -din=1 -rbr=1 -dgs=1 -asc=1 -rsy=1 -iec=1 -jvn=1 -log=TRACE {extra} {indir} {outdir}
after I added that it gave me another error:
'"C:\Program Files (x86)\Java\jdk1.8.0_251\bin\java" -Xmx2G -jar runtime\bin\fernflower.jar -din=1 -rbr=1 -dgs=1 -asc=1 -rsy=1 -iec=1 -jvn=1 -log=TRACE "-e=jars\libraries\net/java/jinput\jinput\2.0.5\jinput-2.0.5.jar" "-e=jars\libraries\com/ibm/icu\icu4j-core-mojang\51.2\icu4j-core-mojang-51.2.jar" "-e=jars\libraries\org/apache/httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar" "-e=jars\libraries\org/apache/logging/log4j\log4j-api\2.8.1\log4j-api-2.8.1.jar" "-e=jars\libraries\org/apache/commons\commons-lang3\3.5\commons-lang3-3.5.jar" "-e=jars\libraries\net/java/dev/jna\jna\4.4.0\jna-4.4.0.jar" "-e=jars\libraries\org/lwjgl/lwjgl\lwjgl-platform\2.9.4-nightly-20150209\lwjgl-platform-2.9.4-nightly-20150209-natives-windows.jar" "-e=jars\libraries\com/paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar" "-e=jars\libraries\net/sf/jopt-simple\jopt-simple\5.0.3\jopt-simple-5.0.3.jar" "-e=jars\libraries\com/mojang\text2speech\1.10.3\text2speech-1.10.3.jar" "-e=jars\libraries\com/google/guava\guava\21.0\guava-21.0.jar" "-e=jars\libraries\oshi-project\oshi-core\1.1\oshi-core-1.1.jar" "-e=jars\libraries\org/apache/httpcomponents\httpclient\4.3.3\httpclient-4.3.3.jar" "-e=jars\libraries\org/apache/commons\commons-compress\1.8.1\commons-compress-1.8.1.jar" "-e=jars\libraries\com/mojang\text2speech\1.10.3\text2speech-1.10.3-natives-windows.jar" "-e=jars\libraries\it/unimi/dsi\fastutil\7.1.0\fastutil-7.1.0.jar" "-e=jars\libraries\net/java/dev/jna\platform\3.4.0\platform-3.4.0.jar" "-e=jars\libraries\com/paulscode\codecjorbis\20101023\codecjorbis-20101023.jar" "-e=jars\libraries\com/paulscode\soundsystem\20120107\soundsystem-20120107.jar" "-e=jars\libraries\com/paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar" "-e=jars\libraries\org/lwjgl/lwjgl\lwjgl_util\2.9.4-nightly-20150209\lwjgl_util-2.9.4-nightly-20150209.jar" "-e=jars\libraries\commons-codec\commons-codec\1.10\commons-codec-1.10.jar" "-e=jars\libraries\net/java/jutils\jutils\1.0.0\jutils-1.0.0.jar" "-e=jars\libraries\com/mojang\patchy\1.1\patchy-1.1.jar" "-e=jars\libraries\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar" "-e=jars\libraries\org/lwjgl/lwjgl\lwjgl\2.9.4-nightly-20150209\lwjgl-2.9.4-nightly-20150209.jar" "-e=jars\libraries\commons-io\commons-io\2.5\commons-io-2.5.jar" "-e=jars\libraries\com/mojang\realms\1.10.17\realms-1.10.17.jar" "-e=jars\libraries\com/mojang\authlib\1.5.25\authlib-1.5.25.jar" "-e=jars\libraries\com/google/code/gson\gson\2.8.0\gson-2.8.0.jar" "-e=jars\libraries\net/java/jinput\jinput-platform\2.0.5\jinput-platform-2.0.5-natives-windows.jar" "-e=jars\libraries\com/paulscode\codecwav\20101023\codecwav-20101023.jar" "-e=jars\libraries\org/apache/logging/log4j\log4j-core\2.8.1\log4j-core-2.8.1.jar" "-e=jars\libraries\io/netty\netty-all\4.1.9.Final\netty-all-4.1.9.Final.jar" temp/minecraft_ff_in.jar temp\src\minecraft' failed : 1
Decompile failed
It's very similar to the old error and not the same as the first error I got when adding -Xmx2G
Strangely enough, I don't get this error in 1.7.10 (mcp908) and can edit the game fine, I was also able to go in the Wayback machine and use 1.8 (mcp910?) can somebody please help?
Thanks, Arik
...ANSWER
Answered 2020-May-16 at 23:29The problem is apparent from the end of mcp.log:
QUESTION
I am trying to use Proguard to keep my private fields, but it won't work. I stole most of this from Proguard keep classmembers because that question is similar to what I'm asking, and also followed this link How to tell ProGuard to keep private fields without specifying each field
But it still doesn't work.
I want to make a library for another company and still keep my access level modifiers fields and methods.
Proguard:
...ANSWER
Answered 2020-May-06 at 20:21It seems like R8 is causing this issue and not Proguard
.
Go into gradle.properties
, and set android.enableR8=false
. Next time you build, it will use Proguard
.
R8 is Google's answer to Proguard and in the recent versions of The Android Gradle Plugin (3.4.0+) it defaults to R8's code shrinker/obfuscator. There are some pros and cons to using Google's version instead of Guardsquare's technology.
For more information, look at the documentation
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install fernflower
You can use fernflower like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the fernflower component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page