Skip to content

briannosaurus/Aves

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Build Latest Version Build develop

Aves

A Minecraft deobfusctor / code generator

Generates deobfuscated code based on the emitted obfuscation files from mojang (since 19w36a) in 5 minutes

platform independent no local installation of Minecraft required

Requirements

  • You can only use the generated code under mojang's license:
    (c) 2019 Microsoft Corporation. All rights reserved. This information is provided "as-is" and you bear the risk of using it. This information does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this information for your internal, reference purposes. Microsoft makes no warranties, express or implied, with respect to the information provided here.
  • Recommended: 1.5-2 GB of RAM for the decompiler

Download

Get the latest release

Why?

This project is designed for people that want to quickly take a look at a part of the code and understand what is going on.

This is very useful e.g.
- for quickly inspecting new versions
- if you find a bug and want to know what causes it
- if you are just interested in how things work πŸ˜„
No need to rely on someone else to release new mappings or versions.

The generated code is not perfect, but it's readable and that's what it's meant for.

The project trys to work as automated as possible.
So if mojang doesn't do any (breaking) changes, it should work a long time πŸ¦–

Usage / How to run it

  • Supported versions: 1.14.4 or >=19w36a (1.15+)

Example

  • Basic example for commandline/shell:
    Aves.exe -v 1.14.4
    Description: Creates source code for 1.14.4 (by default: client only)

Folder structure

.
β”œβ”€β”€β”€ javgent-standalone.jar          # Deobfuscator β†’ see https://github.com/BaseMC/javgent
β”œβ”€β”€β”€ avesflower.jar                  # Decompiler β†’ see https://github.com/BaseMC/avesflower
β”œβ”€β”€β”€ jre                             # Embedded Java Runtime Environment β†’ see https://adoptopenjdk.net/
β”œβ”€β”€β”€ logs                            # Generated log files (if enabled)
└─┬─ workingDir                      # Main Working Directory
  β”œβ”€β”€β”€ version_manifest.json         # Version Manifest (Lookup for all versions)
  └─┬─ 1.14.4                        # <version> Version Working Directory (here: 1.14.4)
    β”œβ”€β”¬β”€ raw                         # Raw files
    β”‚ β”œβ”€β”€β”€ package.json              # Version-Manifest (looked up from version_manifest.json)
    β”‚ └─┬─ client                    # <variant> variant (here: client)
    β”‚   └── client.jar               # Executable jar file (looked up from package.json)
    β”œβ”€β”¬β”€ mappings                    # Mapping files
    β”‚ └─┬─ client                    
    β”‚   └── client.txt               # Client-Mappings (looked up from package.json)
    β”œβ”€β”¬β”€ patch                       # Generated patch files
    β”‚ └─┬─ client                    
    β”‚   β”œβ”€β”€ *.json                   # PatchFiles (generated from mapping-file: client.txt)
    β”œβ”€β”¬β”€ deof                        # Deobfuscated files
    β”‚ └─┬─ client                   
    β”‚   └── client.jar               # Deobfuscated file (Obfuscated names, fixed stuff like: avm β†’ Zombie)
    β”œβ”€β”¬β”€ dec                         # Decompiled files
    β”‚ └─┬─ client                    
    β”‚   └── client.jar               # Decompiled file; files are getting decompiled to human-readable form
    └─┬─ output                      # human-readable Source-Code
      └─┬─ client                    
        β”œβ”€β”€ *                        # SourceFiles; unzipped disassmebled source.jar (client.jar)

More detailed description

Execution-Modes

1. Run it over commandline (only)

πŸ‘‰ --help

Argument Meaning Example
-l --logfile logs additionally to a logfile
generated under logs
-l
--version Shows the current Aves version and does nothing else -version
Example output: Aves 1.0.7364.40087
Format: <Name> <MainVersion>.<SubVersion>.<DaysSince2000>.<SecondsSinceMidnight/2> β†’ see also
--genconf <value> only generates a json-Config file
value = JSON-Config file to generate
--genconf config.json
-c <value> --conf <value> load a json-Config file
value = JSON-Config file (see below)
-c config.json (uses a file called config.json for configuration)
-v --mcversion Required (if using no json file for configuration)
Version that should be downloaded
-v "1.14.4" (generates files for 1.14.4)
-j --java Path to java.exe (Java11+)
default: path to included jre
experimental:
If not set, will be automatically searched in either the Environment-Variable %JAVA_HOME%(Windows) / $JAVA_HOME(Linux/Mac) or over the command where java (Windows, Linux, Mac)
-j "C:\Program Files\Java\openjdk-11.0.2\bin\java.exe"
-p --profiles Given profiles/variants, that should be used
Overrides the Enabled-property in the json
-p client server -p client
2. Run it over JSON-Configuration

To get more customizable profiles or templates you can use a json file as configuration.

If you want to generate a config file, use --genconf <Path> <optional:additionalParameters>.
It's also possible to combine it with some parameters from above, e.g. -j or -v.

auto-generated file: --genconf config.json

{
  "ResolveOverNetwork": true,
  "RemoteManifestJsonURL": "https://launchermeta.mojang.com/mc/game/version_manifest.json",
  "SuppressManifestDownload": "00:05:00",
  "ManifestJsonFilePath": "version_manifest.json",
  "TryKeepExisting": true,
  "NetworkIncludeClientLibs": false,
  "NetworkIncludeLogging": false,
  "Version": null, //this must be set by hand or calling the program next time with -v
  "VersionSrcJson": "package.json",
  "VariantConfigs": [
    {
      "Enabled": true,
      "Name": "client",
      "Key": "client",
      "SrcJar": "client.jar",
      "MappingKey": "client_mappings",
      "MappingFile": "client.txt",
      "PatchFile": "client.txt",
      "ExcludedComponents": [
        "net/minecraft/gametest/"
      ],
      "DeObfuscatedFile": "client.jar",
      "DecompiledFile": "client.jar",
      "OutputFilesDirFolder": "client"
    },
    {
      "Enabled": false,
      "Name": "server",
      "Key": "server",
      "SrcJar": "server.jar",
      "MappingKey": "server_mappings",
      "MappingFile": "server.txt",
      "PatchFile": "server.txt",
      "ExcludedComponents": [
        "net/minecraft/gametest/",
        "com/google/",
        "io/netty",
        "it/unimi/",
        "javax/",
        "joptsimple/",
        "org/apache"
      ],
      "DeObfuscatedFile": "server.jar",
      "DecompiledFile": "server.jar",
      "OutputFilesDirFolder": "server"
    }
  ],
  "MakeJavaCompatible": true,
  "JavaExePath": "jre\\bin\\java.exe",
  "Deobfuscator": null,
  "DeobfuscatorTimeout": "00:05:00",
  "BaseDeobfuscatorCommand": "-jar \"{Deobfuscator}\" -s \"{SrcJar}\" -m \"{PatchFile}\" -o \"{DeObfuscatedFile}\"",
  "Decompiler": null,
  "DecompilerTimeout": "00:30:00",
  "BaseDecompileCommand": "-jar \"{Decompiler}\" -dgs=1 -rsy=1 -lit=1 -mpm=60 \"{SrcFile}\" \"{TargetDir}\"",
  "WorkingDirectory": "workingDir",
  "VersionWorkingDirectory": null,
  "RawDirectory": "raw",
  "MappingFilesDir": "mappings",
  "PatchFilesDir": "patch",
  "DeObfuscatedDirectory": "deof",
  "DecompiledDirectory": "dec",
  "OutputDirectory": "output",
  "OutputDirectoryMetaFiles": "output-meta",
  "OutputDirLibs": "libs",
  "OutputDirLogging": "logging"
}

If you also want to set server to enabled (by default it isn't), use --genconf ... -p client server

πŸ‘‰ For more detailed description of the configuration options take a look at the documentation of the corresponding source files

3. Run it as hybrid πŸ”€

You can also use a json-Configuration with some commandline arguments, e.g. if you like to use a different version.
Note that only the variants in the .json-file are used

Example using the json from above:
-c config.json -v 19w36a

Build

Don't want to use the official releases?
Build the project yourself:

Requirements

Build an executable

  • Open a new commandline / shell in the repository-root
  • Build the project dotnet build
  • Select the subfolder Aves (main project) and create an executable with dotnet publish -r <TargetedRuntime(OS)Identifier> -p:PublishSingleFile=true
  • Go back into the root, select ADB and publish it dotnet publish -c Release
  • Copy the generated content (e.g. ADB/bin/Debug/netcoreapp3.1/publish) into the build folder
  • Run ADB.exe -r <TargetedRuntime(OS)Identifier> --bc <YourConfiguration(Release/Debug)>

Nested projects

Develop

Tools for developing

Get required external files for Aves

Aves requires some external files, e.g. a JVM, a deobfuscator and a decompiler

  • Build ADB with configuration Debug (with Release it would need a GITHUB_TOKEN)
  • Copy config-dev.json into your ADB build output folder (e.g. ADB/bin/Debug/netcoreapp3.1)
  • Run in the ADB build output folder: ADB.exe -c config-dev.json -r <yourSystemRID>
    • You can get the corresponding RID here
      Most common:
      • win-x64 Windows 64bit
      • linux-x64 Linux 64bit
      • osx-x64 Mac OS X 64bit
  • Copy all files from the generated dev folder directly into your Aves build output folder (e.g. Aves/bin/Debug/netcoreapp3.1)

⚠️ Notes

  • The files are usually kept until a (forced) rebuild is carried out
  • You should update this files regularly

About

MC Code generator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%