mirror of
https://github.com/SuspiciousActivity/ByteEdit.git
synced 2026-08-13 17:56:17 +00:00
Fixed an undocumented access_flag bug
This commit is contained in:
1 parent
7b95716a5c
commit
4624d64f0f
2 files changed
+17
-6
No files matched your search
@@ -170,6 +170,9 @@ public class Assembler {
|
|||||||
|
|
||||||
if (split.length > 2) {
|
if (split.length > 2) {
|
||||||
String cons = consolidateStrings(split, 0, split.length - 2);
|
String cons = consolidateStrings(split, 0, split.length - 2);
|
||||||
|
if (cons.startsWith("0x")) {
|
||||||
|
access = Integer.parseInt(cons.substring(2), 16);
|
||||||
|
} else {
|
||||||
if (cons.contains("public")) {
|
if (cons.contains("public")) {
|
||||||
access ^= ClassUtil.ACC_PUBLIC;
|
access ^= ClassUtil.ACC_PUBLIC;
|
||||||
}
|
}
|
||||||
@@ -219,6 +222,7 @@ public class Assembler {
|
|||||||
access ^= ClassUtil.ACC_MANDATED;
|
access ^= ClassUtil.ACC_MANDATED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
FieldNode node = new FieldNode(access, name, desc, signature, value);
|
FieldNode node = new FieldNode(access, name, desc, signature, value);
|
||||||
if (!annotationsForNext.isEmpty()) {
|
if (!annotationsForNext.isEmpty()) {
|
||||||
if (node.visibleAnnotations == null) {
|
if (node.visibleAnnotations == null) {
|
||||||
@@ -1184,8 +1188,12 @@ public class Assembler {
|
|||||||
LinkedHashMap<Integer, LabelNode> labelMap = new LinkedHashMap<>();
|
LinkedHashMap<Integer, LabelNode> labelMap = new LinkedHashMap<>();
|
||||||
|
|
||||||
for (int i = 4; i < split2.length - 1; i++) {
|
for (int i = 4; i < split2.length - 1; i++) {
|
||||||
|
if (split2[i].equals("null")) {
|
||||||
|
labelMap.put(-1 - labelMap.size(), null);
|
||||||
|
} else {
|
||||||
labelMap.put(Integer.parseInt(split2[i]), null);
|
labelMap.put(Integer.parseInt(split2[i]), null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LabelNode dflt = null;
|
LabelNode dflt = null;
|
||||||
if (!split2[2].substring(9).equals("null")) {
|
if (!split2[2].substring(9).equals("null")) {
|
||||||
@@ -1242,9 +1250,13 @@ public class Assembler {
|
|||||||
} else if (stage == 0) {
|
} else if (stage == 0) {
|
||||||
keys.add(Integer.parseInt(spl));
|
keys.add(Integer.parseInt(spl));
|
||||||
} else if (stage == 2) {
|
} else if (stage == 2) {
|
||||||
|
if (spl.equals("null")) {
|
||||||
|
labelMap.put(-1 - labelMap.size(), null);
|
||||||
|
} else {
|
||||||
labelMap.put(Integer.parseInt(spl), null);
|
labelMap.put(Integer.parseInt(spl), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LabelNode dflt = null;
|
LabelNode dflt = null;
|
||||||
int labelNr = Integer.parseInt(split2[0].substring(9));
|
int labelNr = Integer.parseInt(split2[0].substring(9));
|
||||||
@@ -1330,25 +1342,24 @@ public class Assembler {
|
|||||||
String target = split[2];
|
String target = split[2];
|
||||||
int index = target.lastIndexOf("/");
|
int index = target.lastIndexOf("/");
|
||||||
return new MethodInsnNode(182, target.substring(0, index), target.substring(index + 1), split[1],
|
return new MethodInsnNode(182, target.substring(0, index), target.substring(index + 1), split[1],
|
||||||
split.length == 4);
|
false);
|
||||||
}
|
}
|
||||||
case "invokespecial": {
|
case "invokespecial": {
|
||||||
String target = split[2];
|
String target = split[2];
|
||||||
int index = target.lastIndexOf("/");
|
int index = target.lastIndexOf("/");
|
||||||
return new MethodInsnNode(183, target.substring(0, index), target.substring(index + 1), split[1],
|
return new MethodInsnNode(183, target.substring(0, index), target.substring(index + 1), split[1],
|
||||||
split.length == 4);
|
false);
|
||||||
}
|
}
|
||||||
case "invokestatic": {
|
case "invokestatic": {
|
||||||
String target = split[2];
|
String target = split[2];
|
||||||
int index = target.lastIndexOf("/");
|
int index = target.lastIndexOf("/");
|
||||||
return new MethodInsnNode(184, target.substring(0, index), target.substring(index + 1), split[1],
|
return new MethodInsnNode(184, target.substring(0, index), target.substring(index + 1), split[1],
|
||||||
split.length == 4);
|
false);
|
||||||
}
|
}
|
||||||
case "invokeinterface": {
|
case "invokeinterface": {
|
||||||
String target = split[2];
|
String target = split[2];
|
||||||
int index = target.lastIndexOf("/");
|
int index = target.lastIndexOf("/");
|
||||||
return new MethodInsnNode(185, target.substring(0, index), target.substring(index + 1), split[1],
|
return new MethodInsnNode(185, target.substring(0, index), target.substring(index + 1), split[1], true);
|
||||||
split.length == 4);
|
|
||||||
}
|
}
|
||||||
case "invokedynamic": {
|
case "invokedynamic": {
|
||||||
String str = s.substring(16, s.length() - 2).replace("", "");
|
String str = s.substring(16, s.length() - 2).replace("", "");
|
||||||
|
|||||||
@@ -421,7 +421,7 @@ public class Disassembler {
|
|||||||
case "MethodInsnNode": {
|
case "MethodInsnNode": {
|
||||||
MethodInsnNode node = (MethodInsnNode) n;
|
MethodInsnNode node = (MethodInsnNode) n;
|
||||||
s += "\t\t" + OpcodesReverse.reverseOpcode(node.getOpcode()) + " " + node.desc + " " + node.owner + "/"
|
s += "\t\t" + OpcodesReverse.reverseOpcode(node.getOpcode()) + " " + node.desc + " " + node.owner + "/"
|
||||||
+ node.name + (node.itf ? " true" : "") + "\n";
|
+ node.name + "\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "TypeInsnNode": {
|
case "TypeInsnNode": {
|
||||||
|
|||||||
Reference in new issue
Block a user