Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to crash a java decompiler with specific java code? [closed]

As the title says, with only using Java code, so no bytecode, is it possible to crash most of the general java decompilers, let's say the ones you find by googling "java decompiler"?

I am aware that this will not stop people from building a specific decompiler that gets around the issue, but it will surely keep people away from simply decompiling files.

I was thinking along the lines of the following silly piece of code which I hope to never meet in production:

final public class X {
    //... interesting stuff

    @Override
    public String toString() {
        return toString();
    }
}

This could be a possible counter measure against people wanting to print out your object, as an example.

like image 278
skiwi Avatar asked Jun 29 '26 02:06

skiwi


1 Answers

It depends on the implementation. It might crash if they don't recognize the latest byte code instructions, and it might crash if they can't figure out what to decompile your byte code instructions to. However in my experience when decompilers cannot figure out what to decompile the byte code to they will simply dump the byte code that they can't figure out within the rest of the Java source code they have already decompiled. A suggestion to attempt to see this is to decompile programs written originally in another JVM language like Scala or Clojure.

like image 106
NESPowerGlove Avatar answered Jun 30 '26 16:06

NESPowerGlove