mirror of
https://github.com/SuspiciousActivity/ByteEdit.git
synced 2026-08-13 17:56:17 +00:00
Added supporter for JSR/RET and class signature
This commit is contained in:
1 parent
b98750bae9
commit
631778e95b
3 files changed
+22
-1
No files matched your search
@@ -61,7 +61,9 @@ public class Assembler {
|
|||||||
clazz.version = Integer.parseInt(s.substring(12));
|
clazz.version = Integer.parseInt(s.substring(12));
|
||||||
|
|
||||||
while ((s = read.readLine()).startsWith("// ")) {
|
while ((s = read.readLine()).startsWith("// ")) {
|
||||||
if (s.startsWith("// #OuterClass: ")) {
|
if (s.startsWith("// #Signature: ")) {
|
||||||
|
clazz.signature = s.substring(15).equals("null") ? null : s.substring(15);
|
||||||
|
} else if (s.startsWith("// #OuterClass: ")) {
|
||||||
clazz.outerClass = s.substring(16).equals("null") ? null : s.substring(16);
|
clazz.outerClass = s.substring(16).equals("null") ? null : s.substring(16);
|
||||||
} else if (s.equals("// #InnerClasses:")) {
|
} else if (s.equals("// #InnerClasses:")) {
|
||||||
clazz.innerClasses = new ArrayList<>();
|
clazz.innerClasses = new ArrayList<>();
|
||||||
@@ -1156,6 +1158,20 @@ public class Assembler {
|
|||||||
labels.put(l, labelNr);
|
labels.put(l, labelNr);
|
||||||
return new JumpInsnNode(167, new LabelNode(l));
|
return new JumpInsnNode(167, new LabelNode(l));
|
||||||
}
|
}
|
||||||
|
case "jsr": {
|
||||||
|
int labelNr = Integer.parseInt(s.split(" ")[1]);
|
||||||
|
for (Map.Entry<Label, Integer> entry : labels.entrySet()) {
|
||||||
|
if (entry.getValue() == labelNr) {
|
||||||
|
return new JumpInsnNode(167, new LabelNode(entry.getKey()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Label l = new Label();
|
||||||
|
labels.put(l, labelNr);
|
||||||
|
return new JumpInsnNode(168, new LabelNode(l));
|
||||||
|
}
|
||||||
|
case "ret": {
|
||||||
|
return new VarInsnNode(167, Integer.parseInt(s.split(" ")[1]));
|
||||||
|
}
|
||||||
case "tableswitch": {
|
case "tableswitch": {
|
||||||
String str = s.substring(14, s.length() - 2).replace("\t", "");
|
String str = s.substring(14, s.length() - 2).replace("\t", "");
|
||||||
String split2[] = str.split("\n");
|
String split2[] = str.split("\n");
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ public class Disassembler {
|
|||||||
s += "\n";
|
s += "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
s += "// #Signature: " + classNode.signature + "\n";
|
||||||
s += "// #Class v:" + classNode.version + "\n";
|
s += "// #Class v:" + classNode.version + "\n";
|
||||||
s += "// #OuterClass: " + classNode.outerClass + "\n";
|
s += "// #OuterClass: " + classNode.outerClass + "\n";
|
||||||
s += "// #InnerClasses:\n";
|
s += "// #InnerClasses:\n";
|
||||||
|
|||||||
@@ -256,6 +256,10 @@ public class OpcodesReverse {
|
|||||||
return "if_acmpne";
|
return "if_acmpne";
|
||||||
case 167:
|
case 167:
|
||||||
return "goto";
|
return "goto";
|
||||||
|
case 168:
|
||||||
|
return "jsr";
|
||||||
|
case 169:
|
||||||
|
return "ret";
|
||||||
case 170:
|
case 170:
|
||||||
return "tableswitch";
|
return "tableswitch";
|
||||||
case 171:
|
case 171:
|
||||||
|
|||||||
Reference in new issue
Block a user