Strange Output:

  • temp722

    temp722 - 2005-07-04

    After decompiling, I often get code that looks like this:

    (No, I don't have the source code)

    void method() {

    booleanVariable = false;
    int i = 0;
    IF (intVariable == 0)
           GOTO flow_23_386_
    GOTO flow_13_387_
        int i;
        intArray[i] = 0;
        GOTO flow_23_386_
        int i;
        IF (i < 128)
              GOTO flow_13_387_
        GOTO flow_30_388_


    What is going on here? How can I fix it?

    This almost looks like some kind of loop... with (i < 128) being the condition...

    The mutiple declarations of int i are very strange...

    • Jochen Hoenicke

      Jochen Hoenicke - 2005-07-05

      This looks like obfuscated code.  The code has a loop with two entries (_13_ and _23_), which cannot happen in code produced by javac. My guess is that intVariable is always 0 and so the second GOTO is never executed.  The test was inserted by some obfuscator to break decompilation.

      The algorithm to detect which variables are equal relies on reducible code, i.e. code without multiple-entry-loops.  This explains the double declaration of variables.

    • xKhAoZx

      xKhAoZx - 2005-07-08

      Me and tjem are working on decompiling this together.

      I have uploaded an example of one of the class files.

      Decompiled Java:

      Hopefully this will give a clearer view of the problem. How do we fix this?

    • Chris Snyder

      Chris Snyder - 2006-02-12

      Did you ever get a workaround?

    • xKhAoZx

      xKhAoZx - 2006-07-04

      tjem got started on a fix, but never finished it. However, he did accomplish it somewhat, meaning it is possible. However, this project is dead, and it probably wont ever get fixed.


Log in to post a comment.