mirror of
https://github.com/SuspiciousActivity/ByteEdit.git
synced 2026-08-13 17:56:17 +00:00
Changed Access View to HEX for innerclasses
This commit is contained in:
1 parent
add4fd39d4
commit
7330fdcafd
3 files changed
+29
-2
No files matched your search
@@ -3,6 +3,7 @@ package me.ByteEdit.main;
|
||||
import java.awt.Color;
|
||||
import java.io.StringReader;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -70,7 +71,7 @@ public class Assembler {
|
||||
} else {
|
||||
String split[] = s.split(" ");
|
||||
clazz.innerClasses.add(new InnerClassNode(split[1], split[2].equals("null") ? null : split[2],
|
||||
split[3].equals("null") ? null : split[3], Integer.parseInt(split[4])));
|
||||
split[3].equals("null") ? null : split[3], Integer.parseInt(split[4].substring(2), 16)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,6 +346,9 @@ public class Assembler {
|
||||
int access = 0;
|
||||
if (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")) {
|
||||
access ^= ClassUtil.ACC_PUBLIC;
|
||||
}
|
||||
@@ -394,6 +398,7 @@ public class Assembler {
|
||||
access ^= ClassUtil.ACC_MANDATED;
|
||||
}
|
||||
}
|
||||
}
|
||||
node.access = access;
|
||||
methodLabelMap.clear();
|
||||
} else {
|
||||
|
||||
@@ -54,56 +54,77 @@ public class ClassUtil {
|
||||
}
|
||||
|
||||
public static String getAccessFlagsFull(int access) {
|
||||
int acc = 0;
|
||||
String s = "";
|
||||
if ((ACC_PUBLIC & access) != 0) {
|
||||
s += "public ";
|
||||
acc ^= ACC_PUBLIC;
|
||||
}
|
||||
if ((ACC_PRIVATE & access) != 0) {
|
||||
s += "private ";
|
||||
acc ^= ACC_PRIVATE;
|
||||
}
|
||||
if ((ACC_PROTECTED & access) != 0) {
|
||||
s += "protected ";
|
||||
acc ^= ACC_PROTECTED;
|
||||
}
|
||||
if ((ACC_STATIC & access) != 0) {
|
||||
s += "static ";
|
||||
acc ^= ACC_STATIC;
|
||||
}
|
||||
if ((ACC_FINAL & access) != 0) {
|
||||
s += "final ";
|
||||
acc ^= ACC_FINAL;
|
||||
}
|
||||
if ((ACC_SYNCHRONIZED & access) != 0) {
|
||||
s += "synchronized ";
|
||||
acc ^= ACC_SYNCHRONIZED;
|
||||
}
|
||||
if ((ACC_VARARGS & access) != 0) {
|
||||
s += "varargs ";
|
||||
acc ^= ACC_VARARGS;
|
||||
}
|
||||
if ((ACC_NATIVE & access) != 0) {
|
||||
s += "native ";
|
||||
acc ^= ACC_NATIVE;
|
||||
}
|
||||
if ((ACC_INTERFACE & access) != 0) {
|
||||
s += "interface ";
|
||||
acc ^= ACC_INTERFACE;
|
||||
}
|
||||
if ((ACC_ABSTRACT & access) != 0) {
|
||||
s += "abstract ";
|
||||
acc ^= ACC_ABSTRACT;
|
||||
}
|
||||
if ((ACC_STRICTFP & access) != 0) {
|
||||
s += "strictfp ";
|
||||
acc ^= ACC_STRICTFP;
|
||||
}
|
||||
if ((ACC_SYNTHETIC & access) != 0) {
|
||||
s += "synthetic ";
|
||||
acc ^= ACC_SYNTHETIC;
|
||||
}
|
||||
if ((ACC_BRIDGE & access) != 0) {
|
||||
s += "bridge ";
|
||||
acc ^= ACC_BRIDGE;
|
||||
}
|
||||
if ((ACC_ANNOTATION & access) != 0) {
|
||||
s += "annotation ";
|
||||
acc ^= ACC_ANNOTATION;
|
||||
}
|
||||
if ((ACC_ENUM & access) != 0) {
|
||||
s += "enum ";
|
||||
acc ^= ACC_ENUM;
|
||||
}
|
||||
if ((ACC_MANDATED & access) != 0) {
|
||||
s += "mandated ";
|
||||
acc ^= ACC_MANDATED;
|
||||
}
|
||||
if (acc == access) {
|
||||
return s;
|
||||
} else {
|
||||
return "0x" + Integer.toHexString(access) + " ";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -104,7 +104,8 @@ public class Disassembler {
|
||||
s += "// #InnerClasses:\n";
|
||||
if (classNode.innerClasses != null) {
|
||||
for (InnerClassNode icn : classNode.innerClasses) {
|
||||
s += "// " + icn.name + " " + icn.outerName + " " + icn.innerName + " " + icn.access + "\n";
|
||||
s += "// " + icn.name + " " + icn.outerName + " " + icn.innerName + " 0x"
|
||||
+ Integer.toHexString(icn.access) + "\n";
|
||||
}
|
||||
}
|
||||
s += ClassUtil.getAccessFlagsClass(classNode.access) + classNode.name + " ";
|
||||
|
||||
Reference in new issue
Block a user