Script for extracting .classes

This commit is contained in:
VegOwOtenks 2024-11-02 09:53:43 +01:00
parent 3fd30b80b6
commit 53929b5dfe

17
scripts/ClassPath.java Normal file
View file

@ -0,0 +1,17 @@
import java.io.OutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.Class;
public class ClassPath {
public static void main(String args[]) throws FileNotFoundException, IOException, ClassNotFoundException {
String path = args[0];
String basename = path.replaceAll("\\w+\\.", "");
OutputStream o = new FileOutputStream(path.replace(".", "/") + ".class");
Class.forName(args[0]).getResourceAsStream(basename + ".class")
.transferTo(o);
System.out.println(path);
}
}