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.