Skip to main content

A command-line tool to extract and repack Unity asset bundles using UnityPy.

Project description

UBT (Unity Bundle Tool)

A powerful, user-friendly command-line tool to extract and repack Unity asset bundles. Built with Python and UnityPy.

Developer: minhmc2007


Installation

Install the tool directly from PyPI:

pip install unity-bundle-tool

Usage

Once installed, you can use the ubt command from your terminal.

Extract a Bundle

ubt extract path/to/your/asset.bundle path/to/output_folder/

This will create:

output_folder/
├── manifest.json           # Asset tracking manifest
├── Textures/              # PNG files from Texture2D/Sprite assets
├── TextAssets/            # TXT/bytes files from TextAsset objects
├── MonoBehaviours_JSON/   # JSON files from MonoBehaviour typetrees
├── MonoBehaviours_DAT/    # Raw binary data from MonoBehaviours
├── AudioClips/            # WAV or raw audio files
└── OtherAssets/           # Generic binary data from other asset types

Repack a Bundle

After modifying files, repack them into a new bundle:

ubt repack path/to/output_folder/ path/to/new_repacked.bundle

Important: The input directory must contain the manifest.json file created during extraction. The original bundle file referenced in the manifest must still exist and be accessible.

Features

  • Extract Unity bundle files to organized directory structure
  • Support for multiple asset types:
    • Textures (Texture2D, Sprite) → PNG files
    • Text Assets → TXT/bytes files
    • MonoBehaviours → JSON (typetree) or DAT (raw binary)
    • Audio Clips → WAV or raw audio data
    • Generic Assets → Raw binary data
  • Repack modified assets back into Unity bundle format
  • Automatic file sanitization and organization
  • Detailed manifest tracking for reliable repacking

Asset Type Support

Asset Type Extraction Format Repacking Support
Texture2D/Sprite PNG ✅ Yes
TextAsset TXT/bytes ✅ Yes
MonoBehaviour (with typetree) JSON ✅ Yes
MonoBehaviour (raw) DAT binary ⚠️ Limited
AudioClip WAV/raw audio ⚠️ Limited
Other types Raw binary ⚠️ Limited

Workflow

  1. Extract a bundle to examine and modify assets
  2. Modify the extracted files as needed:
    • Edit PNG images in image editors
    • Modify text files
    • Edit JSON files for MonoBehaviour data
  3. Repack the modified assets into a new bundle

Important Notes

  • Keep the original bundle file: Repacking requires the original bundle as a template
  • Preserve file structure: Don't move files between the organized subdirectories
  • Manifest dependency: The manifest.json file is essential for repacking
  • Binary compatibility: Some asset modifications may not work depending on Unity version and asset complexity
  • Backup your files: Always keep backups of original bundles before modification

Error Handling

The script includes comprehensive error handling for:

  • Corrupted or protected bundle files
  • Missing dependencies
  • Invalid file paths
  • Asset processing failures
  • Repacking inconsistencies

Limitations

  • MonoBehaviour repacking from raw DAT files has limited reliability
  • AudioClip repacking may not preserve original compression formats
  • Some Unity-specific asset formats may not be fully supported
  • Protected or encrypted bundles cannot be processed

Command Line Help

ubt --help
ubt extract --help
ubt repack --help

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unity_bundle_tool-1.0.0.tar.gz (45.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unity_bundle_tool-1.0.0-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file unity_bundle_tool-1.0.0.tar.gz.

File metadata

  • Download URL: unity_bundle_tool-1.0.0.tar.gz
  • Upload date:
  • Size: 45.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for unity_bundle_tool-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7b212e820f444c4d40eba0d14cf1bcd47c0fffad147e3581e8975a93ee9185bd
MD5 2335f802ff4b02b618050e20070d16c9
BLAKE2b-256 db73bdf49667e7c3aaecdd868c5bb7da28e6cbb85bda0c8f7dd4d3f31d3551eb

See more details on using hashes here.

File details

Details for the file unity_bundle_tool-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for unity_bundle_tool-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5a22f73a9ee1ef373db2676427e56d3f5764476db4d2f0fe3dbf7c2af32882f
MD5 17a1fac36564e8293174729fee2fdff7
BLAKE2b-256 2d6239dc86c737708747568c55e7a4a8872774eff3467c2204fb7c93d7637f85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page