mokapot

Crates.iomokapot
lib.rsmokapot
version0.24.2
created_at2023-08-07 10:07:20.699475+00
updated_at2025-12-24 14:38:35.717955+00
descriptionA library for analyzing and manipulating JVM bytecode
homepage
repositoryhttps://github.com/henryhchchc/mokapot
max_upload_size
id937802
size651,383
Henry Chu (henryhchchc)

documentation

https://docs.rs/mokapot

README

MokaPot

Crates.io docs.rs

Overview

MokaPot is a Rust library for working with JVM bytecode. You can use it to parse, inspect, and analyze Java class files.

Main features:

  • Parse JVM bytecode
  • Work with an intermediate representation (MokaIR)
  • Build custom tools for JVM bytecode
  • Includes documentation and examples

Documentation

Installation

To add MokaPot to your project, run:

cargo add mokapot

To use the latest commit from GitHub:

cargo add --git https://github.com/henryhchchc/mokapot.git mokapot
cargo update

Usage

Parse a JVM class file

use mokapot::jvm::class::Class;
use std::fs::File;

fn parse_class_file(path: &str) -> Result<Class, Box<dyn std::error::Error>> {
    let mut file = File::open(path)?;
    let class = Class::from_reader(&mut file)?;
    Ok(class)
}

More Examples

See the examples directory for more code samples.

MokaIR

MokaIR is an intermediate representation of JVM bytecode in this library. See docs/MokaIR.md for details.

Contributing

See the project repository for contributing guidelines.

License

MIT License. See LICENSE for details.

Commit count: 780

cargo fmt