Skip to content

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: Throughput benchmark

Examples

Reading a class file

About

JVM classfile parser and writer for Rust

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 3

  •  
  •  
  •  

Languages