FileForums (
-   Conversion Tutorials (
-   -   UBT | Unity Bundle Tool (

Masquerade 28-12-2021 12:14

UBT | Unity Bundle Tool
1 Attachment(s)
UBT | Unity Bundle Tool

Unity Bundle Tool is a software made by my friend, SowwyItsAnAlt, which I have been using in my repacks for a few months. With her permission, I have rewritten and polished the code and made a new executable which I am sharing here.

The function of this tool is the ability to decompress compressed Unity Asset Bundles and then recompress them to a close enough point in which a patch is possible (& viable!). I like to use HDiffZ because it gives the smallest patches. XDelta should work just fine (patch creation is significantly quicker than with HDiffZ although the patch file will be larger).

UBT is based on AssetTools.NET by nesrak1 and has compression support for both LZ4 and LZMA compression.


 █ Unity Bundle Tool | 10/02/21 █

 Usage: UBT.EXE <options> <infile> <outfile>


    -i      : List information about bundle file (only specify <infile>).
    -d      : Decompress bundle file.
    -c      : Compress bundle file (must specifiy use of LZ4 or LZMA).
    -credits : View credits.

 Example usage:

 UBT.EXE -i data.unity3d
 UBT.EXE -d data.unity3d decompressed_data.unity3d
 UBT.EXE -c lz4 decompressed_data.unity3d data.unity3d
 UBT.EXE -c lzma decompressed_data.unity3d data.unity3d

To prove just how well this tool works, I will demonstrate on the game "Poly Bridge 2" (which I do recommend you all try if you enjoy a good puzzle like myself). This game contains "data.unity3d" which is compressed via LZ4. The steps are:
  1. Decompress the bundle
  2. Compress the decompressed file using the same compression algo as what the original bundle was compressed with
  3. Use your patch program of choice to create a patch file between the new compressed file and the original compressed bundle.

    As we can see from the above image, the new file is so similar that our HDiffZ patch is less than 1mb in size! Now, in your repack installation, you simply include the decompressed file and compress it then patch it using the patch file after the archive is extracted. Easy!

    Of course, you don't need to patch the file, since Unity will read the file regardless - compressed or decompressed. The patch is simply for a 100% CRC perfect repack.

    Highlighted above is the function of the -d and -c option. Using -i will give the file size in bytes, MD5 and compression type used on the input file.

    This is a standalone tool and NOT for use with FreeArc.
Have fun and enjoy. Happy New Year.

Masquerade 10-02-2022 08:18

Update for 10/2/22 - UNLIMITED POWER! Update
  • UBT now works with bundles larger than 2GB.
  • AssetsTools.NET library upgraded from v2.0.9 to v2.0.11.
  • Significantly less memory usage for compression and decompression.

Masquerade 03-03-2022 13:37

*.CMS from Car Mechanic Simulator games are compressed Asset Bundles with LZ4, however devs changed the File Header so that the "U" in UnityFS is replaced with an S.

If you swap the S for a U, you can then decompress the bundles with UBT :)

L0v3craft 01-04-2022 06:30

Hi. Thank you very much for your work, but please, share an UBT.exe file that works with files larger than 2GB and that is not detected as a trojan. It is dected as virus by 44 on 67 antiviruses:

it is useless for repacks if the antivirus of the user deletes or blocks it.

Edit: testing it on the file data.unity3d from the game "TUNIC" and gives error in re-compression.

Masquerade 01-04-2022 11:47

Unprotected version:

Compiled + ILRepack

-tara 27-06-2022 22:07

whats happening here?
ran decomp on "data.unity3d" on a game called "Mango", the file is ~1.7 GB and is compressed with lz4, got an output of ~4 GB or so. Then compressed it using lz4 and the tool finished weirdly quick, after checking the output of the compression it was 300 Megs, then i tried running the game using this output as the "data.unity3d" and the game ran however every texture was purple, whats going on?

Masquerade 28-06-2022 01:00


Originally Posted by -tara (Post 497363)
whats going on?

I'm not sure, sorry.

Joe Forster/STA 29-06-2022 00:40


Originally Posted by -tara (Post 497363)
however every texture was purple

Just an idea: this purple is the transparent color in the textures but the compressor forgot to keep the transparency flag.

All times are GMT -7. The time now is 10:02.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Copyright 2000-2020, FileForums @