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
- Automatic extraction of the embedded
global-metadata.datpointer 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).
-
Python 3.x
-
Install required packages via pip:
pip install tqdm pyelftools
- Clone this repository (or download
metadata_decryptor.py). - Ensure Python 3.x is on your
PATH. - Install dependencies as shown above.
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--libunityPath to thelibunity.soELF file.--outputDestination path (file or directory) for the decrypted metadata.
Example:
python metadata_decryptor.py --libunity ./libunity.so --output ./decrypted-metadata.datOn success, you’ll see a confirmation message and a file containing the reconstructed metadata.
- Locates metadata pointer in the ELF relocation table by scanning for the known hex pattern.
- Reads raw metadata bytes until a 256‑byte zero marker is found, signalizing it's end.
- Saves the intermediate metadata to a file for debugging purposes.
- Identifies candidate offsets by checking for 4‑byte alignment and four zero bytes before them.
- Filters offset–size pairs by matching sums against other offsets.
- Uses heuristic search to identify each offset and append each section in order.
- Writes the final output to the specified path.
-
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 correctlibunity.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.
Contributions, issues, and feature requests are welcome!
Feel free to fork the repo, open an issue, or submit a pull request.
This project is licensed under the MIT License. See LICENSE for details.