19 releases (12 breaking)

0.14.0 Apr 13, 2024
0.13.0 Mar 21, 2024
0.12.0 Mar 8, 2024
0.8.0 Dec 18, 2023
0.6.0 Nov 14, 2023

#394 in Parser implementations

Download history 6/week @ 2024-01-27 281/week @ 2024-02-10 58/week @ 2024-02-17 199/week @ 2024-02-24 121/week @ 2024-03-02 111/week @ 2024-03-09 146/week @ 2024-03-16 15/week @ 2024-03-23 93/week @ 2024-03-30 19/week @ 2024-04-06

277 downloads per month

MIT license

375KB
9K SLoC

MokaPot

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

MokaPot is a Java bytecode analysis library written in Rust.

[!WARNING] API Stability: This project is in an early development stage and breaking changes can happen before v1.0.0. Documentations are incomplete, which will be added when the basic functionalities works. Using this project for production is currently NOT RECOMMENDED.

Documentation

The documentation of the released version is available at docs.rs. The documentation of the latest commit is available at github.io

Usage

Adding the dependency

Run the following command in the root directory of your project.

cargo add mokapot

Alternatively, to follow the latest commit version, run the following command instead. Before building your project, run cargo update to fetch the latest commit.

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

Parsing a class

use mokapot::jvm::class::Class;

fn parse_class() -> Result<Class, Box<dyn std::error::Error>> {
    let reader: std::io::Read = todo!("Some reader for the byte code");
    let class = Class::from_reader(reader)?;
    Ok(class)
}

MokaIR

MokaIR is an intermediate representation of JVM bytecode in mokapot. To learn more, please refer to docs/MokaIR.md

Building

Make sure you have the following tools installed:

  • The latest stable version of Rust
  • The latest release version of JDK

Compile the project and run the tests with the following command.

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

Contributing

Cool. Contributions are welcomed. See the contribution guide for more information.

Dependencies

~4MB
~79K SLoC