Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProtoDump

License: GPL v3 Build Status Release

Reconstruct .proto schema files straight out of a compiled game binary, without needing debug symbols, an SDK, or the original source tree.

Scans one or more binaries for the exact byte signature protoc leaves behind when it serializes a FileDescriptorProto, validates each candidate by walking the raw wire format with no schema (via protobuf-net), then cross-links every discovered file's imports and type references and reconstructs readable .proto source - or dumps the full raw descriptor as JSON.

What it does

  • Byte-level descriptor scanning - finds embedded FileDescriptorProto messages by their marker byte, not by section tables or symbol names, so it works on stripped release binaries.
  • Wire-format validation - each candidate is delimited by walking the protobuf wire format with no schema, then fully deserialized; false positives self-heal a byte at a time instead of derailing the whole scan.
  • Cross-binary dependency resolution - pool several binaries into one run and imports/type references are resolved across the whole set. All-or-nothing: if anything is missing, nothing gets written.
  • Full .proto reconstruction - messages, nested types, enums, oneofs, services/rpc, extension ranges, and custom/extension options (via protobuf-net's IExtensible) rendered back to readable proto2/proto3 source.
  • Full-fidelity JSON dump - every discovered descriptor is also written as JSON with every field protoc produced, including reserved_range/reserved_name, which the .proto renderer can't reconstruct.
  • Per-module and combined output - results land in all/ (deduplicated across every binary) as well as one folder per source binary, so you can tell which module a schema actually came from.
  • Parallel multi-binary scanning - pass several binaries at once and they're scanned concurrently, one worker per binary.

Install

Grab an archive from the latest release:

Archive Needs .NET installed? Use when
ProtoDump-win-x64.zip No Windows, just run it
ProtoDump-linux-x64.zip No Linux, just run it
ProtoDump-win-x64-portable.zip .NET 10 runtime Windows, smaller download
ProtoDump-linux-x64-portable.zip .NET 10 runtime Linux, smaller download

Those links resolve once the first build lands on main and the pipeline cuts a release. On Linux, chmod +x ProtoDump after unzipping.

Usage

ProtoDump --binary=<path|glob>[,<path|glob>...] [options]
Flag Description
--binary=<path|glob> Path(s)/glob(s) of the binaries to scan (required); comma-separated or repeat the flag
--output-dir=<path> Directory to write results to (default: <first binary name>-proto)
--dump=<bool> Also write the raw, exact byte range of each successfully-delimited candidate to <name>.dump (default false)
-v, --version Print the version and exit

Examples:

# Single binary, output to ./client-proto/
./ProtoDump --binary=client.dll

# Multiple binaries pooled together for cross-file dependency resolution
./ProtoDump --binary=client.dll,server.dll,engine2.dll --output-dir=out

# Glob every DLL in a tree
./ProtoDump --binary='bin/**/*.dll' --output-dir=out

# Also keep the raw undecoded byte range of each candidate, for debugging
./ProtoDump --binary=client.dll --dump=true

Output layout

out/
├── all/                        # every discovered proto, deduplicated
│   ├── netmessages.proto
│   └── ...
├── client/                     # only the protos first found in client.dll
│   ├── usercmd.proto
│   └── ...
└── server/
    └── ...

Building from source

Requires the .NET 10 SDK.

git clone https://github.com/Swiftly-Tracker/ProtoDump.git
cd ProtoDump
dotnet build ProtoDump.slnx -c Release

Output lands in bin/Release/net10.0/.

To produce a standalone binary like the release archives:

dotnet publish ProtoDump.csproj -c Release \
  -r linux-x64 --self-contained true \
  -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishTrimmed=false \
  -o out/linux-x64

Architecture

ProtoDump/
└── src/
    ├── Entrypoint.cs          # CLI entry point: scan -> cross-file link -> render
    ├── Arguments.cs           # Flag parsing
    ├── DescriptorScanner.cs   # Byte-marker scan, wire-format boundary delimiting, validation
    ├── SchemaWriter.cs        # Cross-file import/type linking and .proto text rendering
    ├── ProtoSchema.cs         # descriptor.proto object model (protobuf-net contracts)
    └── Literals.cs            # String literal escaping

Community

Acknowledgements

All of the acknowledgements can be seen in ACKNOWLEDGEMENTS.md

License

GPL-3.0. See LICENSE.


Made with ❤️ by the Swiftly Development team

About

Dumping protobufs from binaries

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages