Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

x4e/classfile-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

71 Commits

Repository files navigation

classfile-rs

Speedy class file implementation for rust

This is a library for reading, manipulating, and writing class files.

Goals:

  • Simple, abstract AST
  • Stackmap frame generation
  • Resistant to malicious/malformed class files

The AST is designed to be more logical and intuitive to a Java developer than the official bytecode specification.

For example, iconst_0s are represented as ldc(0)s, invokestatic(...)s are represented as invoke(static, ...). Bytecode offsets are also transformed into labels. The constant pool is fully abstracted.

Todos:

  • Stackmap frame generation
  • Class writing (Feel free to contribute on these)

Speed

The library should take <1ms to read an averagely sized class file, but can take longer depending on the amount of control flow within the class (Label reading is not optimal at the moment).

Here is a benchmark:

Examples

Reading a class file

About

JVM classfile parser and writer for Rust

Topics

Resources

Readme

License

MIT license

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages