Skip to content

Commit 81e9e44

Browse files
authored
Merge pull request #379 from ThexXTURBOXx/master
Fixes and Updates
2 parents 87504ff + a34ee0f commit 81e9e44

File tree

15 files changed

+260
-288
lines changed

15 files changed

+260
-288
lines changed

plugins/Skeleton.gy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import org.objectweb.asm.tree.ClassNode
2-
import the.bytecode.club.bytecodeviewer.api.Plugin
3-
import the.bytecode.club.bytecodeviewer.api.PluginConsole
2+
import the.bytecode.club.bytecodeviewer.api.*
43

54
class Skeleton extends Plugin {
65

plugins/Skeleton.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import the.bytecode.club.bytecodeviewer.api.*;
2-
import java.util.ArrayList;
1+
import java.util.List;
32
import org.objectweb.asm.tree.ClassNode;
3+
import the.bytecode.club.bytecodeviewer.api.*;
44

55
public class Skeleton extends Plugin {
66

7-
@Override
8-
public void execute(ArrayList<ClassNode> classNodesList) {
9-
PluginConsole gui = new PluginConsole("Skeleton");
10-
gui.setVisible(true);
11-
gui.appendText("executed skeleton");
12-
}
13-
}
7+
@Override
8+
public void execute(List<ClassNode> classNodesList) {
9+
PluginConsole gui = new PluginConsole("Skeleton");
10+
gui.setVisible(true);
11+
gui.appendText("executed skeleton");
12+
}
13+
14+
}

plugins/Skeleton.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
function execute(classNodeList)
2-
{
1+
function execute(classNodeList) {
32
var PluginConsole = Java.type("the.bytecode.club.bytecodeviewer.api.PluginConsole");
43
var gui = new PluginConsole("Skeleton");
54
gui.setVisible(true);
65
gui.appendText("executed skeleton");
7-
}
6+
}

plugins/Skeleton.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ def execute(classNodeList)
1212
gui.setVisible(true)
1313
gui.appendText("executed skeleton")
1414
end
15-
end
15+
end

plugins/XposedGenerator.java

Lines changed: 125 additions & 165 deletions
Large diffs are not rendered by default.

plugins/example/ExamplePrintClassesPlugin.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ var PluginConsole = Java.type("the.bytecode.club.bytecodeviewer.api.PluginConsol
66

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

9-
function execute(classNodeList)
10-
{
11-
for (index = 0; index < classNodeList.length; index++)
12-
{
9+
function execute(classNodeList) {
10+
for (index = 0; index < classNodeList.length; index++) {
1311
var cn = classNodeList[index];
1412
gui.appendText("Resource: " + cn.name + ".class");
1513
}
1614

1715
gui.setVisible(true);
18-
}
16+
}

plugins/example/ExampleStringDecrypter.gy

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,25 @@ class ExampleStringDecrypter extends Plugin {
2323
+ nl + "for each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE.",
2424
new String[]{"Continue", "Cancel"})
2525

26-
if(dialog.promptChoice() == 0)
27-
{
28-
for(ClassNode cn : classNodesList)
29-
{
26+
if (dialog.promptChoice() == 0) {
27+
for (ClassNode cn : classNodesList) {
3028
BCV.getClassNodeLoader().addClass(cn)
3129

32-
for(Object o : cn.fields.toArray())
33-
{
30+
for (Object o : cn.fields.toArray()) {
3431
FieldNode f = (FieldNode) o
35-
if(f.name == "z") {// && f.desc.equals("([Ljava/lang/String;)V")) {
36-
try
37-
{
38-
for(Field f2 : BCV.getClassNodeLoader().nodeToClass(cn).getFields())
39-
{
32+
if (f.name == "z") {// && f.desc.equals("([Ljava/lang/String;)V")) {
33+
try {
34+
for (Field f2 : BCV.getClassNodeLoader().nodeToClass(cn).getFields()) {
4035
String s = f2.get(null)
41-
if(s != null && !s.empty)
36+
if (s != null && !s.empty)
4237
gui.appendText(cn + ":" + s)
4338
}
44-
} catch(Exception | StackOverflowError ignored) {}
39+
} catch (Exception | StackOverflowError ignored) {
40+
}
4541
}
4642
}
4743

4844
}
49-
5045
gui.setVisible(true)
5146
}
5247
}
Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import the.bytecode.club.bytecodeviewer.api.*
2-
import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog;
3-
4-
import java.util.ArrayList;
51
import java.lang.reflect.Field;
2+
import java.util.List;
63
import org.objectweb.asm.tree.ClassNode;
7-
import org.objectweb.asm.tree.FieldNode
4+
import org.objectweb.asm.tree.FieldNode;
5+
import the.bytecode.club.bytecodeviewer.api.*;
6+
import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog;
87

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

@@ -14,33 +13,29 @@
1413
public class ExampleStringDecrypter extends Plugin {
1514

1615
@Override
17-
public void execute(ArrayList<ClassNode> classNodesList) {
16+
public void execute(List<ClassNode> classNodesList) {
1817
PluginConsole gui = new PluginConsole("Example String Decrypter");
1918

2019
MultipleChoiceDialog dialog = new MultipleChoiceDialog("Bytecode Viewer - WARNING",
2120
"WARNING: This will load the classes into the JVM and execute the initialize function"
2221
+ nl + "for each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE.",
2322
new String[]{"Continue", "Cancel"});
2423

25-
if(dialog.promptChoice() == 0)
26-
{
27-
for(ClassNode cn : classNodesList)
28-
{
29-
the.bytecode.club.bytecodeviewer.api.BCV.getClassNodeLoader().addClass(cn);
24+
if (dialog.promptChoice() == 0) {
25+
for (ClassNode cn : classNodesList) {
26+
BCV.getClassNodeLoader().addClass(cn);
3027

31-
for(Object o : cn.fields.toArray())
32-
{
28+
for (Object o : cn.fields.toArray()) {
3329
FieldNode f = (FieldNode) o;
34-
if(f.name.equals("z")) {// && f.desc.equals("([Ljava/lang/String;)V")) {
35-
try
36-
{
37-
for(Field f2 : the.bytecode.club.bytecodeviewer.api.BCV.getClassNodeLoader().nodeToClass(cn).getFields())
38-
{
39-
String s = f2.get(null);
40-
if(s != null && !s.empty())
41-
gui.appendText(cn+":"+s);
30+
if (f.name.equals("z")) {// && f.desc.equals("([Ljava/lang/String;)V")) {
31+
try {
32+
for (Field f2 : BCV.getClassNodeLoader().nodeToClass(cn).getFields()) {
33+
String s = (String) f2.get(null);
34+
if (s != null && !s.isEmpty())
35+
gui.appendText(cn + ":" + s);
4236
}
43-
} catch(Exception | StackOverflowError e) {}
37+
} catch (Exception ignored) {
38+
}
4439
}
4540
}
4641

@@ -49,4 +44,5 @@ public void execute(ArrayList<ClassNode> classNodesList) {
4944
gui.setVisible(true);
5045
}
5146
}
52-
}
47+
48+
}

plugins/example/ExampleStringDecrypter.js

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,69 +7,60 @@ var MultipleChoiceDialog = Java.type("the.bytecode.club.bytecodeviewer.gui.compo
77
var BytecodeViewer = Java.type("the.bytecode.club.bytecodeviewer.api.BCV")
88

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

15-
function execute(classNodeList)
16-
{
15+
function execute(classNodeList) {
1716
gui = new PluginConsole("Skeleton");
1817

19-
if(dialog.promptChoice() == 0)
20-
{
18+
if (dialog.promptChoice() == 0) {
2119
var needsWarning = false;
2220

23-
for (cnIndex = 0; cnIndex < classNodeList.length; cnIndex++)
24-
{
25-
try
26-
{
21+
for (cnIndex = 0; cnIndex < classNodeList.length; cnIndex++) {
22+
try {
2723
var cn = classNodeList[cnIndex];
28-
var fields = cn.fields.toArray();
2924

3025
//load the class node into the classloader
31-
BytecodeViewer.loadClassIntoClassLoader(cn);
26+
BytecodeViewer.getClassNodeLoader().addClass(cn);
3227

33-
for (fieldIndex = 0; fieldIndex < fields.length; fieldIndex++)
34-
{
28+
var fields = cn.fields.toArray();
29+
for (fieldIndex = 0; fieldIndex < fields.length; fieldIndex++) {
3530
var field = fields[fieldIndex];
3631

3732
//if the class contains the field z, get the class object from the class node
3833
//then print out the value of the fields inside the class
3934
//if the strings get decrypted on init, this allows you to dump the current values
4035

41-
if(field.name.equals("z")) {// && f.desc.equals("([Ljava/lang/String;)V")) {
42-
try
43-
{
36+
if (field.name.equals("z")) {// && f.desc.equals("([Ljava/lang/String;)V")) {
37+
try {
4438
var loadedClass = BytecodeViewer.getClassNodeLoader().nodeToClass(cn);
4539
var reflectedFields = loadedClass.getFields();
4640

47-
for (reflectedFieldIndex = 0; reflectedFieldIndex < reflectedFields.length; reflectedFieldIndex++)
48-
{
41+
for (reflectedFieldIndex = 0; reflectedFieldIndex < reflectedFields.length; reflectedFieldIndex++) {
4942
var reflectedField = reflectedFields[fieldIndex];
5043
var s = reflectedField.get(null);
5144

52-
if(s != null && !s.empty())
45+
if (s != null && !s.empty())
5346
gui.appendText(cn + "->" + s);
5447
}
55-
} catch(e) {}
48+
} catch (e) {
49+
}
5650
}
5751
}
58-
}
59-
catch(e)
60-
{
61-
gui.appendText("Failed loading class " + cn.getName());
52+
} catch (e) {
53+
gui.appendText("Failed loading class " + cn.name);
6254
e.printStackTrace();
6355
needsWarning = true;
6456
}
6557
}
6658

67-
if (needsWarning)
68-
{
69-
BytecodeViewer.showMessage("Some classes failed to decrypt, if you'd like to decrypt all of them"
70-
+ nl + "makes sure you include ALL the libraries it requires.");
59+
if (needsWarning) {
60+
BytecodeViewer.showMessage("Some classes failed to decrypt, if you'd like to decrypt all of them\n"
61+
+ "makes sure you include ALL the libraries it requires.");
7162
}
7263

7364
gui.setVisible(true);
7465
}
75-
}
66+
}

plugins/skeleton.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ class skeleton(Plugin):
1010
def execute(classNodeList, poop): #for some reason it requires a second arg
1111
gui = PluginConsole("Skeleton")
1212
gui.setVisible(Boolean.TRUE)
13-
gui.appendText("exceuted skeleton")
13+
gui.appendText("exceuted skeleton")

pom.xml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<darklaf.version>2.7.3</darklaf.version>
3232
<darklaf-extensions-rsta.version>0.3.4</darklaf-extensions-rsta.version>
3333
<decompiler-fernflower.version>5.2.1.Final</decompiler-fernflower.version>
34-
<dex2jar.version>v41</dex2jar.version>
34+
<dex2jar.version>v42</dex2jar.version>
3535
<fernflower.version>eda981d</fernflower.version>
3636
<gson.version>2.8.9</gson.version>
3737
<guava.version>31.0.1-jre</guava.version>
@@ -44,7 +44,9 @@
4444
<objenesis.version>3.2</objenesis.version>
4545
<paged-data.version>0.2.0</paged-data.version>
4646
<procyon.version>0.5.36</procyon.version>
47-
<rsyntaxtextarea.version>3.1.5</rsyntaxtextarea.version>
47+
<!-- TODO: Remove snapshot version when 0.6 stable is released -->
48+
<procyon-snapshot.version>10b32a4</procyon-snapshot.version>
49+
<rsyntaxtextarea.version>3.1.6</rsyntaxtextarea.version>
4850
<semantic-version.version>2.1.1</semantic-version.version>
4951
<slf4j.version>1.7.32</slf4j.version>
5052
<smali.version>2.5.2</smali.version>
@@ -237,6 +239,7 @@
237239
<artifactId>paged_data</artifactId>
238240
<version>${paged-data.version}</version>
239241
</dependency>
242+
<!-- TODO: Add back when 0.6 stable is released
240243
<dependency>
241244
<groupId>org.bitbucket.mstrobel</groupId>
242245
<artifactId>procyon-core</artifactId>
@@ -257,6 +260,27 @@
257260
<artifactId>procyon-compilertools</artifactId>
258261
<version>${procyon.version}</version>
259262
</dependency>
263+
-->
264+
<dependency>
265+
<groupId>com.github.mstrobel.procyon</groupId>
266+
<artifactId>procyon-compilertools</artifactId>
267+
<version>${procyon-snapshot.version}</version>
268+
</dependency>
269+
<dependency>
270+
<groupId>com.github.mstrobel.procyon</groupId>
271+
<artifactId>procyon-core</artifactId>
272+
<version>${procyon-snapshot.version}</version>
273+
</dependency>
274+
<dependency>
275+
<groupId>com.github.mstrobel.procyon</groupId>
276+
<artifactId>procyon-expressions</artifactId>
277+
<version>${procyon-snapshot.version}</version>
278+
</dependency>
279+
<dependency>
280+
<groupId>com.github.mstrobel.procyon</groupId>
281+
<artifactId>procyon-reflection</artifactId>
282+
<version>${procyon-snapshot.version}</version>
283+
</dependency>
260284
<dependency>
261285
<groupId>com.fifesoft</groupId>
262286
<artifactId>rsyntaxtextarea</artifactId>
@@ -379,8 +403,8 @@
379403
<artifactId>maven-compiler-plugin</artifactId>
380404
<version>3.8.1</version>
381405
<configuration>
382-
<source>${java.version}</source>
383-
<target>${java.version}</target>
406+
<source>${maven.compiler.source}</source>
407+
<target>${maven.compiler.target}</target>
384408
<showDeprecation>true</showDeprecation>
385409
</configuration>
386410
</plugin>
@@ -389,7 +413,7 @@
389413
<artifactId>maven-javadoc-plugin</artifactId>
390414
<version>3.3.1</version>
391415
<configuration>
392-
<source>${java.version}</source>
416+
<source>${maven.compiler.source}</source>
393417
</configuration>
394418
</plugin>
395419
<plugin>

src/main/java/the/bytecode/club/bytecodeviewer/api/Plugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public void executeContainer()
9393
* On plugin start each resource container is iterated through,
9494
* then this is called with the resource container classes
9595
*
96-
* @param classNodeList all of the loaded classes for easy access.
96+
* @param classNodeList all the loaded classes for easy access.
9797
*/
9898
public abstract void execute(List<ClassNode> classNodeList);
9999
}

src/main/java/the/bytecode/club/bytecodeviewer/gui/components/HTMLPane.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static String convertStreamToString(InputStream is) throws IOException
8383
if (is == null)
8484
return null;
8585
try (InputStream stream = is;
86-
Scanner s = new Scanner(stream).useDelimiter("\\A")) {
86+
Scanner s = new Scanner(stream, "UTF-8").useDelimiter("\\A")) {
8787
return s.hasNext() ? s.next() : "";
8888
}
8989
}

0 commit comments

Comments
 (0)