Applying the Jd-eclipse plugin to implement the reverse compilation of. class files in RFT

Source: Internet
Author: User

Overview

Anti-compilation is the process of translating the target code into source code. The target code is a language-based code that can be executed directly from a real or virtual machine. The text of the Jd-eclipse is an anti-compilation of open source software, which is applied to the Eclipse development platform plug-in, it can help developers to display all the Java source code in the process of debugging the program, facilitate the development of developers work.

Back to top of page

Installation and configuration of Jd-eclipse

The high-level language source program is compiled into an executable file, and reverse compilation is its inverse process. However, due to the complexity of the reverse compilation, it is usually not possible to turn the executable into a high-level language source code, but only into assembler. This paper introduces how to apply Jd-eclipse plug-in to implement the reverse compilation of the. class file in Rft, this method is simple and practical, the use of Jd-eclipse plug-in to RFT, so that RFT has more aspects of the application, to facilitate the user's operation of the. class file, do not need to separate The work of direction-compiling with the reverse compiler.

When the C compiler compiles the target code that generates an object, the target code is generated for a particular hardware platform, and during compilation, the compiler converts all the symbols ' references to a specific amount of memory compilation by looking up the table. The target code can only run on a specific CPU. The Java compiler, in order to ensure the portability of the target code, does not compile references to variables and methods into numeric references, and does not determine memory layout during program execution, but retains these symbolic reference information in bytecode and creates a memory layout by the Java virtual machine during operation. It then determines the address of a method by checking the table. Because of its relatively simple bytecode format for Java virtual machines and specifications, the process of deserializing the Java bytecode into source code is simpler than the C language, so the current anti-compilation Java program is very popular.

There are many anti-compilation software for Java, the following article will introduce an open source anti-compilation software jd-eclipse. Jd-eclipse is a plug-in Eclipse platform. It allows you to debug all Java source code. In order to be able to explain the Jd-eclipse application method more detailed, the following mainly introduced the Jd-eclipse installation and the configuration process, so that the developer can use more quickly and conveniently.

There are currently two ways to install the Jd-eclipse plugin. The first is to use the "Install Update Software" option in RFT to install, the following article will mainly describe the installation method of manual installation.

1. Download the appropriate installation file: Jd.ide.eclipse_x.x.x.jar;jd.ide.eclipse.win32.x86_ X.x.x.jar;jd.edi.eclipse.feature_x.x.x.jar. The Jd-eclipse plugin provides the appropriate jar files for the Liunx,mac platform, which is described in the Windows platform as an example.

2. Copy the two jar files from the jd.ide.eclipse_x.x.x.jar;jd.ide.eclipse.win32.x86_ X.x.x.jar to the plugins path in the folder where the RFT is installed.

Figure 1. Copy the jar file into the plugins

3. Copy the Jd.edi.eclipse.feature_x.x.x.jar file to the features path in the folder where the RFT is installed.

Figure 2. Copy the jar file into the features

4. Restart RFT.

5. Open the Rft,windows->preferences->general->editors->file assciation and set the Class File Editor to default.

Figure 3. Set default display

For a class that has a primitive code, he does not forcibly decompile it, which means that he will view the class file with Eclipse's own class files viewer.

Back to top of page

The use of Jd-eclipse and related discussion

First, this section introduces the application method of Jd-eclipse, and then introduces the specific use method of Jd-eclipse through a concrete application example. The text adopts RFT as the development platform of Java, so jd-eclipse is a plug-in that is installed on RFT to discuss.

First, the application method of Jd-eclipse

The first thing you need to do is to make the anti-compilation file into a jar Java package.

For example, to javatest a file into a package, there are many. class files in the Javatest file.

Figure 4. The. class file in Java

The jar package generation method is shown in the following steps.

1. Import the appropriate project.

2. Select Flie->export->jar file.

Figure 5. Select the Jar file

3. Import the. class file and select the storage address.

Figure 6. Import Project

4. Generate a Javatest.jar file

Figure 7. Generate Jar File

Application examples of Jd-eclipse

The jar file needs to be built into the project file after the jar file is generated.

Figure 8 is the file content that was seen before the decompile. Developers cannot see the information in the. class file, which is a relatively complex issue for developers debugging code.

Figure 8. The. class file that was pre-compiled displays information

With the Jd-eclipse plug-in, you can clearly display the contents of the file, to facilitate the work of developers, but also enhance the developers in the use of RFT in the process of ease.

Listing 1. Partial code content as an example of "Captureplayback.class"
 Import Java.awt.BasicStroke;  Import Java.awt.BorderLayout;  Import Java.awt.Color;  Import java.awt.Component;  Import Java.awt.Container;  Import java.awt.Dimension;  Import Java.awt.Font;  Public Captureplayback () {super.setlayout (New BorderLayout ());  Emptyborder Localemptyborder = new Emptyborder (5, 5, 5, 5);  Softbevelborder Localsoftbevelborder = new Softbevelborder (1);  Super.setborder (New Emptyborder (5, 5, 5, 5));  JPanel LocalJPanel1 = new JPanel ();  Localjpanel1.setlayout (New BoxLayout (LocalJPanel1, 0));  Localjpanel1.add (This.formatcontrols);  JPanel LocalJPanel2 = new JPanel ();  Localjpanel2.setborder (Localsoftbevelborder);  JPanel localJPanel3 = new JPanel ();  Localjpanel3.setborder (New Emptyborder (10, 0, 5, 0));  This.playb = AddButton ("Play", LocalJPanel3, false);  THIS.CAPTB = AddButton ("Record", LocalJPanel3, True);  This.pausb = AddButton ("Pause", LocalJPanel3, false);  THIS.LOADB = AddButton ("Load ...", localJPanel3, True); Localjpanel2.add (LOCALJPANEL3); public class Playback implements runnable{Sourcedataline line;  Thread thread;  public void Start () {CapturePlayback.this.errStr = null;  This.thread = new Thread (this);  This.thread.setName ("Playback");  This.thread.start ();  } public void Stop () {this.thread = null; } private void ShutDown (String paramstring) {if ((CAPTUREPLAYBACK.THIS.ERRSTR = paramstring)! = null) {SYSTEM.ERR.PRI  Ntln (CAPTUREPLAYBACK.THIS.ERRSTR);  CapturePlayback.this.samplingGraph.repaint ();  } if (This.thread! = null) {this.thread = null;  CapturePlayback.this.samplingGraph.stop ();  CapturePlayback.this.captB.setEnabled (TRUE);  CapturePlayback.this.pausB.setEnabled (FALSE);  CapturePlayback.this.playB.setText ("Play"); }   }  }

Iii. introduction of Jd-gui

Jd-core also offers a standalone run software Jd-gui, which functions exactly like the Jd-eclipse plug-in, so it's not easy to use the Eclipse platform-based people to view the anti-compilation files.

Figure 9. Jd-gui operator Interface

Import the files that you want to decompile.

Figure 10. Import files that need to be deserialized

This standalone running software provides powerful editing capabilities, allowing developers to edit, process, and manipulate files.

Back to top of page

Summarize

This article introduces how to apply Jd-eclipse plug-in to implement the reverse compilation of the. class file in Rft, this method is simple and practical, the use of Jd-eclipse plug-in is applied to RFT, so that RFT has more applications, which facilitates the user's operation on. class files, and does not require The work of applying the reverse compiler for direction compilation alone. It is believed that Jd-eclipse can help developers provide more convenient plug-in applications based on RFT, providing a convenient way for developers to debug their programs.

Reference Learning
    • Refer to the Jd-eclipse Manual for more information about Jd-eclipse and Jd-gui.
    • Refer to Icujava Anti-compilation and source code protection for issues related to anti-compilation and code protection.
    • Refer to JAVA anti-compilation techniques and code security for a description of the issues related to anti-compilation techniques and code security.
    • Stay tuned for DeveloperWorks technical activities and webcasts.
    • Access the DeveloperWorks Open source zone for rich how-to information, tools and project updates, and the most popular articles and tutorials to help you develop with open source technology and use them with IBM products.
Discuss
    • Join DeveloperWorks Chinese community. View developer-driven blogs, forums, groups, and wikis, and communicate with other DeveloperWorks users.
    • Joining the DeveloperWorks Chinese community, the DeveloperWorks community is a professional social networking community for global IT professionals who can provide community functions such as blogs, bookmarks, wikis, groups, contacts, sharing, and collaboration.
    • Join the IBM software download and technology Exchange Group to participate in online communication.

Applying the Jd-eclipse plugin to implement the reverse compilation of. class files in RFT

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.