Skip to content

Latest commit

 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Metadata Decryptor

License: MIT

A Python script to automatically extract and decrypt global-metadata.dat embedded in libunity.so. Made specifically for Standoff 2.

Important

This project will no longer be updated publicly on GitHub for the foreseeable future.
Reasons include limited personal time and my preference not to publish work that I consider unfinished or suboptimal.

Additionally, the nature of this project makes continued public development impractical.

The project will remain closed source. For updates on the project, see https://t.me/michel_m_yaps

Features

  • Automatic extraction of the embedded global-metadata.dat pointer from the ELF relocation table.
  • Heuristic-based decryption to reconstruct all metadata fields.
  • No reference metadata needed to decrypt the current one.
  • A lot faster and easier compared to manual decryption.
  • Cross‑platform (any OS with Python 3.x and file‑system access).

Prerequisites

  • Python 3.x

  • Install required packages via pip:

    pip install tqdm pyelftools

Installation

  1. Clone this repository (or download metadata_decryptor.py).
  2. Ensure Python 3.x is on your PATH.
  3. Install dependencies as shown above.

Usage

Run the script against a libunity.so binary that contains an embedded global-metadata.dat:

python metadata_decryptor.py --libunity path/to/libunity.so --output path/to/output-metadata.dat
  • --libunity Path to the libunity.so ELF file.
  • --output Destination path (file or directory) for the decrypted metadata.

Example:

python metadata_decryptor.py --libunity ./libunity.so --output ./decrypted-metadata.dat

On success, you’ll see a confirmation message and a file containing the reconstructed metadata.

How It Works

  1. Locates metadata pointer in the ELF relocation table by scanning for the known hex pattern.
  2. Reads raw metadata bytes until a 256‑byte zero marker is found, signalizing it's end.
  3. Saves the intermediate metadata to a file for debugging purposes.
  4. Identifies candidate offsets by checking for 4‑byte alignment and four zero bytes before them.
  5. Filters offset–size pairs by matching sums against other offsets.
  6. Uses heuristic search to identify each offset and append each section in order.
  7. Writes the final output to the specified path.

Troubleshooting

  • Error: No candidate found.
    The relocation table didn’t yield the expected pattern. Make sure you selected the right files, and if the script still fails, open an issue.

  • Invalid ELF header
    Verify you pointed at the correct libunity.so (it must start with the ELF magic bytes).

  • Unexpected offsets count
    If the script finds ≠29 fields, the heuristics may need adjustment for the new version. Feel free to open an issue.

Contribution

Contributions, issues, and feature requests are welcome!
Feel free to fork the repo, open an issue, or submit a pull request.

License

This project is licensed under the MIT License. See LICENSE for details.

About

Extractor and decryptor of the global-metadata.dat from libunity.so. Uses heuristic search algorithms to reconstruct the data

Resources

Stars

81 stars

Watchers

9 watching

Forks

Contributors

Languages