Open Source ByteCode Libraries in Java
|Javassist (Java programming assistant) is a load-time reflective system for Java. It is a class library for editing bytecodes in Java; it enables Java programs to define a new class at runtime and to modify a class file before the JVM loads it. Unlike other similar systems, Javassist provides source-level abstraction; programmers can modify a class file without detailed knowledge of the Java bytecode. They do not have to even write an inserted bytecode sequence; Javassist instead can compile a fragment of source text on line (for example, just a single statement). This ease of use is a unique feature of Javassit against other tools.
Go To Javassist
|The Byte Code Engineering Library is intended to give users a convenient possibility to analyze, create, and manipulate (binary) Java class files (those ending with .class). Classes are represented by objects which contain all the symbolic information of the given class: methods, fields and byte code instructions, in particular.
Go To BCEL
|ASM is a Java bytecode manipulation framework. It can be used to dynamically generate stub classes or other proxy classes, directly in binary form, or to dynamically modify classes at load time, i.e., just before they are loaded into the Java Virtual Machine.
ASM offers similar functionalities as BCEL or SERP, but is much more smaller (25KB instead of 350KB for BCEL and 150KB for SERP) and faster than these tools (the overhead of a load time class transformation is of the order of 60% with ASM, 700% or more with BCEL, and 1100% or more with SERP). Indeed ASM was designed to be used in a dynamic way* and was therefore designed and implemented to be as small and as fast as possible. ASM can of course be used in a static way too.
Go To ObjectWeb ASM
|The goal of the serp bytecode framework is to tap the full power of bytecode modification while lowering its associated costs. The framework provides a set of high-level APIs for manipulating all aspects of bytecode, from large-scale structures like class member fields to the individual instructions that comprise the code of methods. While in order to perform any advanced manipulation, some understanding of the class file format and especially of the JVM instruction set is necessary, the framework makes it as easy as possible to enter the world of bytecode development.
Go To SERP
|jclasslib bytecode is a viewer but it also contains a library that enables developers to read, modify and write Java class files and bytecode.
Go To JClassLib
|Contains classes to generate, read, write, and print Java bytecode (.class) files. Part of the Kawa project
Go To Package gnu.bytecode
|Dynamic Java bytecode generation and disassembly tools. A builder allows code to be generated more easily, instead of having to select exact instructions. Utility classes are provided which demonstrate the code generator and loader.
Cojen is a fork of the Trove class file API.
Go To Cojen
|The class file API simplifies creation of Java class files. Instead of having to write byte-code, the Class File API allows you to call high-level methods which generate the byte-code for you.
Development of the Trove class file API has ceased. Continued development is under the Cojen project.
Go To Trove Class File API
|Jiapi is a tool which can be used to alter the normal class loading behavior. Instead of letting the class to be loaded as it is, Jiapi is used to manipulate classes' bytecode. The manipulated class is then passed to a class loader which loads it into a Java virtual machine. In addition to just described just-in-time bytecode weaving, Jiapi can be used to instrument a class ahead-of-time. In this mode compiled classes are preprocessed by Jiapi instrumentors and modified classes are then serialized on a filesystem to be executed later
Go To Jiapi
|cglib is a powerful, high performance and quality Code Generation Library, It is used to extend JAVA classes and implements interfaces at runtime.
Go To cglib
|This package makes it easy to read and write java classfiles. It doesn't, however, provide any help with displaying the contents of a classfile to the user (unless you count debug output), or disassembling the bytecodes.
Go To Classfile Reader & Writer
|The Java Binary Enhancement Tool (JBET) is a general Java program analysis and manipulation tool. Existing class files can be disassembled, reassembled, or edited programmatically through the JBET API. JBET can also be used to create new Java class files from scratch. JBET uses a convenient internal representation of all the contents of Java binary (.class) files, allowing the user to edit the classes easily, in a structured manner.
Go To JBET
|Jen is a lightweight, high-level Java(tm) bytecode manipulation and generation library that permits Java classes to be modified in terms of 'rename this class', 'make a field public', and 'add a new constructor'.
Jen is based on ASM 2.1, and includes full support for J5 annotations and generics. An additional set of utilities is provided to facilitate working with generated classes at runtime (e.g. allowing definition of new classes in the system classloader and so on).
Go To Jen
|Soot is a Java optimization framework. It provides four intermediate representations for analyzing and transforming Java bytecode:
1. Baf: a streamlined representation of bytecode which is simple to manipulate.
2. Jimple: a typed 3-address intermediate representation suitable for optimization.
3. Shimple: an SSA variation of Jimple.
4. Grimp: an aggregated version of Jimple suitable for decompilation and code inspection.
Soot can be used as a stand alone tool to optimize or inspect class files, as well as a framework to develop optimizations or transformations on Java bytecode.
Go To Soot
|Jdec is a java decompiler which is written using java and swing.
It can be used to reverse the bytecodes present in a .class File to produce a Java Source File which can be nearly correct or equivalent (Due To different Interpretations) to the original java file. It also has a good UI.
It can decompiler entire jar also.
* Decompiling a java class
* Decompiling a jar file
* Selective Decompilation of a class file
* Decompiling 2 Versions
* Disassembling a java class
* Local variable information
* Exception Table Information
* Constant Pool Details
* Sketelon Display of Class File
Go To Jdec
|Reloader is a tool that enables class reloading while the JVM is still running. JReloader is a must-have tool for developers that need to change small pieces of code on-the-fly without the burden of restarting the application.
With JReloader it's even possible to reload classes with instances actively invoked by one or more threads. Current invocations will see the old code until they return. New invocations will always see the new code. Most of the time everything works fine. This all is made possible by JVMTI, an API available since Java 1.5.
Only changes in method bodies can be reloaded. Changes in class signature are not allowed.
Go To JReloader
|Retroweaver is a bytecode weaver that enables you to take advantage of the new Java 1.5 language features, while still retaining total binary compatability with 1.4 virtual machines. Retroweaver operates by transforming Java class files compiled by a 1.5 compiler into version 1.4 class files which can then be run on any 1.4 virtual machine.
Go To Retroweaver