frames: JDK hierarchy fallback, array-operand rewrite, aaload fixes; LoVisual 131 to 0 FAIL
This commit is contained in:
parent
1c417f596c
commit
63630dd223
14 changed files with 562 additions and 116 deletions
34
crates/noxis-analysis/src/JdkHierarchy.java
Normal file
34
crates/noxis-analysis/src/JdkHierarchy.java
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* Answers superclass queries from the obfuscator's frame analysis.
|
||||
*
|
||||
* <p>Protocol: one internal class name per line on stdin
|
||||
* ({@code java/io/BufferedReader}); one line back on stdout - the direct
|
||||
* superclass as an internal name, or an empty line when unknown
|
||||
* (missing dependency, interface, primitive, array). A single process
|
||||
* serves the whole analysis run; EOF on stdin ends it.
|
||||
*/
|
||||
public class JdkHierarchy {
|
||||
public static void main(String[] args) {
|
||||
Scanner in = new Scanner(System.in);
|
||||
while (in.hasNextLine()) {
|
||||
String name = in.nextLine().trim().replace('/', '.');
|
||||
String sup = "";
|
||||
if (!name.isEmpty()) {
|
||||
try {
|
||||
Class<?> loaded =
|
||||
Class.forName(name, false, JdkHierarchy.class.getClassLoader());
|
||||
Class<?> parent = loaded.getSuperclass();
|
||||
if (parent != null) {
|
||||
sup = parent.getName().replace('.', '/');
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
// Unknown: not on the JDK classpath, an interface with
|
||||
// no superclass, a primitive or an array - empty line.
|
||||
}
|
||||
}
|
||||
System.out.println(sup);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue