External Plugin Cleanup / Fixes

This commit is contained in:
Konloch 2024-10-02 21:12:58 -06:00
parent 59f45e58b9
commit 1f13c21dc0

AI 샘플 코드 생성 중입니다

Loading...
3 changed files with 48 additions and 30 deletions

View File

@ -1,11 +1,13 @@
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.List; import java.util.List;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldNode; import org.objectweb.asm.tree.FieldNode;
import the.bytecode.club.bytecodeviewer.*;
import the.bytecode.club.bytecodeviewer.api.*; import the.bytecode.club.bytecodeviewer.api.*;
import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog; import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog;
import static the.bytecode.club.bytecodeviewer.Constants.nl; import static the.bytecode.club.bytecodeviewer.Constants.NL;
/** /**
* * This is an example of a String Decrypter Java Plugin for BCV. * * This is an example of a String Decrypter Java Plugin for BCV.
@ -13,56 +15,68 @@ import static the.bytecode.club.bytecodeviewer.Constants.nl;
* * @author [Your-Name-Goes-Here] * * @author [Your-Name-Goes-Here]
**/ **/
public class ExampleStringDecrypter extends Plugin { public class ExampleStringDecrypter extends Plugin
{
@Override @Override
public void execute(List<ClassNode> classNodesList) { public void execute(List<ClassNode> classNodesList)
{
PluginConsole gui = new PluginConsole("Example String Decrypter Java Edition"); PluginConsole gui = new PluginConsole("Example String Decrypter Java Edition");
MultipleChoiceDialog dialog = new MultipleChoiceDialog("Bytecode Viewer - WARNING", MultipleChoiceDialog dialog = new MultipleChoiceDialog("Bytecode Viewer - WARNING", "WARNING: This will load the classes into the JVM and execute the initialize function" + NL +
"WARNING: This will load the classes into the JVM and execute the initialize function" "for each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE.", new String[]{"Continue", "Cancel"});
+ nl + "for each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE.",
new String[]{"Continue", "Cancel"});
if (dialog.promptChoice() == 0) { if (dialog.promptChoice() == 0)
{
boolean needsWarning = false; boolean needsWarning = false;
for (ClassNode cn : classNodesList) { for (ClassNode cn : classNodesList)
try { {
try
{
//load the class node into the classloader //load the class node into the classloader
BCV.getClassNodeLoader().addClass(cn); BCV.getClassNodeLoader().addClass(cn);
for (Object o : cn.fields.toArray()) { for (Object o : cn.fields.toArray())
{
FieldNode f = (FieldNode) o; FieldNode f = (FieldNode) o;
//if the class contains the field z, get the class object from the class node //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 //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 strings get decrypted on init, this allows you to dump the current values
if (f.name.equals("z"))
if (f.name.equals("z")) { {
try { try
for (Field f2 : BCV.getClassNodeLoader().nodeToClass(cn).getFields()) { {
for (Field f2 : BCV.getClassNodeLoader().nodeToClass(cn).getFields())
{
String s = (String) f2.get(null); String s = (String) f2.get(null);
if (s != null && !s.isEmpty()) if (s != null && !s.isEmpty())
gui.appendText(cn + ":" + s); gui.appendText(cn + ":" + s);
} }
} catch (Exception ignored) { }
catch (Exception ignored)
{
} }
} }
} }
} catch (Exception e) { }
catch (Exception e)
{
gui.appendText("Failed loading class " + cn.name); gui.appendText("Failed loading class " + cn.name);
e.printStackTrace(); e.printStackTrace();
needsWarning = true; needsWarning = true;
} }
} }
if (needsWarning) { if (needsWarning)
BytecodeViewer.showMessage("Some classes failed to decrypt, if you'd like to decrypt all of them\n" {
+ "makes sure you include ALL the libraries it requires."); BytecodeViewer.showMessage("Some classes failed to decrypt, if you'd like to decrypt all of them" + NL +
"makes sure you include ALL the libraries it requires.");
} }
gui.setVisible(true); gui.setVisible(true);
} }
} }
} }

View File

@ -8,12 +8,15 @@ import the.bytecode.club.bytecodeviewer.api.*;
** @author [Your Name Goes Here] ** @author [Your Name Goes Here]
**/ **/
public class Skeleton extends Plugin { public class Skeleton extends Plugin
{
@Override @Override
public void execute(List<ClassNode> classNodesList) { public void execute(List<ClassNode> classNodesList)
{
PluginConsole gui = new PluginConsole("Skeleton Title"); PluginConsole gui = new PluginConsole("Skeleton Title");
gui.setVisible(true); gui.setVisible(true);
gui.appendText("executed skeleton example"); gui.appendText("executed skeleton example");
} }
} }

View File

@ -327,4 +327,5 @@ public class XposedGenerator extends Plugin
String QUOTE = "'"; String QUOTE = "'";
return QUOTE + aText + QUOTE; return QUOTE + aText + QUOTE;
} }
} }