Skip to content

Commit

Permalink
Merge pull request #379 from ThexXTURBOXx/master
Browse files Browse the repository at this point in the history
Fixes and Updates
  • Loading branch information
Konloch committed Jan 11, 2022
2 parents 87504ff + a34ee0f commit 81e9e44
Show file tree
Hide file tree
Showing 15 changed files with 260 additions and 288 deletions.
3 changes: 1 addition & 2 deletions plugins/Skeleton.gy
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import org.objectweb.asm.tree.ClassNode
import the.bytecode.club.bytecodeviewer.api.Plugin
import the.bytecode.club.bytecodeviewer.api.PluginConsole
import the.bytecode.club.bytecodeviewer.api.*

class Skeleton extends Plugin {

Expand Down
19 changes: 10 additions & 9 deletions plugins/Skeleton.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import the.bytecode.club.bytecodeviewer.api.*;
import java.util.ArrayList;
import java.util.List;
import org.objectweb.asm.tree.ClassNode;
import the.bytecode.club.bytecodeviewer.api.*;

public class Skeleton extends Plugin {

@Override
public void execute(ArrayList<ClassNode> classNodesList) {
PluginConsole gui = new PluginConsole("Skeleton");
gui.setVisible(true);
gui.appendText("executed skeleton");
}
}
@Override
public void execute(List<ClassNode> classNodesList) {
PluginConsole gui = new PluginConsole("Skeleton");
gui.setVisible(true);
gui.appendText("executed skeleton");
}

}
5 changes: 2 additions & 3 deletions plugins/Skeleton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
function execute(classNodeList)
{
function execute(classNodeList) {
var PluginConsole = Java.type("the.bytecode.club.bytecodeviewer.api.PluginConsole");
var gui = new PluginConsole("Skeleton");
gui.setVisible(true);
gui.appendText("executed skeleton");
}
}
2 changes: 1 addition & 1 deletion plugins/Skeleton.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def execute(classNodeList)
gui.setVisible(true)
gui.appendText("executed skeleton")
end
end
end
290 changes: 125 additions & 165 deletions plugins/XposedGenerator.java

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions plugins/example/ExamplePrintClassesPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ var PluginConsole = Java.type("the.bytecode.club.bytecodeviewer.api.PluginConsol

var gui = new PluginConsole("Example Plugin Print Loaded Classes");

function execute(classNodeList)
{
for (index = 0; index < classNodeList.length; index++)
{
function execute(classNodeList) {
for (index = 0; index < classNodeList.length; index++) {
var cn = classNodeList[index];
gui.appendText("Resource: " + cn.name + ".class");
}

gui.setVisible(true);
}
}
23 changes: 9 additions & 14 deletions plugins/example/ExampleStringDecrypter.gy
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,25 @@ class ExampleStringDecrypter extends Plugin {
+ nl + "for each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE.",
new String[]{"Continue", "Cancel"})

if(dialog.promptChoice() == 0)
{
for(ClassNode cn : classNodesList)
{
if (dialog.promptChoice() == 0) {
for (ClassNode cn : classNodesList) {
BCV.getClassNodeLoader().addClass(cn)

for(Object o : cn.fields.toArray())
{
for (Object o : cn.fields.toArray()) {
FieldNode f = (FieldNode) o
if(f.name == "z") {// && f.desc.equals("([Ljava/lang/String;)V")) {
try
{
for(Field f2 : BCV.getClassNodeLoader().nodeToClass(cn).getFields())
{
if (f.name == "z") {// && f.desc.equals("([Ljava/lang/String;)V")) {
try {
for (Field f2 : BCV.getClassNodeLoader().nodeToClass(cn).getFields()) {
String s = f2.get(null)
if(s != null && !s.empty)
if (s != null && !s.empty)
gui.appendText(cn + ":" + s)
}
} catch(Exception | StackOverflowError ignored) {}
} catch (Exception | StackOverflowError ignored) {
}
}
}

}

gui.setVisible(true)
}
}
Expand Down
42 changes: 19 additions & 23 deletions plugins/example/ExampleStringDecrypter.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import the.bytecode.club.bytecodeviewer.api.*
import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog;

import java.util.ArrayList;
import java.lang.reflect.Field;
import java.util.List;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldNode
import org.objectweb.asm.tree.FieldNode;
import the.bytecode.club.bytecodeviewer.api.*;
import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog;

import static the.bytecode.club.bytecodeviewer.Constants.nl;

Expand All @@ -14,33 +13,29 @@
public class ExampleStringDecrypter extends Plugin {

@Override
public void execute(ArrayList<ClassNode> classNodesList) {
public void execute(List<ClassNode> classNodesList) {
PluginConsole gui = new PluginConsole("Example String Decrypter");

MultipleChoiceDialog dialog = new MultipleChoiceDialog("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.",
new String[]{"Continue", "Cancel"});

if(dialog.promptChoice() == 0)
{
for(ClassNode cn : classNodesList)
{
the.bytecode.club.bytecodeviewer.api.BCV.getClassNodeLoader().addClass(cn);
if (dialog.promptChoice() == 0) {
for (ClassNode cn : classNodesList) {
BCV.getClassNodeLoader().addClass(cn);

for(Object o : cn.fields.toArray())
{
for (Object o : cn.fields.toArray()) {
FieldNode f = (FieldNode) o;
if(f.name.equals("z")) {// && f.desc.equals("([Ljava/lang/String;)V")) {
try
{
for(Field f2 : the.bytecode.club.bytecodeviewer.api.BCV.getClassNodeLoader().nodeToClass(cn).getFields())
{
String s = f2.get(null);
if(s != null && !s.empty())
gui.appendText(cn+":"+s);
if (f.name.equals("z")) {// && f.desc.equals("([Ljava/lang/String;)V")) {
try {
for (Field f2 : BCV.getClassNodeLoader().nodeToClass(cn).getFields()) {
String s = (String) f2.get(null);
if (s != null && !s.isEmpty())
gui.appendText(cn + ":" + s);
}
} catch(Exception | StackOverflowError e) {}
} catch (Exception ignored) {
}
}
}

Expand All @@ -49,4 +44,5 @@ public void execute(ArrayList<ClassNode> classNodesList) {
gui.setVisible(true);
}
}
}

}
53 changes: 22 additions & 31 deletions plugins/example/ExampleStringDecrypter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,69 +7,60 @@ var MultipleChoiceDialog = Java.type("the.bytecode.club.bytecodeviewer.gui.compo
var BytecodeViewer = Java.type("the.bytecode.club.bytecodeviewer.api.BCV")

var dialog = new MultipleChoiceDialog("Bytecode Viewer - WARNING",
"WARNING: This will load the classes into the JVM and execute the initialize function"
+ "\nfor each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE.",
["Continue", "Cancel"]);
"WARNING: This will load the classes into the JVM and execute the initialize function"
+ "\nfor each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE.",
["Continue", "Cancel"]);
var gui;

function execute(classNodeList)
{
function execute(classNodeList) {
gui = new PluginConsole("Skeleton");

if(dialog.promptChoice() == 0)
{
if (dialog.promptChoice() == 0) {
var needsWarning = false;

for (cnIndex = 0; cnIndex < classNodeList.length; cnIndex++)
{
try
{
for (cnIndex = 0; cnIndex < classNodeList.length; cnIndex++) {
try {
var cn = classNodeList[cnIndex];
var fields = cn.fields.toArray();

//load the class node into the classloader
BytecodeViewer.loadClassIntoClassLoader(cn);
BytecodeViewer.getClassNodeLoader().addClass(cn);

for (fieldIndex = 0; fieldIndex < fields.length; fieldIndex++)
{
var fields = cn.fields.toArray();
for (fieldIndex = 0; fieldIndex < fields.length; fieldIndex++) {
var field = fields[fieldIndex];

//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 the strings get decrypted on init, this allows you to dump the current values

if(field.name.equals("z")) {// && f.desc.equals("([Ljava/lang/String;)V")) {
try
{
if (field.name.equals("z")) {// && f.desc.equals("([Ljava/lang/String;)V")) {
try {
var loadedClass = BytecodeViewer.getClassNodeLoader().nodeToClass(cn);
var reflectedFields = loadedClass.getFields();

for (reflectedFieldIndex = 0; reflectedFieldIndex < reflectedFields.length; reflectedFieldIndex++)
{
for (reflectedFieldIndex = 0; reflectedFieldIndex < reflectedFields.length; reflectedFieldIndex++) {
var reflectedField = reflectedFields[fieldIndex];
var s = reflectedField.get(null);

if(s != null && !s.empty())
if (s != null && !s.empty())
gui.appendText(cn + "->" + s);
}
} catch(e) {}
} catch (e) {
}
}
}
}
catch(e)
{
gui.appendText("Failed loading class " + cn.getName());
} catch (e) {
gui.appendText("Failed loading class " + cn.name);
e.printStackTrace();
needsWarning = true;
}
}

if (needsWarning)
{
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.");
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.");
}

gui.setVisible(true);
}
}
}
2 changes: 1 addition & 1 deletion plugins/skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ class skeleton(Plugin):
def execute(classNodeList, poop): #for some reason it requires a second arg
gui = PluginConsole("Skeleton")
gui.setVisible(Boolean.TRUE)
gui.appendText("exceuted skeleton")
gui.appendText("exceuted skeleton")
34 changes: 29 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<darklaf.version>2.7.3</darklaf.version>
<darklaf-extensions-rsta.version>0.3.4</darklaf-extensions-rsta.version>
<decompiler-fernflower.version>5.2.1.Final</decompiler-fernflower.version>
<dex2jar.version>v41</dex2jar.version>
<dex2jar.version>v42</dex2jar.version>
<fernflower.version>eda981d</fernflower.version>
<gson.version>2.8.9</gson.version>
<guava.version>31.0.1-jre</guava.version>
Expand All @@ -44,7 +44,9 @@
<objenesis.version>3.2</objenesis.version>
<paged-data.version>0.2.0</paged-data.version>
<procyon.version>0.5.36</procyon.version>
<rsyntaxtextarea.version>3.1.5</rsyntaxtextarea.version>
<!-- TODO: Remove snapshot version when 0.6 stable is released -->
<procyon-snapshot.version>10b32a4</procyon-snapshot.version>
<rsyntaxtextarea.version>3.1.6</rsyntaxtextarea.version>
<semantic-version.version>2.1.1</semantic-version.version>
<slf4j.version>1.7.32</slf4j.version>
<smali.version>2.5.2</smali.version>
Expand Down Expand Up @@ -237,6 +239,7 @@
<artifactId>paged_data</artifactId>
<version>${paged-data.version}</version>
</dependency>
<!-- TODO: Add back when 0.6 stable is released
<dependency>
<groupId>org.bitbucket.mstrobel</groupId>
<artifactId>procyon-core</artifactId>
Expand All @@ -257,6 +260,27 @@
<artifactId>procyon-compilertools</artifactId>
<version>${procyon.version}</version>
</dependency>
-->
<dependency>
<groupId>com.github.mstrobel.procyon</groupId>
<artifactId>procyon-compilertools</artifactId>
<version>${procyon-snapshot.version}</version>
</dependency>
<dependency>
<groupId>com.github.mstrobel.procyon</groupId>
<artifactId>procyon-core</artifactId>
<version>${procyon-snapshot.version}</version>
</dependency>
<dependency>
<groupId>com.github.mstrobel.procyon</groupId>
<artifactId>procyon-expressions</artifactId>
<version>${procyon-snapshot.version}</version>
</dependency>
<dependency>
<groupId>com.github.mstrobel.procyon</groupId>
<artifactId>procyon-reflection</artifactId>
<version>${procyon-snapshot.version}</version>
</dependency>
<dependency>
<groupId>com.fifesoft</groupId>
<artifactId>rsyntaxtextarea</artifactId>
Expand Down Expand Up @@ -379,8 +403,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
Expand All @@ -389,7 +413,7 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<source>${java.version}</source>
<source>${maven.compiler.source}</source>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void executeContainer()
* On plugin start each resource container is iterated through,
* then this is called with the resource container classes
*
* @param classNodeList all of the loaded classes for easy access.
* @param classNodeList all the loaded classes for easy access.
*/
public abstract void execute(List<ClassNode> classNodeList);
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static String convertStreamToString(InputStream is) throws IOException
if (is == null)
return null;
try (InputStream stream = is;
Scanner s = new Scanner(stream).useDelimiter("\\A")) {
Scanner s = new Scanner(stream, "UTF-8").useDelimiter("\\A")) {
return s.hasNext() ? s.next() : "";
}
}
Expand Down

0 comments on commit 81e9e44

Please sign in to comment.