Convert Figma logo to code with AI

Konloch logobytecode-viewer

A Java 8+ Jar & Android APK Reverse Engineering Suite (Decompiler, Editor, Debugger & More)

14,592
1,138
14,592
96

Top Related Projects

40,878

Dex to Java decompiler

12,202

Tools to work with android .dex and java .class files

6,287

smali/baksmali

1,993

This is the public repository for the CFR Java decompiler

13,917

A standalone Java Decompiler GUI

Quick Overview

Bytecode Viewer is an open-source Java bytecode viewer, editor, and decompiler. It provides a powerful GUI for analyzing and modifying Java class files, JAR archives, and Android APK files. The tool combines multiple decompilers and disassemblers to offer comprehensive analysis capabilities.

Pros

  • Integrates multiple decompilers (e.g., Procyon, CFR, FernFlower) for better code analysis
  • Supports various file formats, including Java class files, JAR, and Android APK
  • Offers a user-friendly GUI with syntax highlighting and search functionality
  • Includes features like bytecode editing, malware analysis, and obfuscated code analysis

Cons

  • Can be resource-intensive, especially when analyzing large files
  • May have occasional stability issues or crashes with complex files
  • Learning curve for advanced features and understanding bytecode
  • Some features may require additional setup or external tools

Getting Started

  1. Download the latest release from the GitHub repository.
  2. Ensure you have Java 8 or higher installed on your system.
  3. Run the JAR file using the command:
    java -jar BytecodeViewer.jar
    
  4. Open a Java class file, JAR, or APK file using the "File" menu or drag-and-drop.
  5. Explore the decompiled code, bytecode, and other analysis options in the GUI.

Note: For advanced features or plugin development, refer to the project's documentation on GitHub.

Competitor Comparisons

40,878

Dex to Java decompiler

Pros of jadx

  • More actively maintained with frequent updates
  • Supports decompilation of Android APK files directly
  • Offers a clean, modern GUI with syntax highlighting and search functionality

Cons of jadx

  • Limited to Java and Android-specific decompilation
  • May struggle with heavily obfuscated code compared to Bytecode Viewer

Code Comparison

jadx:

public class DecompilerDriver {
    public static void main(String[] args) {
        JadxArgs jadxArgs = new JadxArgs();
        jadxArgs.setInputFile(new File(args[0]));
        JadxDecompiler jadx = new JadxDecompiler(jadxArgs);
        jadx.load();
        jadx.save();
    }
}

Bytecode Viewer:

public class BytecodeViewerDriver {
    public static void main(String[] args) {
        BytecodeViewer.start(args);
        BytecodeViewer.openFiles(new File[]{new File(args[0])});
        BytecodeViewer.viewer.setVisible(true);
    }
}

Both tools serve as Java decompilers, but jadx focuses on Android APK decompilation with a streamlined interface, while Bytecode Viewer offers a broader range of features for general Java bytecode analysis. The code examples demonstrate the simplicity of jadx's API compared to Bytecode Viewer's more comprehensive approach.

12,202

Tools to work with android .dex and java .class files

Pros of dex2jar

  • Focused specifically on converting DEX to JAR files, making it more lightweight and efficient for this task
  • Provides command-line tools for easier integration into automated workflows
  • Supports batch processing of multiple DEX files

Cons of dex2jar

  • Limited functionality compared to Bytecode Viewer's comprehensive feature set
  • Lacks a graphical user interface, which may be less user-friendly for some users
  • Does not include built-in decompilation or code analysis tools

Code Comparison

dex2jar:

d2j-dex2jar classes.dex -o output.jar

Bytecode Viewer:

java -jar bytecode-viewer.jar
// Then use GUI to open and analyze DEX files

Summary

dex2jar is a specialized tool for converting DEX to JAR files, offering command-line functionality and batch processing. It's lightweight and efficient but lacks the comprehensive features of Bytecode Viewer. Bytecode Viewer provides a GUI and includes decompilation and analysis tools, making it more user-friendly for in-depth bytecode examination. The choice between the two depends on the specific needs of the user and the complexity of the analysis required.

6,287

smali/baksmali

Pros of smali

  • Specialized tool focused on disassembling and assembling Android's dex format
  • Lightweight and efficient for specific Android-related tasks
  • Integrates well with other Android reverse engineering tools

Cons of smali

  • Limited to Android dex files, not as versatile for other bytecode formats
  • Lacks a graphical user interface, which may be less user-friendly for some users
  • Doesn't provide as comprehensive analysis features as Bytecode Viewer

Code Comparison

smali:

.method public onCreate(Landroid/os/Bundle;)V
    .locals 1
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
    const v0, 0x7f030001
    invoke-virtual {p0, v0}, Lcom/example/MyActivity;->setContentView(I)V
    return-void
.end method

Bytecode Viewer:

public void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    this.setContentView(2130903041);
}

Note: Bytecode Viewer provides decompiled Java code, while smali shows the disassembled smali code.

1,993

This is the public repository for the CFR Java decompiler

Pros of CFR

  • Specialized in Java decompilation, offering more accurate results for complex Java bytecode
  • Lightweight and can be easily integrated into other tools or workflows
  • Actively maintained with frequent updates and improvements

Cons of CFR

  • Limited to Java decompilation, unlike Bytecode Viewer's support for multiple languages
  • Lacks a graphical user interface, which may be less user-friendly for some users
  • Does not include built-in analysis tools or plugins found in Bytecode Viewer

Code Comparison

CFR:

java -jar cfr.jar MyClass.class

Bytecode Viewer:

java -jar bytecode-viewer.jar

Summary

CFR is a specialized Java decompiler that excels in accuracy and can be easily integrated into other tools. It's lightweight and frequently updated. However, it lacks the multi-language support and graphical interface of Bytecode Viewer. CFR is ideal for users focused solely on Java decompilation and comfortable with command-line tools, while Bytecode Viewer offers a more comprehensive suite of features for analyzing bytecode across multiple languages with a user-friendly interface.

13,917

A standalone Java Decompiler GUI

Pros of jd-gui

  • Lightweight and focused solely on Java decompilation
  • Simple and intuitive user interface
  • Fast performance for quick decompilation tasks

Cons of jd-gui

  • Limited functionality compared to Bytecode Viewer's extensive feature set
  • Lacks support for multiple decompilers and bytecode analysis tools
  • No built-in bytecode editor or compiler

Code Comparison

jd-gui (decompiled output):

public class Example {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

Bytecode Viewer (bytecode view):

public static void main(java.lang.String[]);
    Code:
       0: getstatic     #2                  // Field java/lang/System.out:Ljava/io/PrintStream;
       3: ldc           #3                  // String Hello, World!
       5: invokevirtual #4                  // Method java/io/PrintStream.println:(Ljava/lang/String;)V
       8: return

Bytecode Viewer offers a more comprehensive view of the bytecode, while jd-gui focuses on providing a clean, decompiled Java source code. Bytecode Viewer's multi-view approach allows users to analyze both the decompiled source and the underlying bytecode simultaneously, making it a more powerful tool for in-depth analysis and reverse engineering tasks.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Bytecode Viewer

Bytecode Viewer - a lightweight user-friendly Java/Android Bytecode Viewer, Decompiler & More.

New Features

  • Draggable tabs
  • Patched CVE-2022-21675 (Make sure to upgrade to v2.11.X)
  • Dark mode by default with multiple themes
  • Translated into over 30 languages including: Arabic, German, Japanese, Mandarin, Russian, Spanish
  • Plugin Writer - create and edit external plugins from within BCV
  • Fixed Java & Bytecode editing/compiling
  • Tabbed plugin console
  • Right-click menus on the resource and search panels
  • Javap disassembler
  • XAPK support
  • Latest dependencies (incl. decompilers like CFR, JD-GUI etc.)
  • Added support to Java files compiled using JDK > 13
  • Migrated to Maven

Links

Key Features

  • Simply drag and drop to decompile and search Java Jars & Android APKs
  • File format support for: Class, Jar, XAPK, APK, DEX, WAR, JSP, Image Resources, Text Resources & More
  • 6 Built-in Java decompilers: Krakatau, CFR, Procyon, FernFlower, JADX, JD-GUI
  • 3 Built-in Bytecode disassemblers, including 2 assemblers: Krakatau and Smali/BakSmali
  • APK/DEX Support from Dex2Jar and Enjarify
  • Built-in Java Compiler
  • Advanced static-search functionality
  • Customizable UI
  • Plugins + Script Engine Design
  • Malicious code scanning API
  • Translated Into over 30 Languages Including: Arabic, German, Japanese, Mandarin, Russian, Spanish)
  • Export functionality as Runnable Jar, Zip, APK, Decompile All As Zip, Etc.
  • And more! Give it a try for yourself!

Command Line Input

	-help                         Displays the help menu
	-clean                        Deletes the BCV directory
	-english                      Forces English language translations
	-list                         Displays the available decompilers
	-decompiler <decompiler>      Selects the decompiler, procyon by default
	-i <input file>               Selects the input file (Jar, Class, APK, ZIP, DEX all work automatically)
	-o <output file>              Selects the output file (Java or Java-Bytecode)
	-t <target classname>         Must either be the fully qualified classname or "all" to decompile all as zip
	-nowait                       Doesn't wait for the user to read the CLI messages

What is Bytecode Viewer?

Bytecode Viewer (BCV) is an Advanced Lightweight Java/Android Reverse Engineering Suite. Powered by several open source tools BCV is designed to aid in the reversing process.

BCV comes with 6 decompilers, 3 disassemblers, 2 assemblers, 2 APK converters, advanced searching, debugging & more.

It's written completely in Java, and it's open sourced. It's currently being maintained and developed by Konloch.

Is there a demo?

BCV Demo

Please note this demo is from a very old version

How do I install BCV?

Download the latest version from https://github.com/konloch/bytecode-viewer/releases and run the Bytecode-Viewer-2.10.x.jar. You may need to execute it via command line java -jar Bytecode-Viewer-2.10.x.jar (replace the X with the current minor version)

How can I use BCV?

  • Starting with a Jar, Zip, ClassFile or Android file (APK, DEX, XAPK, etc) drag it into BCV. It will start the decoding process automatically.
  • From here you can select the decompilers you would like to use by selecting the View Pane>View 1, View 2, View 3, etc.
  • The view panes are-used to display up to 3 decompilers side by side, you can also toggle edibility here.
  • Select the resource you would like to open by navigating using the resource list, BCV will do its best to display it (Decompiling, Disassembling, etc).
  • You can use plugins to help you search along with using the search pane in the left-hand bottom corner.

How do the plugins work?

There is also a plugin system that will allow you to interact with the loaded classfiles. You could for example write a String deobfuscator, a malicious code searcher, or anything else you can think of.

You can either use one of the pre-written plugins, or write your own. The plugin system supports java and javascript scripting.

Once a plugin is activated, it will execute the plugin with a ClassNode ArrayList of every single class loaded in BCV, this allows the user to handle it completely using ASM.

Instructions to compile

Just clone this repo and run mvn package. It's that simple!

Working on the source

Open the Maven project (e.g. in IntelliJ, open the pom.xml as a project file).

UI Is Lagging

Change the theme to your systems. Go into View->Visual Settings->Window Theme and select System Theme.

Java Heap Space Issues (java.lang.OutOfMemoryError)

Start BCV with more RAM, e.g. java -Xmx3G -jar BCV.jar

File Permission Issues (java.io.FileNotFoundException)

Right click on the jar file, go to Properties, and select Unblock under Security at the bottom of the General tab.

APK File Permission Issues (java.io.FileNotFoundException)

Run BCV as administrator.

Are you a Java Reverse Engineer? Do you want to learn?

Join The Bytecode Club Today! - https://the.bytecode.club