Parsing the class files with JVM bytecode into the instruction list in JSON format
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.
-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 thepackages
relative to the parent of specified directory; and usages map (repo - usage packages) will be written to theusages
relative to the parent of specified directory.
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