All Projects → Col-E → Bytecode-Modification-Framework

Col-E / Bytecode-Modification-Framework

Licence: MIT license
A bytecode modification library

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Bytecode-Modification-Framework

Recaf
The modern Java bytecode editor
Stars: ✭ 3,374 (+15236.36%)
Mutual labels:  jvm-bytecode, bytecode-engineering
LinkAgent
LinkAgent is a Java-based open-source agent designed to collect data and control Functions for Java applications through JVM bytecode, without modifying applications codes.
Stars: ✭ 105 (+377.27%)
Mutual labels:  jvm-bytecode
proguard-core
Library to read, write, analyze, and process java bytecode
Stars: ✭ 215 (+877.27%)
Mutual labels:  jvm-bytecode
jvm.js
A Java VM bytecode library written in ES6 for Node.js
Stars: ✭ 33 (+50%)
Mutual labels:  jvm-bytecode

Bytecode Modification Framework

BMF is an alternative JVM bytecode modification framework that (if desired) will hide nothing about the class structure behind abstraction (But in the future abstraction will certainly be an option).

Notable Features

  • Simplified renaming of classes, fields, and methods
  • Direct access to the constant pool.

Example: Renaming classes and members

Renaming classes and their members is designed currently to function given a jar file.

Here is an example for renaming a single class and one of its methods.

JarReader read = new JarReader(new File(IN_FILE), true, true);
read.getMapping().getMapping("com/example/game/Edible").name.setValue("com/example/game/Consumable");
read.getMapping().getMapping("com/example/game/Edible").getMemberMapping("isRotten", "()Z").name.setValue("hasDecayed");
read.saveTo(new File(OUT_FILE));

To rename each item takes only a single line of code. The affects of this change are instantaneous across the program since all class names link to a single instance.

What needs finishing

This library is still a heavy WIP and the main focus is remapping classes, so some basic functionality not-pertaining to remapping still needs to be completed. For example there is no way to edit instructions in a method.

Credits

Matthew Dupraz

  • Wrote the original Readme
  • Box class + beginnings of the remapping system
  • Large portion of the Type classes
  • Squashing several bugs
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].