Skip to content

Commit ca1cad8

Browse files
committed
2.9.7 preview
1 parent 5f99089 commit ca1cad8

File tree

4 files changed

+99
-21
lines changed

4 files changed

+99
-21
lines changed

BytecodeViewer 2.9.7-preview.jar

1.86 MB
Binary file not shown.

src/resources/intro.html

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<html>Bytecode Viewer (BCV) was designed to be extremely user and beginner friendly, because of this almost everything is accessible through an interface, settings, tools, etc. This means if you give BCV a try you should get the gist of it can do, however for those who don't want to run BCV until they're convinced they should use it, below is a complete list of features BCV has, and what they do.
2+
3+
<h2>File:</h2>
4+
<ul>
5+
<li>Add (Ctrl + O) - If you add a jar/zip BCV will unzip it, if you add an APK or DEX file, BCV will run dex2jar then run the jar input process.</li>
6+
<li>New Workspace (Ctrl + N) - It clears the opened jars/resources.</li>
7+
<li>Run (Ctrl + R) - Runs the classfiles you've loaded into BCV in a secure sandboxed JVM instance that you can fully debug.</li>
8+
<li>Compile (Ctrl + T) - Tries to compile all of the editable panes you've selected, if it's Java it'll compile with Ranino. Krakatau and *Smali use their own assemblers.</li>
9+
<li>Save As Jar - Export the class files and loaded resources as a runnable Jar file.</li>
10+
<li>Save As DEX - Run jar2dex and export the Classfiles as DEX.</li>
11+
<li>Save Files As - Save all the Classfiles and resources as a zip.</li>
12+
<li>Save Java File As - Save the currently opened decompiled Classfile.</li>
13+
<li>Save Java Files As - Save all of the decompiled Classfiles as a zip.</li>
14+
<li>Recent Files - Last 25 files/directories you've opened with BCV.</li>
15+
<li>About - A small information window about BCV.</li>
16+
<li>Exit - Closes BCV.</li>
17+
</ul>
18+
19+
<h2>View Panes:</h2>
20+
<ul>
21+
<li>Editable - Defines if that viewing pane will be editable.</li>
22+
<li>None - Nothing will be displayed.</li>
23+
<li>Procyon - Decompiles with Procyon decompiler.</li>
24+
<li>CFR - Decompilers with CFR decompiler.</li>
25+
<li>FernFlower - Decompiles with FernFlower decompiler.</li>
26+
<li>JD-GUI - Decompiles with JD-GUI decompiler.</li>
27+
<li>Krakatau Java - Decompiles with Krakatau decompiler.</li>
28+
<li>Krakatau Bytecode - Disassembles with Krakatau disassembler.</li>
29+
<li>Smali - Disassembles with Smali.</li>
30+
<li>Bytecode - Decompiles the Bytecode via CFIDE. Not Editable.</li>
31+
<li>Hexcode - Shows the classfile in a hex viewer. Not Editable.</li>
32+
</ul>
33+
34+
<h2>Settings:</h2>
35+
<ul>
36+
<li>Compile On Save - If selected whenever you do one of the File>Save * functions it will try to compile before it saves.</li>
37+
<li>Compile On Refresh - If selected whenever you press refresh it compile before it reloads the resource/class.</li>
38+
<li>Update Check - If selected it queries https://github.com/Konloch/bytecode-viewer to ensure you've got the latest version.</li>
39+
<li>Refresh On View Change - If selected whenever you change an option in the View Panes it will refresh the currently opened resources/class.</li>
40+
<li>Decode APK Resources - If selected whenever you add an APK, it will first run APKTool.jar to decode the resources.</li>
41+
<li>Set Python 2.7 Executable - Set the Python 2.7 executable if you want Krakatau decompiler/disassembler/assembler to work.</li>
42+
<li>Set JRE RT Library - Set the JRE RT library for Krakatau decompiler.</li>
43+
</ul>
44+
45+
<h2>Plugins:</h2>
46+
<ul>
47+
<li>Open Plugin - Open a .java plugin created for BCV.</li>
48+
<li>Recent Plugins - Last 25 plugins you've opened with BCV.</li>
49+
<li>Code Sequence Diagram - Builds a crude code sequence diagram for the classfile that's currently opened.</li>
50+
<li>Malicious Code Scanner - Allows you to define what to search for, and outputs what it found.</li>
51+
<li>Show Main Methods - Detects and outputs all of the public static void main(String[]) functions.</li>
52+
<li>Show All Strings - Grabs then outputs all of the strings in every classfile.</li>
53+
<li>Replace Strings - Allows you to do a simple permanent .replace on the classfile strings, very useful for URL swapping.</li>
54+
<li>Allatori String Decrypter - Decrypts the Allatori obfuscated/encrypted strings.</li>
55+
<li>ZKM String Decrypter - Decrypts the ZKM obfuscated/encrypted strings.</li>
56+
<li>ZStringArray String Decrypter - Decrypts the ZStringArray obfuscated/encrypted strings.</li>
57+
</ul>
58+
59+
<h2>Notes:</h2>
60+
<ul>
61+
<li>If BCV fails to boot simply append -clean as an argument to clean the lib directory.</li>
62+
<li>Relax and take notes, while I take tokes of the marijuana smoke.</li>
63+
<li>BCV was created out of love for Java Reverse engineering.</li>
64+
<li>Bytecode Viewer's Homepage is http://bytecodeviewer.com</li>
65+
</ul>
66+
67+
</html>

src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,10 @@ public static void main(String[] args) {
356356
System.setSecurityManager(sm);
357357
try {
358358
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
359+
new BootScreen().DO_FIRST_BOOT(args);
359360
} catch (Exception e) {
360361
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
361362
}
362-
new BootScreen().DO_FIRST_BOOT(args);
363363
}
364364

365365
public static void BOOT(String[] args) {

src/the/bytecode/club/bytecodeviewer/gui/BootScreen.java

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class BootScreen extends JFrame {
5555

5656
private JProgressBar progressBar = new JProgressBar();
5757

58-
public BootScreen() {
58+
public BootScreen() throws IOException {
5959
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
6060
this.setIconImages(Resources.iconList);
6161
setSize(new Dimension(600, 800));
@@ -79,7 +79,7 @@ public BootScreen() {
7979
JEditorPane editorPane = new JEditorPane();
8080
editorPane.setEditorKit(new HTMLEditorKit());
8181

82-
editorPane.setText("http://www.icesoft.org/java/home.jsf");
82+
editorPane.setText(convertStreamToString(BytecodeViewer.class.getClassLoader().getResourceAsStream("resources/intro.html")));
8383

8484
scrollPane.setViewportView(editorPane);
8585

@@ -91,6 +91,15 @@ public BootScreen() {
9191
this.setLocationRelativeTo(null);
9292
}
9393

94+
static String convertStreamToString(java.io.InputStream is) throws IOException {
95+
@SuppressWarnings("resource")
96+
java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A");
97+
String string = s.hasNext() ? s.next() : "";
98+
is.close();
99+
s.close();
100+
return string;
101+
}
102+
94103
public void DO_FIRST_BOOT(String args[]) {
95104
this.setVisible(true);
96105
if(FIRST_BOOT)
@@ -208,26 +217,28 @@ public void DO_FIRST_BOOT(String args[]) {
208217
for(String s : libsFileList ) {
209218
if(s.endsWith(".jar")) {
210219
File f = new File(s);
211-
setTitle("Bytecode Viewer Boot Screen - Loading Library " + f.getName());
212-
System.out.println(f.getName());
213-
214-
JarFile jarFile = new JarFile(s);
215-
Enumeration<JarEntry> e = jarFile.entries();
216-
ClassPathHack.addFile(f);
217-
while (e.hasMoreElements()) {
218-
JarEntry je = (JarEntry) e.nextElement();
219-
if(je.isDirectory() || !je.getName().endsWith(".class")){
220-
continue;
221-
}
222-
try {
223-
String className = je.getName().substring(0,je.getName().length()-6);
224-
className = className.replace('/', '.');
225-
ClassLoader.getSystemClassLoader().loadClass(className);
226-
} catch(java.lang.VerifyError | java.lang.ExceptionInInitializerError | java.lang.IncompatibleClassChangeError | java.lang.NoClassDefFoundError | Exception e2) {
227-
//ignore
220+
if(f.exists()) {
221+
setTitle("Bytecode Viewer Boot Screen - Loading Library " + f.getName());
222+
System.out.println(f.getName());
223+
224+
JarFile jarFile = new JarFile(s);
225+
Enumeration<JarEntry> e = jarFile.entries();
226+
ClassPathHack.addFile(f);
227+
while (e.hasMoreElements()) {
228+
JarEntry je = (JarEntry) e.nextElement();
229+
if(je.isDirectory() || !je.getName().endsWith(".class")){
230+
continue;
231+
}
232+
try {
233+
String className = je.getName().substring(0,je.getName().length()-6);
234+
className = className.replace('/', '.');
235+
ClassLoader.getSystemClassLoader().loadClass(className);
236+
} catch(java.lang.VerifyError | java.lang.ExceptionInInitializerError | java.lang.IncompatibleClassChangeError | java.lang.NoClassDefFoundError | Exception e2) {
237+
//ignore
238+
}
228239
}
240+
jarFile.close();
229241
}
230-
jarFile.close();
231242
}
232243
}
233244
setTitle("Bytecode Viewer Boot Screen - Booting!");

0 commit comments

Comments
 (0)