Skip to content

Commit 1f13c21

Browse files
committed
External Plugin Cleanup / Fixes
1 parent 59f45e5 commit 1f13c21

3 files changed

Lines changed: 48 additions & 30 deletions

File tree

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,82 @@
11
import java.lang.reflect.Field;
22
import java.util.List;
3+
34
import org.objectweb.asm.tree.ClassNode;
45
import org.objectweb.asm.tree.FieldNode;
6+
import the.bytecode.club.bytecodeviewer.*;
57
import the.bytecode.club.bytecodeviewer.api.*;
68
import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog;
79

8-
import static the.bytecode.club.bytecodeviewer.Constants.nl;
10+
import static the.bytecode.club.bytecodeviewer.Constants.NL;
911

1012
/**
11-
** This is an example of a String Decrypter Java Plugin for BCV.
12-
**
13-
** @author [Your-Name-Goes-Here]
13+
* * This is an example of a String Decrypter Java Plugin for BCV.
14+
* *
15+
* * @author [Your-Name-Goes-Here]
1416
**/
1517

16-
public class ExampleStringDecrypter extends Plugin {
18+
public class ExampleStringDecrypter extends Plugin
19+
{
1720

1821
@Override
19-
public void execute(List<ClassNode> classNodesList) {
22+
public void execute(List<ClassNode> classNodesList)
23+
{
2024
PluginConsole gui = new PluginConsole("Example String Decrypter Java Edition");
2125

22-
MultipleChoiceDialog dialog = new MultipleChoiceDialog("Bytecode Viewer - WARNING",
23-
"WARNING: This will load the classes into the JVM and execute the initialize function"
24-
+ nl + "for each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE.",
25-
new String[]{"Continue", "Cancel"});
26+
MultipleChoiceDialog dialog = new MultipleChoiceDialog("Bytecode Viewer - WARNING", "WARNING: This will load the classes into the JVM and execute the initialize function" + NL +
27+
"for each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE.", new String[]{"Continue", "Cancel"});
2628

27-
if (dialog.promptChoice() == 0) {
29+
if (dialog.promptChoice() == 0)
30+
{
2831
boolean needsWarning = false;
29-
30-
for (ClassNode cn : classNodesList) {
31-
try {
32+
33+
for (ClassNode cn : classNodesList)
34+
{
35+
try
36+
{
3237
//load the class node into the classloader
3338
BCV.getClassNodeLoader().addClass(cn);
34-
35-
for (Object o : cn.fields.toArray()) {
39+
40+
for (Object o : cn.fields.toArray())
41+
{
3642
FieldNode f = (FieldNode) o;
37-
43+
3844
//if the class contains the field z, get the class object from the class node
3945
//then print out the value of the fields inside the class
4046
//if the strings get decrypted on init, this allows you to dump the current values
41-
42-
if (f.name.equals("z")) {
43-
try {
44-
for (Field f2 : BCV.getClassNodeLoader().nodeToClass(cn).getFields()) {
47+
if (f.name.equals("z"))
48+
{
49+
try
50+
{
51+
for (Field f2 : BCV.getClassNodeLoader().nodeToClass(cn).getFields())
52+
{
4553
String s = (String) f2.get(null);
4654
if (s != null && !s.isEmpty())
4755
gui.appendText(cn + ":" + s);
4856
}
49-
} catch (Exception ignored) {
57+
}
58+
catch (Exception ignored)
59+
{
5060
}
5161
}
5262
}
53-
} catch (Exception e) {
63+
}
64+
catch (Exception e)
65+
{
5466
gui.appendText("Failed loading class " + cn.name);
5567
e.printStackTrace();
5668
needsWarning = true;
5769
}
5870
}
59-
60-
if (needsWarning) {
61-
BytecodeViewer.showMessage("Some classes failed to decrypt, if you'd like to decrypt all of them\n"
62-
+ "makes sure you include ALL the libraries it requires.");
71+
72+
if (needsWarning)
73+
{
74+
BytecodeViewer.showMessage("Some classes failed to decrypt, if you'd like to decrypt all of them" + NL +
75+
"makes sure you include ALL the libraries it requires.");
6376
}
6477

6578
gui.setVisible(true);
6679
}
6780
}
81+
6882
}

plugins/java/Skeleton.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
** @author [Your Name Goes Here]
99
**/
1010

11-
public class Skeleton extends Plugin {
11+
public class Skeleton extends Plugin
12+
{
1213

1314
@Override
14-
public void execute(List<ClassNode> classNodesList) {
15+
public void execute(List<ClassNode> classNodesList)
16+
{
1517
PluginConsole gui = new PluginConsole("Skeleton Title");
1618
gui.setVisible(true);
1719
gui.appendText("executed skeleton example");
1820
}
19-
}
21+
22+
}

plugins/java/XposedGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,4 +327,5 @@ private static String quote(String aText)
327327
String QUOTE = "'";
328328
return QUOTE + aText + QUOTE;
329329
}
330+
330331
}

0 commit comments

Comments
 (0)