feat: add classinspector for looking inside class files interactively (using a debugger)
All checks were successful
Maven release / build (push) Successful in 2m0s

This commit is contained in:
Ashhhleyyy 2024-04-19 14:44:29 +01:00
parent bbbd60ce0a
commit ea60f37957
Signed by: ash
GPG key ID: 83B789081A0878FB

View file

@ -0,0 +1,24 @@
package dev.ashhhleyyy.bad;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
public class ClassInspector {
public static void main(String[] args) throws IOException {
if (args.length < 1) {
System.err.println("Usage: <class>");
System.exit(1);
}
String path = args[0];
byte[] data = Files.readAllBytes(Path.of(path));
ClassReader reader = new ClassReader(data);
ClassNode cls = new ClassNode(Opcodes.ASM9);
reader.accept(cls, 0);
System.out.println("Set breakpoint here.");
}
}