GithubHelp home page GithubHelp logo

Comments (4)

fjh658 avatar fjh658 commented on September 25, 2024

jd-gui 0.3.5 Although there is no normal static block decompile, but static block content is there. 1.0 static Block contents are not

image

from jd-gui.

emmanue1 avatar emmanue1 commented on September 25, 2024

You report two different bugs:

  • JD-Core failed to decompile your class. I keep your file for a futur analysis, but it's not the good place to report it.
  • A static block appears in the tree but decompiled source code does not display a such block. Javac creates a synthetic static block in the CLASS files to store instructions needed to initialize fields. JD-Core rebuilds the field initializations. At the end of the process, the static block may be empty, so it is not displayed. JD-GUI do not a such advanced analysis : it just uses ASM to retrieve fields and methods. A fixe has added to JD-GUI : if you click on a treenode of a static block, and if the source does not contain a such bloc, the class name will be highlighted, instead.

from jd-gui.

SetoKaiba avatar SetoKaiba commented on September 25, 2024

I encounter similar bug @emmanue1 .
I use the latest 1.4.0 jd-gui. The static initializer block is missing.
The block contains the obfuscated string encryption code. But it is missing in the 1.4.0 jd-gui.

from jd-gui.

SetoKaiba avatar SetoKaiba commented on September 25, 2024

`static {

    final String[] z = new String[2];

    final int n = 0;

    final char[] charArray = "\u001c-\u000042".toCharArray();

    int length;

    int n3;

    final int n2 = n3 = (length = charArray.length);

    int n4 = 0;

    while (true) {

        Label_0096: {

            if (n2 > 1) {

                break Label_0096;

            }

            length = (n3 = n4);

            do {

                final char c = charArray[n3];

                char c2 = '\0';

                switch (n4 % 5) {

                    case 0: {

                        c2 = '-';

                        break;

                    }

                    case 1: {

                        c2 = '\u001d';

                        break;

                    }

                    case 2: {

                        c2 = '0';

                        break;

                    }

                    case 3: {

                        c2 = '\u0004';

                        break;

                    }

                    default: {

                        c2 = '\u0003';

                        break;

                    }

                }

                charArray[length] = (char)(c ^ c2);

                ++n4;

            } while (n2 == 0);

        }

        if (n2 > n4) {

            continue;

        }

        break;

    }

    z[n] = new String(charArray).intern();

    final int n5 = 1;

    final char[] charArray2 = "I+\u0003a0N+\u0007a5O|Tfg\u001e%Q7;Lx\u000401\u0014$\b3aH.".toCharArray();

    int length2;

    int n7;

    final int n6 = n7 = (length2 = charArray2.length);

    int n8 = 0;

    while (true) {

        Label_0212: {

            if (n6 > 1) {

                break Label_0212;

            }

            length2 = (n7 = n8);

            do {

                final char c3 = charArray2[n7];

                char c4 = '\0';

                switch (n8 % 5) {

                    case 0: {

                        c4 = '-';

                        break;

                    }

                    case 1: {

                        c4 = '\u001d';

                        break;

                    }

                    case 2: {

                        c4 = '0';

                        break;

                    }

                    case 3: {

                        c4 = '\u0004';

                        break;

                    }

                    default: {

                        c4 = '\u0003';

                        break;

                    }

                }

                charArray2[length2] = (char)(c3 ^ c4);

                ++n8;

            } while (n6 == 0);

        }

        if (n6 <= n8) {

            z[n5] = new String(charArray2).intern();

            c.z = z;

            a = new BigInteger(c.z[1], 16);

            b = new BigInteger(c.z[0], 16);

            return;

        }

        continue;

    }

}`

Here's the static initializer block for example. I think the decompiler should at least give me the code.

from jd-gui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.