Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


Open Source Resources

*Open source Home
*Open source Books
*Open source Browser
*Open source Code
*Open source Community
*Open source CRM
*Open source Download
*Open source Hardware
*Open source HTML
*Open source Image
*Open source Java
*Open source Software
*Open source Voip
*Open source Jobs
*Open source E-mail
*Open source E-mail Server
*Open source Exchange
*Linux Open Source
*Open Source CMS
*Open Source Groupware
*Open Source e-commerce
*Open Source Frameworks
*Open Source PDF
*HTML Editor Open source
*Open Source Database
*Open Source DBMS
*Open Source FTP
*Open Source Reports
*Open Source Shopping Cart
*Open Source Calendar
*Open Source Ajax
*Open Source Blog
*Open Source Text Editor
*Open Source chat
*Open Source CD
*Open Source ERP
*Open Source Wiki
*Open Source Content Management
*Open Source Defination
*Open Source Directory
*Open Source Document management
*Open Source Forum
*Open Source Games
*Open Source Identity
*Open Source Java Database
*Open Source Knowlegement base software
*Open Source point of sales
*Open Source portals
*Open Source RFID
*Open Source Server
*Open Source Project
*Open Source C++
*Open Source Firewall
*Open Source Intelligence
*Open Source Accounting Software
*Open Source router
*Open Source SQL
*Open Source XML Editor
*Open Source PHP
*Open Source Templates
*Open Source content Management system
*Open Source Metaverse
*Open Source Outlook
*Open Source Web Templates
*Open Source Bug Tracking
*Open Source Game Engine
*Open Source GPS
*Open Source Intranet
*Open Source POS
*Open Source Proxy
*Open Source Sound
*Open Source Web Mail
*Open Source PIM
*Open Source Media Center
*Open Source Backup Software
*Microsoft Open Source
*Best Open Source Software
*Mac OS X Open Source
*Open Source Images
*Open Source Midi
*Open Source Victor
*Open Source Excel
*Open Source Movement
*Palm Open Source
*IBM Open Source
*Open Source Databases
*Open Source dreamweaver
*Open Source ISO
*Open Source MMORPG
*MIT Open Source
*Open Source DRM
*Open Source DVD Ripper
*Open Source Encryption
*Open Source JavaScript
*Open Source JMS
*Open Source Version control
*Open Source Web Page
*Open Source Download Manager
*Open Source IRC
*Open Source MP3 player
*Open Source Testing
*Open Source PVR
*MySql Open Source
*Developer open Source Library
*open Source Installer
*open Source Institute
*open source project management
*open source Accounting
*open source Antivirus
*open source Application Server
*open source Business Model
*open source Workflow engines in java
*Open Source JVM
*Open Source Billing Software
*Open Source for Business

Struts Resources
*Struts Books
*Struts Articles
*Struts Frameworks
*Struts IDE
*Struts Links
*Struts Presentations
*Struts Projects
*Struts Software
*Other Struts Tutorial
Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Have tutorials?
Add your tutorial to our Java Resource and get tons of hits.

We offer free hosting for your tutorials. and exposure for thousands of readers. drop a mail
[email protected]

Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

Open Source ByteCode Libraries written in Java

Open Source Home
  • BCEL - 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.

    Such objects can be read from an existing file, be transformed by a program (e.g. a class loader at run-time) and dumped to a file again. An even more interesting application is the creation of classes from scratch at run-time. The Byte Code Engineering Library (BCEL) may be also useful if you want to learn about the Java Virtual Machine (JVM) and the format of Java .class files.

    BCEL is already being used successfully in several projects such as compilers, optimizers, obsfuscators, code generators and analysis tools

  • cglib - cglib is a powerful, high performance and quality Code Generation Library, It is used to extend JAVA classes and implements interfaces at runtime. See samples and API documentation to learn more about features

  • Classfile Reader & Writer - This package makes it easy to read and write java classfiles. It does not, however, provide any help with displaying the contents of a classfile to the user (unless you count debug output), or disassembling the bytecodes.

    This code snippet will read in a classfile and write it back out to a different file.

    InputStream is = new FileInputStream(Foo.class);
    OutputStream os = new FileOutputStream(FooCopy.class);
    ClassInfo classInfo = new ClassInfo();
    new ClassFileReader().read(is, classInfo);
    classInfo.setName(FooCopy); // Java requires the class name to match the file name
    new ClassFileWriter().write(classInfo, os);
    Here is the API documentation.
    Here is the source (56K).
    Here is the VM Spec that I used.

    The package can read obfuscated classfiles, like those generated by Crema, but it can not write them. Obfuscated classfiles have invalid data in them and the only reason they work is because most VMs ignore the data that is invalid (attributes like SourceFile, LineNumberTable, and LocalVariableTable). If a ClassFileReader encounters invalid data, it just ignores it.

  • Cojen - Cojen primary goal is making raw Java classfile generation easy, without hiding any of the advanced features. Basic knowledge of how Java classfiles are structured is still required, however. The Virtual Machine Specification is an excellent reference.

    Method bytecode is constructed via a builder, in which virtual machine opcodes are represented as slightly higher level instructions. It takes care of selecting optimal opcodes, managing branch labels, computing operand stack depth, choosing local variable registers, and reducing register usage by liveness analysis. In addition, it supports long branches, pushing large string constants onto the stack, boxing and unboxing conversions, and inlining of Java code.

  • JBET - 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.

    JBET was developed as part of the DARPA Self-Protecting Mobile Agents project under the OASIS and Active Networks programs (contract number N66001-00-C-8602) in order to study automated software obfuscation. The Java language was chosen for this project because of the (relative) ease of constructing binary editing tools provided by the large amount of type information present in the class files. Our two reports, the Obfuscation Techniques Evaluation Report, and the Obfuscation Report, are available from the download area. The obfuscation tool developed is not part of this release.

  • JClassLib - jclasslib bytecode viewer is a tool that visualizes all aspects of compiled Java class files and the contained bytecode. In addition, it contains a library that enables developers to read, modify and write Java class files and bytecode.
  • Jiapi - When a Java virtual machine encounters a request for a class which has not been loaded to its memory, it consults a class loader to locate and load the class. Typically, the classes are loaded from a filesystem or URL as a bytecode array and then converted into an instance of class java.lang.Class within the virtual machine. Jiapi is a tool which can be used to alter this 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.
  • ObjectWeb ASM - 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 smaller (33KB 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.

  • Package gnu.bytecode - Contains classes to generate, read, write, and print Java bytecode (.class) files.

    It is used by Kawa to compile Scheme into bytecodes; it should be useful for other languages that need to be compiled into Java bytecodes. (An interesting exercise would be an interactive Java expression evaluator.) The classes here are relatively low-level. If you want to use them to generate bytecode from a high-level language, it is better to use the gnu.expr package, which works at the expression level, and handles all the code-generation for you.

  • SERP - Serp is an open source framework for manipulating Java bytecode. If you have a suggestion for functionality that you would like to see incorporated into serp, please feel free to send it to me. Bug reports are also greatly appreciated. And if you choose to incorporate serp into any of your projects, I would love to hear about it!

  • Trove Class File API - Trove is a library of useful classes that is used by Tea and the TeaServlet. Trove includes the Class File API, the Logging API and a set of utility classes.

    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.

Check More Open Source Software at Open Source Home
Ask programming questions?



Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

0 comments so far (post your own) View All Comments Latest 10 Comments:
Useful Links
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials


Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net

Send your comments, Suggestions or Queries regarding this site at [email protected]

Copyright 2007. All rights reserved.