feat: add classinspector for looking inside class files interactively (using a debugger)
All checks were successful
Maven release / build (push) Successful in 2m0s
All checks were successful
Maven release / build (push) Successful in 2m0s
This commit is contained in:
parent
bbbd60ce0a
commit
ea60f37957
1 changed files with 24 additions and 0 deletions
24
src/main/java/dev/ashhhleyyy/bad/ClassInspector.java
Normal file
24
src/main/java/dev/ashhhleyyy/bad/ClassInspector.java
Normal 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.");
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue