Skip to content

A JavaScript port of the javap class file introspection and disassembly tool.

License

MIT, GPL-2.0 licenses found

Licenses found

MIT
LICENSE
GPL-2.0
LICENSE-JAVAP
Notifications You must be signed in to change notification settings

run-slicer/javap

Repository files navigation

javap

A JavaScript port of the javap class file introspection and disassembly tool.

Based on this revision of the OpenJDK 21 source tree.

Example

const fs = require("fs");
const { disassemble } = require("./javap.js"); // get it from the dist/ directory or jsDelivr

const data = fs.readFileSync("./your/package/HelloWorld.class"); // read a class file
console.log(await disassemble("your/package/HelloWorld", {
    source: async (name) => {
        /* provide classes for analysis here, including the one you want to decompile */

        console.log(name); /* internal name, e.g. java/lang/Object */
        return name === "your/package/HelloWorld" ? data : null /* class not available */;
    },
    options: ["-v"], // options as passed into the javap CLI
}));

Or see the browser-based proof-of-concept in the docs directory.

Licensing

The supporting code for this project is licensed under the MIT License (supporting code. The javap tool is licensed under the GNU General Public License, Version 2 with Classpath exception.

This project is not affiliated with, maintained or endorsed by the OpenJDK project in any way. Do NOT report issues with this project to the OpenJDK issue trackers.

About

A JavaScript port of the javap class file introspection and disassembly tool.

Resources

License

MIT, GPL-2.0 licenses found

Licenses found

MIT
LICENSE
GPL-2.0
LICENSE-JAVAP

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages