Java bytecode edit tool set

Source: Internet
Author: User

There are 2 tool set combinations for Java bytecode editing.

1. ASM + Jasmin
First use ASM to disassemble the bytecode class file to assemble file. (See command line under ASM folder)
Then use Jasmin language specification to rewrite this class file and then compile this class file. (See command line under Jasmin folder)
Specification: http://jasmin.sourceforge.net/instructions.html
Advantage:
These 2 tools are very Update-to-date, less risk for class file format compatibility.
Disadvantage:
We'll have a lot of work to do for using these 2 tools.

2. Java byteedit for our Manipulation: (jbe editor)
Just run jbe. BAT in jbe folder and use the GUI to do that.
Jbe. bat
Advantage:
Easy to use, quick for test.
Disadvantage:
Not very Update-to-date, we may have a risk for class file format compatibility issue.

Bytes ----------------------------------------------------------------------------------------------------------------

Tool download URL and their encryption enation URL:

ASM: http://asm.ow2.org

Jasmin: http://jasmin.sourceforge.net/

Jbe: http://jbe.sourceforge.net/

 

Bytes ----------------------------------------------------------------------------------------------------------------

Simple introduction for each tool listed as abve:

ASM:

-------------------

1. feature description :( from Java class file to bytecode assembly language)
Java-classpath "ASM. jar; asm-util.jar; yourjar. Jar" org. objectweb. ASM. util. traceclassvisitor org. domain. Package. yourclass
Or
Java-classpath "ASM. jar; asm-util.jar" org. objectweb. ASM. util. traceclassvisitor ORG/domain/package/yourclass. Class

Total example:
Set CP = "E:/resource/ASM/asm3.3lib/asm-3.3.jar; E:/resource/ASM/asm3.3lib/asm-util-3.3.jar"
Set CP = % CP %; "E:/resource/test"
Java-classpath % CP % org. objectweb. ASM. util. traceclassvisitor helloworld> helloworld. ASM

2. You cocould get more on this project by looking into the following URL:
Http://asm.ow2.org/doc/tutorial-asm-2.0.html

Bytes -----------------------------------------------------------------------------------------------------------------

Jasmin:

1. Usage: (from disasessmbly language to Java bytecode)
Include the jar files under the lib directory and then run the following command line:
Java-jar Jasmin. Jar examples/helloworld. J [windows]
Or
Java-jar Jasmin. Jar examples/helloworld. J [UNIX/MacOSX]

2. You cocould get more on this project by looking into the following URL:
Http://en.wikipedia.org/wiki/Jasmin_ (java_assembler) # invoking
Http://jasmin.sourceforge.net/

Bytes -----------------------------------------------------------------------------------------------------------------

Jbe:
1. Usage: (Change Java bytecode in disassemble mode directly)
Just run jbe. BAT in jbe folder and use the GUI to do that.

2. If you want to know more about jbe, please take a look of the following site:
Http://jbe.sourceforge.net/

Bytes ------------------------------------------------------------------------------------------------------------------

 

Actually we can use ASM to manipulate the Java Assemble Code directly with some self-coding, here based on our experience, I wocould like to say, jbe is the best tool for us to use.

 

 

 

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.