Updated For Plugin API Changes

This will make it easier on the user to inform them which file the class resources are in
This commit is contained in:
Konloch 2021-07-13 05:10:24 -07:00
parent fc68fde546
commit 1eda5e7f78
15 changed files with 28 additions and 19 deletions

View File

@ -15,7 +15,7 @@ public class ExampleStringDecrypter extends Plugin {
@Override
public void execute(ArrayList<ClassNode> classNodesList) {
PluginConsole gui = new PluginConsole("Example String Decrypter");
PluginConsole gui = new PluginConsole(activeContainer.name + "Example String Decrypter");
MultipleChoiceDialogue dialogue = new MultipleChoiceDialogue("Bytecode Viewer - WARNING",
"WARNING: This will load the classes into the JVM and execute the initialize function"

View File

@ -70,7 +70,7 @@ public class FernFlowerDecompiler extends InternalDecompiler
String start = tempDirectory + fs + MiscUtils.getUniqueName("", ".class");
final File tempClass = new File(start + ".class");
String exception = "";
try {
final FileOutputStream fos = new FileOutputStream(tempClass);

View File

@ -45,7 +45,6 @@ import static the.bytecode.club.bytecodeviewer.Constants.nl;
public class AllatoriStringDecrypter extends Plugin
{
final PluginConsole frame = new PluginConsole("Allatori String Decrypter");
final StringBuilder out = new StringBuilder();
final String className;
@ -54,6 +53,8 @@ public class AllatoriStringDecrypter extends Plugin
@Override
public void execute(ArrayList<ClassNode> classNodeList)
{
PluginConsole frame = new PluginConsole(activeContainer.name + " - Allatori String Decrypter");
MultipleChoiceDialogue dialogue = new MultipleChoiceDialogue("Bytecode Viewer - WARNING",
"WARNING: This will load the classes into the JVM and execute the allatori decrypter function"
+ nl + "for each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE.",

View File

@ -51,7 +51,6 @@ public class EZInjection extends Plugin
{
public static ArrayList<BytecodeHook> hookArray = new ArrayList<>();
private static final String version = "1.0";
private static final PluginConsole gui = new PluginConsole("EZ Injection v" + version);
private final boolean accessModifiers;
private final boolean injectHooks;
private final boolean invokeMethod;
@ -140,7 +139,7 @@ public class EZInjection extends Plugin
@Override
public void execute(ArrayList<ClassNode> classNodeList)
{
BytecodeViewer.updateBusyStatus(true);
PluginConsole gui = new PluginConsole(activeContainer.name + " - EZ Injection v" + version);
gui.setText("");
@ -328,7 +327,5 @@ public class EZInjection extends Plugin
}
}
}
BytecodeViewer.updateBusyStatus(false);
}
}

View File

@ -51,7 +51,7 @@ public class MaliciousCodeScanner extends Plugin
@Override
public void execute(ArrayList<ClassNode> classNodeList)
{
PluginConsole frame = new PluginConsole("Malicious Code Scanner");
PluginConsole frame = new PluginConsole(activeContainer.name + " - Malicious Code Scanner");
StringBuilder sb = new StringBuilder();
HashSet<String> scanOptions = new HashSet<>();

View File

@ -36,7 +36,7 @@ import the.bytecode.club.bytecodeviewer.api.PluginConsole;
public class ReplaceStrings extends Plugin
{
PluginConsole frame = new PluginConsole("Replace Strings");
PluginConsole frame;
String originalLDC;
String newLDC;
String className;
@ -53,6 +53,8 @@ public class ReplaceStrings extends Plugin
@Override
public void execute(ArrayList<ClassNode> classNodeList)
{
frame = new PluginConsole(activeContainer.name + " - Replace Strings");
if (!className.equals("*"))
{
for (ClassNode classNode : classNodeList)

View File

@ -44,7 +44,7 @@ public class ShowAllStrings extends Plugin
@Override
public void execute(ArrayList<ClassNode> classNodeList)
{
PluginConsole frame = new PluginConsole("Show All Strings");
PluginConsole frame = new PluginConsole(activeContainer.name + " - Show All Strings");
StringBuilder sb = new StringBuilder();
for (ClassNode classNode : classNodeList)

View File

@ -39,7 +39,7 @@ public class ShowMainMethods extends Plugin
@Override
public void execute(ArrayList<ClassNode> classNodeList)
{
PluginConsole frame = new PluginConsole("Show Main Methods");
PluginConsole frame = new PluginConsole(activeContainer.name + " - Show Main Methods");
StringBuilder sb = new StringBuilder();
for (ClassNode classNode : classNodeList)

View File

@ -15,7 +15,7 @@ public class StackFramesRemover extends Plugin
public void execute(ArrayList<ClassNode> classNodeList)
{
AtomicInteger counter = new AtomicInteger();
PluginConsole frame = new PluginConsole("StackFrames Remover");
PluginConsole frame = new PluginConsole(activeContainer.name + " - StackFrames Remover");
for (ClassNode cn : classNodeList)
{
for (MethodNode mn : cn.methods)

View File

@ -17,7 +17,7 @@ public class ViewAPKAndroidPermissions extends Plugin
@Override
public void execute(ArrayList<ClassNode> classNodeList)
{
PluginConsole frame = new PluginConsole("Android Permissions");
PluginConsole frame = new PluginConsole(activeContainer.name + " - Android Permissions");
frame.setVisible(true);
byte[] encodedAndroidManifest = BytecodeViewer.getFileContents("AndroidManifest.xml");

View File

@ -17,7 +17,7 @@ public class ViewManifest extends Plugin
@Override
public void execute(ArrayList<ClassNode> classNodeList)
{
PluginConsole frame = new PluginConsole("View Manifest");
PluginConsole frame = new PluginConsole(activeContainer.name + " - View Manifest");
frame.setVisible(true);
//TODO android APKs may have AndroidManifests that can be viewed normally, this should be checked

View File

@ -41,12 +41,12 @@ import static the.bytecode.club.bytecodeviewer.Constants.*;
public class ZStringArrayDecrypter extends Plugin
{
PluginConsole gui = new PluginConsole("ZStringArray Decrypter");
StringBuilder out = new StringBuilder();
@Override
public void execute(ArrayList<ClassNode> classNodeList)
{
PluginConsole gui = new PluginConsole(activeContainer.name + " - ZStringArray Decrypter");
StringBuilder out = new StringBuilder();
MultipleChoiceDialogue dialogue = new MultipleChoiceDialogue("Bytecode Viewer - WARNING",
"WARNING: This will load the classes into the JVM and execute the initialize function"
+ nl + "for each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE.",

View File

@ -62,6 +62,10 @@ public class JavascriptPluginLaunchStrategy implements PluginLaunchStrategy
{
try
{
//add the active container as a global variable to the JS script
finalEngine.put("activeContainer", activeContainer);
//invoke the JS function
((Invocable) finalEngine).invokeFunction("execute", classNodeList);
}
catch (NoSuchMethodException | ScriptException e)

View File

@ -4,7 +4,7 @@ import org.objectweb.asm.tree.ClassNode;
public class Template extends Plugin
{
PluginConsole gui = new PluginConsole("Java Template");
PluginConsole gui;
/**
* Main function
@ -12,7 +12,11 @@ public class Template extends Plugin
@Override
public void execute(ArrayList<ClassNode> classNodeList)
{
//create console
gui = new PluginConsole(activeContainer.name + "Java Template");
gui.setVisible(true); //show the console
//debug text
out("Class Nodes: " + classNodeList.size());
//iterate through each class node

View File

@ -1,12 +1,13 @@
var BCV = Java.type("the.bytecode.club.bytecodeviewer.api.BCV");
var PluginConsole = Java.type("the.bytecode.club.bytecodeviewer.api.PluginConsole");
var gui = new PluginConsole("Javascript Template");
var gui;
/**
* Main function
*/
function execute(classNodeList)
{
gui = new PluginConsole(activeContainer.name + "Javascript Template");
gui.setVisible(true); //show the console
out("Class Nodes: " + classNodeList.size());