Skip to content

yourcatismine/RandomStuff

Repository files navigation

JAR Decompiler Tool

A professional C++ utility for inspecting and decompiling Java JAR files, designed for developers and security researchers who need to analyze compiled Java applications.

Features

  • Comprehensive Inspection: Extracts and lists all files within a JAR archive
  • Configuration Detection: Automatically identifies plugin.yml and pom.xml files
  • Resource Extraction: Safely extracts all resources to a dedicated folder
  • Source Code Decompilation: Uses CFR (Class File Reader) to decompile Java bytecode to readable source code
  • Clean Output Structure: Organizes decompiled code, resources, and metadata in a structured dump folder
  • Cross-Platform: Built with Windows compatibility in mind, using standard C++ libraries

Requirements

  • Operating System: Windows (uses Windows-specific APIs)
  • Java Runtime Environment (JRE): Version 8 or higher (for CFR decompiler)
  • CFR Engine: cfr_engine.jar must be present in the same directory as the executable
  • C++ Compiler: MSVC or MinGW with C++17 support

Installation

  1. Download or clone the repository

  2. Ensure cfr_engine.jar is placed in the executable directory

  3. Compile the source code:

    g++ decompiler/Decompiler.cpp -o decompiler.exe -std=c++17

    Or using MSVC:

    cl /EHsc /std:c++17 decompiler\Decompiler.cpp /link /out:decompiler.exe

Usage

Command Line

decompiler.exe "path/to/your/file.jar"

Interactive Mode

decompiler.exe

When run without arguments, the tool will prompt for the JAR file path.

Output Structure

The tool creates a _dump folder alongside the input JAR with the following structure:

yourfile_dump/
├── file_list.txt          # Complete list of all files in the JAR
├── resources/             # Extracted resources (configs, assets, etc.)
│   ├── plugin.yml         # Plugin configuration (if present)
│   ├── pom.xml           # Maven configuration (if present)
│   └── ...               # All other extracted files
└── source_code/           # Decompiled Java source files
    ├── com/
    ├── org/
    └── ...               # Package structure

Examples

Decompiling a Minecraft Plugin

decompiler.exe "plugins/MyAwesomePlugin.jar"

This will create plugins/MyAwesomePlugin_dump/ with:

  • Extracted plugin.yml showing plugin metadata
  • Decompiled source code revealing plugin logic
  • All resource files (languages, configs, etc.)

Analyzing a Shaded JAR

decompiler.exe "lib/shaded-library.jar"

For shaded JARs (where dependencies are bundled), the tool will:

  • Warn if no plugin.yml is found (common in libraries)
  • Extract all embedded resources
  • Decompile all classes including shaded dependencies

Troubleshooting

"Jar not found" Error

  • Verify the JAR file path is correct and quoted if it contains spaces
  • Ensure the file exists and is accessible

CFR Decompilation Fails

  • Confirm cfr_engine.jar is in the same directory as the executable
  • Check that Java is installed and in your PATH
  • Try running java -version to verify Java installation

No plugin.yml Found

  • This is normal for library JARs or shaded applications
  • Check file_list.txt for actual contents
  • The tool will still extract resources and decompile classes

Technical Details

  • Decompiler Engine: Uses CFR (https://www.benf.org/other/cfr/) for high-quality Java decompilation
  • File Handling: Uses C++17 filesystem library for robust path operations
  • Memory Management: Efficient extraction and decompilation process
  • Error Handling: Comprehensive error checking and user feedback

License

This project is provided as-is for educational and development purposes. Please ensure compliance with applicable laws and software licenses when decompiling third-party JAR files.

Contributing

Contributions are welcome. Please ensure code follows C++ best practices and includes appropriate error handling.

Version History

  • v9: Current version with improved inspection and resource extraction
  • Enhanced file listing and configuration detection
  • Better error handling and user feedback c:\Users\User\system\Documents\SystemManagement\README.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published