Skip to content

Parsing and grouping the class files with JVM bytecode into the instruction list in JSON format

License

Notifications You must be signed in to change notification settings

petukhovv/bytecode-parser

Repository files navigation

bytecode-parser

Parsing the class files with JVM bytecode into the instruction list in JSON format

Program use

You can run bytecode-parser on the class files you are interested (generated by kotlinc, javac and other language compilers with JVM-bytecode target).

Program use Apache Commons BCEL (Byte Code Engineering Library) for parsing class files and extraction instruction list by methods.

Before parsing bytecode-parser extracts class files from jar (becouse you don't have to worry about jars unzip).

The program also allows grouping parsed files by packages.

Program arguments

  • -i or --input: path to folder with jar (if stage is parsing) or class (if stage is grouping) files;
  • --parsing: parsing stage: JSON files with JVM instruction list will be written to the same directory where the original class file is located;
  • --grouping: grouping stage: packages hierarchy with class files will be written to the packages relative to the parent of specified directory; and usages map (repo - usage packages) will be written to the usages relative to the parent of specified directory.

How to run

To run program you must run main function in main.kt, not forgetting to set the program arguments.

Also you can run jar file (you can download from the release assets):

java -jar ./bytecode-parser-0.1.jar -i ./assets --parsing

About

Parsing and grouping the class files with JVM bytecode into the instruction list in JSON format

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages