Code Cleanup

This commit is contained in:
Konloch 2022-01-22 13:06:18 -06:00
parent 845ae248ab
commit 5334a2da20

View file

@ -25,30 +25,32 @@ public class ExampleStringDecrypter extends Plugin {
boolean needsWarning = false; boolean needsWarning = false;
for (ClassNode cn : classNodesList) { for (ClassNode cn : classNodesList) {
try {
//load the class node into the classloader
BCV.getClassNodeLoader().addClass(cn);
//load the class node into the classloader for (Object o : cn.fields.toArray()) {
BCV.getClassNodeLoader().addClass(cn); FieldNode f = (FieldNode) o;
for (Object o : cn.fields.toArray()) { //if the class contains the field z, get the class object from the class node
FieldNode f = (FieldNode) o; //then print out the value of the fields inside the class
//if the strings get decrypted on init, this allows you to dump the current values
//if the class contains the field z, get the class object from the class node
//then print out the value of the fields inside the class if (f.name.equals("z")) {
//if the strings get decrypted on init, this allows you to dump the current values try {
for (Field f2 : BCV.getClassNodeLoader().nodeToClass(cn).getFields()) {
if (f.name.equals("z")) { String s = (String) f2.get(null);
try { if (s != null && !s.isEmpty())
for (Field f2 : BCV.getClassNodeLoader().nodeToClass(cn).getFields()) { gui.appendText(cn + ":" + s);
String s = (String) f2.get(null); }
if (s != null && !s.isEmpty()) } catch (Exception ignored) {
gui.appendText(cn + ":" + s);
} }
} catch (Exception e) {
gui.appendText("Failed loading class " + cn.name);
e.printStackTrace();
needsWarning = true;
} }
} }
} catch (Exception e) {
gui.appendText("Failed loading class " + cn.name);
e.printStackTrace();
needsWarning = true;
} }
} }
@ -60,5 +62,4 @@ public class ExampleStringDecrypter extends Plugin {
gui.setVisible(true); gui.setVisible(true);
} }
} }
} }