Java's anti-compiler

Source: Internet
Author: User

Basic knowledge:

What is the anti-compiler

As we all know, the process of converting source code to binary execution code is called "compiling", such as compiling C source code into EXE executable file, then the process of binary code execution is called "anti-compilation", such as converting EXE to C source code is called "Anti-compilation".

Since the mainstream C compiler has been optimized for code, it is very difficult to decompile the exe file generated by c compilation into C code. But the virtual machine technology-based programming language like Java,. NET is very easy to decompile, the Java platform has jad, Jode, JD and other anti-compilers, the. NET platform has reflector and other anti-compiler, anti-compilation quality is very high, even with the source code almost no difference.

is the source code available for decompile?

The resulting code is very close to the source code, but somewhat different from the source code, for example, some expressions are optimized, such as:

The following source code:

int i=1+1;

Students who have learned the principles of compiling know that there is a "constant optimization" of the compilation optimization algorithm, so the above source code will generally be optimized to: int i=2;

Since the compilation process has been optimized to the "+" This raw information is discarded, so the decompile code can only be:

int i=2;

You can see that the anti-compilation code and the source code are different.

For example: in Andriod

Download = (Button) Findviewbyid (R.id.xiaz);

is optimized to download = (Button) Findviewbyid (0x7f070018);

Is it not safe for programs to decompile?

You can use techniques such as code obfuscation to increase the difficulty of anti-compilation and reduce the readability of anti-compilation code, but it is not possible to completely avoid anti-compilation.

What is the principle of the anti-compiler?

Because the Java,. NET-based language of virtual machine technology is a bytecode binary structure, it is easy to convert bytecode to "abstract syntax Tree" (AST, "compilation Principle" in the course of the concept), You can then convert the AST to code with the anti-compiler.

The Java anti-compiler JDJD is divided into Jd-gui, jd-eclipse two run mode, Jd-gui is run in a separate program, Jd-eclipse is run as an Eclipse plug-in. Id-intellij is a plug-in for the IDE.
Jd-gui has a long history, and it takes a long time, but there are always some class files that show INTERNAL ERROR, so here are a couple of other Java anti-compilers.






Java anti-compiler luyten (Luito)

A GitHub project that currently supports the. exe,. jar, and source code downloads, or full consideration of Windows users, JD displays internal error class file that can be opened by the author, and set to be richer than JD,

It's a personal preference. There is a small bug that the right-click window cannot be closed all, JD is OK. Tip: This is a MAVEN project that requires MAVEN to install if it is installed with the source code.

Https://github.com/deathmarine/Luyten

Open the connection and click Download to go to the download page


Java anti-compiler JADX

It is also a project on GitHub that currently supports. zip and. gz downloads, and Windows users need to run a batch file that is described on this project's home page.

This is not a MAVEN project and does not require MAVEN to be installed. apache2.0 license, you can post or join this GIT project again.

Https://github.com/skylot/jadx

Open the connection and click Download to go to the download page




Java's anti-compiler

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.