Fixed variable/method names with / in them

This commit is contained in:
SuspiciousActivity committed 2018-11-23 14:32:39 +01:00
1 parent 89f9753d8b
commit 30c6a7a69d
2 files changed
+13 -12

No files matched your search

+4 -5
View File
@@ -323,7 +323,6 @@ public class Assembler {
.add(new TryCatchBlockNode(_start, _end, _handler, sp[0].equals("null") ? null : UnicodeUtils.unescape(sp[0])));
}
clazz.methods.add(node);
// signature = null;
} else if (!s.startsWith("\t")) {
s = s.substring(0, s.length() - 2);
if (s.contains(" throws ")) {
@@ -460,7 +459,7 @@ public class Assembler {
} else if (!rofl.startsWith("(")) {
int index = rofl.indexOf(";");
list.add(new String[] { rofl.substring(0, index) + ";", rofl.substring(index).substring(2) });
} else { // other type with casting
} else {
list.add(ClassUtil.getCastedValue(rofl.split(" ")[1], rofl.split("\\) ")[0].substring(1)));
}
}
@@ -473,7 +472,7 @@ public class Assembler {
} else if (!value.startsWith("(")) {
int index = value.indexOf(";");
node.values.add(new String[] { value.substring(0, index) + ";", value.substring(index).substring(2) });
} else { // other type with casting
} else {
node.values.add(ClassUtil.getCastedValue(value.split(" ")[1], value.split("\\) ")[0].substring(1)));
}
}
@@ -575,7 +574,7 @@ public class Assembler {
for (String asd : l.split(", ")) {
if (!asd.startsWith("(")) {
arr.add(UnicodeUtils.unescape(asd));
} else { // other type with casting
} else {
if (asd.startsWith("(label) ")) {
int labelNr = Integer.parseInt(asd.split(" ")[1]);
boolean found = false;
@@ -614,7 +613,7 @@ public class Assembler {
for (String asd : st.split(", ")) {
if (!asd.startsWith("(")) {
arr.add(UnicodeUtils.unescape(asd));
} else { // other type with casting
} else {
if (asd.startsWith("(label) ")) {
int labelNr = Integer.parseInt(asd.split(" ")[1]);
boolean found = false;
+9 -7
View File
@@ -371,7 +371,7 @@ public class Disassembler {
case "FieldInsnNode": {
FieldInsnNode node = (FieldInsnNode) n;
return "\t\t" + OpcodesReverse.reverseOpcode(node.getOpcode()) + " " + UnicodeUtils.escapeWithSpaces(node.desc) + " "
+ UnicodeUtils.escapeWithSpaces(node.owner) + "/" + UnicodeUtils.escapeWithSpaces(node.name) + "\n";
+ UnicodeUtils.escapeWithSpaces(node.owner) + "/" + UnicodeUtils.escapeWithSpaces(node.name).replace("/", "\\u002F") + "\n";
}
case "LabelNode": {
LabelNode node = (LabelNode) n;
@@ -428,8 +428,9 @@ public class Disassembler {
}
case "InvokeDynamicInsnNode": {
InvokeDynamicInsnNode node = (InvokeDynamicInsnNode) n;
String s = "\t\t" + OpcodesReverse.reverseOpcode(node.getOpcode()) + " [\n\t\t\tname: " + UnicodeUtils.escapeWithSpaces(node.name)
+ "\n\t\t\tdesc: " + UnicodeUtils.escapeWithSpaces(node.desc) + "\n\t\t\tHandle: [\n\t\t\t\tname: "
String s = "\t\t" + OpcodesReverse.reverseOpcode(node.getOpcode()) + " [\n\t\t\tname: "
+ UnicodeUtils.escapeWithSpaces(node.name).replace("/", "\\u002F") + "\n\t\t\tdesc: "
+ UnicodeUtils.escapeWithSpaces(node.desc) + "\n\t\t\tHandle: [\n\t\t\t\tname: "
+ UnicodeUtils.escapeWithSpaces(node.bsm.getName()) + "\n\t\t\t\towner: " + UnicodeUtils.escapeWithSpaces(node.bsm.getOwner())
+ "\n\t\t\t\tdesc: " + UnicodeUtils.escapeWithSpaces(node.bsm.getDesc()) + "\n\t\t\t\tisInterface: " + node.bsm.isInterface()
+ "\n\t\t\t\ttag: " + node.bsm.getTag() + "\n\t\t\t]\n\t\t\targs: [\n";
@@ -455,9 +456,10 @@ public class Disassembler {
s += "\n\t\t\t\t]\n";
} else if (l.getClass().getName().equals("org.objectweb.asm.Handle")) {
Handle h = (Handle) l;
s += "\t\t\t\tHandle: [\n\t\t\t\t\tname: " + UnicodeUtils.escapeWithSpaces(h.getName()) + "\n\t\t\t\t\towner: "
+ UnicodeUtils.escapeWithSpaces(h.getOwner()) + "\n\t\t\t\t\tdesc: " + UnicodeUtils.escapeWithSpaces(h.getDesc())
+ "\n\t\t\t\t\tisInterface: " + h.isInterface() + "\n\t\t\t\t\ttag: " + h.getTag();
s += "\t\t\t\tHandle: [\n\t\t\t\t\tname: " + UnicodeUtils.escapeWithSpaces(h.getName()).replace("/", "\\u002F")
+ "\n\t\t\t\t\towner: " + UnicodeUtils.escapeWithSpaces(h.getOwner()) + "\n\t\t\t\t\tdesc: "
+ UnicodeUtils.escapeWithSpaces(h.getDesc()) + "\n\t\t\t\t\tisInterface: " + h.isInterface() + "\n\t\t\t\t\ttag: "
+ h.getTag();
s += "\n\t\t\t\t]\n";
} else {
s += "\t\t\t\t" + ClassUtil.getDecompiledValue(l, "") + "\n";
@@ -469,7 +471,7 @@ public class Disassembler {
case "MethodInsnNode": {
MethodInsnNode node = (MethodInsnNode) n;
return "\t\t" + OpcodesReverse.reverseOpcode(node.getOpcode()) + " " + UnicodeUtils.escapeWithSpaces(node.desc) + " "
+ UnicodeUtils.escapeWithSpaces(node.owner) + "/" + UnicodeUtils.escapeWithSpaces(node.name) + "\n";
+ UnicodeUtils.escapeWithSpaces(node.owner) + "/" + UnicodeUtils.escapeWithSpaces(node.name).replace("/", "\\u002F") + "\n";
}
case "TypeInsnNode": {
TypeInsnNode node = (TypeInsnNode) n;