Jawa - JVM ClassFile Library¶
Jawa is a human-friendly library for assembling, disassembling, and exploring JVM class files. It’s highly suitable for automation tasks.
This documentation is up to date as of May 23, 2018.
Jawa is intended to be used very differently from most projects similar to it. Instead of trying to produce a human-readable disassembly or nearly-compilable Java, it’s intended for people that want to dive into or automate work on JVM bytecode. For example, Jawa has been used for:
- The automatic verification of community-uploaded plugins
- Analysis and analytics of public Android APKs (thousands at a time)
- Automatic extraction of “private” API keys embedded in Android APKs.
- Automated reverse engineering of the Minecraft server and client.
Jawa is permissively licenced under the MIT licence. You’re free to use it in any type of project should it be commercial, closed source or open source.
from jawa.classloader import ClassLoader loader = ClassLoader('minecraft_server.jar') for class_path in loader.classes: cf = loader[class_path]
Alternatively you can create & load a
from jawa.cf import ClassFile with open('HelloWorld.class') as file_in: cf = ClassFile(file_in)