Classpy is a GUI tool for investigating Java class file, Lua binary chunk, Wasm binary code, and other binary file formats.

Overview

Classpy

Classpy is a GUI tool for investigating Java class file, Lua binary chunk, Wasm binary code, and other binary file formats.

Inspiration

This tool is mainly inspired by javap and JavaClassViewer. I reinvent the wheel for the following two reasons:

1. Learn Java class file format and bytecode through parsing it
2. Try JavaFX 8

Features

  • Understands class files described by JVMS9
  • Supports Lua 5.3 binary chunk format
  • Supports Wasm binary format
  • Supports Bitcoin raw block and transaction format
  • Displays parsed binary file as tree and hex text
  • The corresponding hex text is highlighted when you select a tree node

Quick Start

Just for macos with brew

  • Install
brew tap guxingke/repo && brew install classpy
  • Try
    • open default gui window
    classpy
    • open gui window with args
    HelloWorld.java $JAVA_HOME/bin/javac HelloWorld.java classpy HelloWorld.class">
    echo "public class HelloWorld { public static void main(String[] args) { System.out.println(\"Hello World\"); } }" > HelloWorld.java
    $JAVA_HOME/bin/javac HelloWorld.java
    
    classpy HelloWorld.class

Requirements

Java 15 (checkout branch java8 if you stuck on Java 8)

Build

cd path/to/classpy
./gradlew fatJar
# java -jar path/to/classpy/classpy-gui/build/libs/classpy-fat-jar-0.10.0.jar

Run

cd path/to/classpy
./gradlew run

Screenshots

Screenshot1 Screenshot2 Screenshot3 Screenshot4

Comments
  • brew安装报错

    brew安装报错

    执行 brew tap guxingke/repo && brew install classpy

    Error: classpy: /usr/local/Homebrew/Library/Taps/guxingke/homebrew-repo/Formula/classpy.rb:10:@8' is not allowed as an instance variable name /usr/local/Homebrew/Library/Taps/guxingke/homebrew-repo/Formula/classpy.rb:10: syntax error, unexpected end-of-input, expecting end depends_on :[email protected] `

    1. brew doctor 检查没有错误
    2. 系统版本11.5.1
    opened by zexho994 5
  • 对Class文件中的Long类型解析错误

    对Class文件中的Long类型解析错误

    如题,Java源码如下所示:

    package jvmgo.book.ch03;
    
    public class ClassFileTest {
        
        public static final boolean FLAG = true;
        public static final byte BYTE = 123;
        public static final char X = 'X';
        public static final short SHORT = 12345;
        public static final int INT = 123456789;
        public static final long LONG = 12345678901L;
        public static final float PI = 3.14f;
        public static final double E = 2.71828;
        
        public static void main(String[] args) throws RuntimeException {
            System.out.println("Hello, World!");
        }
        
    }
    

    对于其中的public static final long LONG = 12345678901L;进行解析是,在常量池中,这个12345678901L解析出现错误。错误截图如下所示: Snipaste_2020-05-04_17-28-36 javap -v的结果如下所示: Snipaste_2020-05-04_17-30-20

    opened by MrBear2018 3
  • Can't read jar file when there are spaces in path

    Can't read jar file when there are spaces in path

    当读取的jar包的路径中包含空格时,会读取失败

    loading file:/C:/Program%20Files/Java/jre1.8.0_121/lib/rt.jar...
    java.nio.file.FileSystemNotFoundException: C:\Program%20Files\Java\jre1.8.0_121\lib\rt.jar
    	at com.sun.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:120)
    	at com.sun.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:117)
    	at java.nio.file.FileSystems.newFileSystem(FileSystems.java:326)
    	at java.nio.file.FileSystems.newFileSystem(FileSystems.java:276)
    	at com.github.zxh.classpy.gui.jar.JarTreeLoader.load(JarTreeLoader.java:15)
    

    改动后可以读取了,不确定是否是个bug,以下是java版本

    $ java -version
    java version "1.8.0_121"
    Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
    
    opened by hgaol 1
  • Parsing failure when the class file size is too large

    Parsing failure when the class file size is too large

    In my Mac(JDK 1.8.0_40), InputStream.read(byte[]) read 8192 bytes at most. When the class file size is greater than 8192 bytes, it will get parsing failure.

    opened by c19354837 1
  • 修复打开 module-info.class 失败的问题

    修复打开 module-info.class 失败的问题

    根据 jvms §4.7.25 对于 requires_version_index 的描述,当不存在依赖项版本信息时,requires_version_index 的值为 0。 classpy 目前总是试图在常量池中以 requires_version_index 为索引获取版本信息,这导致打开绝大多数 module-info.class 文件时都会产生 NullPointerException,这个 pr 修复了这个问题。

    opened by Glavo 0
  • [fix bug] use '((long) high_bytes << 32) + low_bytes' to calculate bits

    [fix bug] use '((long) high_bytes << 32) + low_bytes' to calculate bits

    According tojvmS8 4.4.5. The CONSTANT_Long_info and CONSTANT_Double_info Structures

    We need to use '((long) high_bytes << 32) + low_bytes' to calculate 'bits'.

    But for right now, the project is using '((long) high_bytes << 32) | low_bytes':

    ConstantLongInfo.java:

        @Override
        protected String loadDesc(ConstantPool cp) {
            long high = super.getUInt("high_bytes");
            long low = super.getUInt("low_bytes") & 0xffffffffL;
            long l = high << 32 | low;
            return String.valueOf(l);
        }
    

    ConstantDoubleInfo.java:

        @Override
        protected String loadDesc(ConstantPool cp) {
            long high = super.getUInt("high_bytes");
            long low = super.getUInt("low_bytes") & 0xffffffffL;
            double d = Double.longBitsToDouble(high << 32 | low);
            return String.valueOf(d);
        }
    
    opened by ghost 0
  • Can't work on MacOS.

    Can't work on MacOS.

    When I try Command: brew tap guxingke/repo

    It shows:

    ==> Tapping guxingke/repo Cloning into '/usr/local/Homebrew/Library/Taps/guxingke/homebrew-repo'... remote: Enumerating objects: 44, done. remote: Counting objects: 100% (4/4), done. remote: Compressing objects: 100% (3/3), done. remote: Total 44 (delta 0), reused 2 (delta 0), pack-reused 40 Unpacking objects: 100% (44/44), done. Error: Invalid formula: /usr/local/Homebrew/Library/Taps/guxingke/homebrew-repo/Formula/classpy.rb classpy: /usr/local/Homebrew/Library/Taps/guxingke/homebrew-repo/Formula/classpy.rb:10: `@8' is not allowed as an instance variable name /usr/local/Homebrew/Library/Taps/guxingke/homebrew-repo/Formula/classpy.rb:10: syntax error, unexpected end-of-input, expecting end depends_on :[email protected] ^ Error: Cannot tap guxingke/repo: invalid syntax in tap!

    opened by thtTNT 1
  • Not working on macOS

    Not working on macOS

    brew tap guxingke/repo && brew install classpy

    $ java --version
    java 15.0.1 2020-10-20
    Java(TM) SE Runtime Environment (build 15.0.1+9-18)
    Java HotSpot(TM) 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)
    
    $ classpy hello.class
    Error: Could not find or load main class com.github.zxh.classpy.gui.ClasspyApp
    Caused by: java.lang.NoClassDefFoundError: javafx/application/Application
    
    opened by Stxr 2
Releases(v0.7)
Owner
null
Library for converting from one Java class to a dissimilar Java class with similar names based on the Bean convention

Beanmapper Beanmapper is a Java library for mapping dissimilar Java classes with similar names. The use cases for Beanmapper are the following: mappin

null 25 Sep 7, 2022
A exploit to remotely check if a chunk is loaded.

InteractCordExploit (NoCom) A exploit to remotely check if a chunk is loaded which has been automated to create heatmaps and find chunks with active p

null 26 Aug 18, 2022
Bank Statement Analyzer Application that currently runs in terminal with the commands: javac Application.java java Application [file-name].csv GUI coming soon...

Bank Statement Analyzer Application that currently runs in terminal with the commands: javac Application.java java Application [file-name].csv GUI coming soon...

Hayden Hanson 0 May 21, 2022
Java SQL (JDBC) code generator with GUI. SQL and OOP finally united.

jSQL-Gen Java SQL (JDBC) code generator with GUI. SQL and OOP finally united. Usage Install the latest release. Create a database, tables and their co

Osiris-Team 6 Sep 5, 2022
code to the rat i give to people if u want to change the webhook its in "src/main/java/github/quantizr/autogg/guis/gui" please just dont sell my rat :(

SkyblockRat My rats code join my discord! https://discord.gg/bbK6ndHqN6 i got tired of people asking "is it double hooked?!" so here is my rats code y

null 3 Sep 24, 2022
With react-native-update-in-app library you can easily implement in-app updates in your React Native app using CDN or any other file server

React Native In-App update With react-native-update-in-app library you can easily implement in-app updates in your React Native app using CDN or any o

Nepein Andrey 5 Aug 24, 2022
Java agent that enables class reloading in a running JVM

Welcome to Spring-Loaded What is Spring Loaded? Spring Loaded is a JVM agent for reloading class file changes whilst a JVM is running. It transforms c

Spring 2.7k Sep 30, 2022
Android application made during an introduction class to mobile application development.

Reflex Revolution Android application made during an introduction class to mobile application development. Contributors Hailey Savoie Carter Moore Fre

Frederic Verret 3 Aug 27, 2022
The MeterRegistryHolder class is designed to hold MeterRegistry as a static field.

MeterRegistryHolder The MeterRegistryHolder class is designed to hold MeterRegistry as a static field. Goal The goal is to simplify using MeterRegistr

Tomasz Fijałkowski 4 Sep 20, 2022
Translating texts via Youdao eco-freely in only one class

Youdao4J Translating texts via Youdao Translator by one class. Need GSON. Usage Youdao4J did lots of works in the background. DO NOT create morr Youda

iceBear 9 Jun 15, 2022
1.7 - 1.18 utility class that allows you to change blocks at blazing fast speeds

BlockChanger 1.7 - 1.18 utility class that allows you to change blocks at blazing fast speeds Setup Just import the class to your project. Usage Playe

null 20 Sep 19, 2022
A simple and lightweight Minecraft GUI API for developers to use.

Current Version: 1.0.0 Requirements: - You must be using PaperMC or a fork of it (This will not work with just Spigot/Bukkit! - Curently this API only

Sammy Aknan 2 May 14, 2022
GalaxyCDC is a core component of PolarDB-X which is responsible for global binary log generation, publication and subscription.

中文文档 What is ApsaraDB GalaxyCDC ? GalaxyCDC is a core component of PolarDB-X which is responsible for global binary log generation, publication and su

null 53 Sep 13, 2022
Java GUI Frontend for XCH Forks

ForkFarmer Java GUI Frontend for XCH Forks. Discord: https://discord.gg/Mx9ZNHta Requires JRE 1.8 or greater to run: https://www.java.com/en/download/

null 39 Sep 15, 2022
The Download Manager uses a simple yet effective GUI interface built with java’s Swing libraries

The Download Manager uses a simple yet effective GUI interface built with java’s Swing libraries.The use of Swing gives the interface a crisp, modern look and feel. The GUI maintains a list of downloads that are currently being managed.

Manish Kumar Mahawar 2 Jan 2, 2022
NeverScapeAlone! Instantly match with other players and take the hassle out of finding partners for bosses, minigames, skills, pking, and more!

NeverScapeAlone An Old School RuneScape Matchmaking Plugin on RuneLite! Tired of having to scour friend's chats, discords, and forums to find friends

null 14 Sep 2, 2022
A Sentry SDK for Java, Android and other JVM languages.

Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoy

Sentry 882 Sep 27, 2022
A fun mini project in Java. Uses Interface, Inheritance, and other OOP concepts

Sequences---Arithmetic-and-Geometric A fun mini project in Java. Uses Interface, Sorting, Inheritance, and other OOP concepts About this project: This

Urjit Aich 2 Feb 18, 2022
Hotels Management System - JavaFX GUI Application

Hotels Management System Hotels Management System - JavaFX Application Does this repo deserve a star? I hope that. Let's talk about what can my progra

Samer Al-Sa'dawi 22 Aug 29, 2022