Skip to content

henryhchchc/mokapot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

MokaPot

GitHub Repository CI - GitHub Actions Codecov Crates.io docs.rs Contributor Covenant Ask DeepWiki

Overview

MokaPot is a Rust library for working with JVM bytecode. You can use it to parse, inspect, and change 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.

Building

Requirements:

  • Rust (latest stable)
  • JDK (latest release, for compiling Java source files as test data)

To build and test:

cargo build --all-features
cargo test --all-features

Contributing

See docs/CONTRIBUTING.md for how to contribute.

License

MIT License. See LICENSE for details.

About

A library for analyzing and manipulating JVM bytecode

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors 5