Unity - Convert CustomAssetBundles to WebPayer (.unity3d), OR prefab extraction?

Doubts, help and support about QuickBMS and other game research tools
ruprecht
Posts: 4
Joined: Sat Jan 16, 2021 2:37 am

Unity - Convert CustomAssetBundles to WebPayer (.unity3d), OR prefab extraction?

Post by ruprecht »

I'm new to QuickBMS and will soon be spending time learning how it and the couple of Unity-related scripts work, but in the meantime I thought I would pose the questions here and possibly save myself some work.

So I'm stuck using Unity 3.2 in trying to modify an existing product. The assets are in the format of cached webplayer files, having filenames similar to 'CustomAssetBundle-376a9dc2d037e414a8ababbaccc4f396'. I would like to either be able to directly convert these file into the compressed webplayer assetbundle format which have extension .unity3d ...... or as an alternative, if I can make QuickBMS extract prefab assets along with the other assets it already supports, I can recreate the assetbundles myself from the extracted source assets.

I have already tried tools such as DevX Unpacker....most of these tools either do not support prefab extraction, or they do not support asset formats as old as Unity 3.2

I would appreciate any helpful comments.....if what I would like to do is impossible with QuickBMS, I would like to know before I invest a lot of time figuring out how to use this tool.


Update: I played around with QuickBMS and the unity webplayer script. Extraction works great, but what I really need is to be able to go the other direction....so I tried the reimport batch file. And then I got this error: "Error: script invalid for reimporting, it uses MEMORY_FILEs". So I guess I can't use the webplayer script to reimport, but surely there must be a way to convert from CustomAssetBundle back to the .unity3d format.
ruprecht
Posts: 4
Joined: Sat Jan 16, 2021 2:37 am

Re: Unity - Convert CustomAssetBundles to WebPayer (.unity3d), OR prefab extraction?

Post by ruprecht »

No one was forthcoming with any assistance, so I managed to write my own solution with QuickBMS scripts. There may have been a cleaner way to implement, but since I'm a noob with QuickBMS, I just went with what got me to the desired results faster.

I've attached the scripts and supporting files. You need to copy the quickbms.exe file into the same folder as the CAB2U3D.bat. To convert, just drag your CAB file onto the CAB2U3D.bat file.....the resulting converted file will be named out.unity3d
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Unity - Convert CustomAssetBundles to WebPayer (.unity3d), OR prefab extraction?

Post by aluigi »

yeah reimporting is not possible because the whole archive is compressed instead of each single file as usually happens with other game archives.

In this case splitting the script in two separate scripts is a possible choice:
- script1 decompresses the archive
- script2 extracts the files

script2 can then used for reimporting while recompressing the archive is a bit more complicated and prone to errors (maybe the web player will refuse it).

Anyway it's good that you found a working solution.
Since you used lzma for the compression job, please note that quickbms supports recompressors too, example:

Code: Select all

comtype lzma86head_compress
get SIZE asize
clog "new.dat" 0 SIZE SIZE
ruprecht
Posts: 4
Joined: Sat Jan 16, 2021 2:37 am

Re: Unity - Convert CustomAssetBundles to WebPayer (.unity3d), OR prefab extraction?

Post by ruprecht »

aluigi wrote:...

Anyway it's good that you found a working solution.
Since you used lzma for the compression job, please note that quickbms supports recompressors too, example:

Code: Select all

comtype lzma86head_compress
get SIZE asize
clog "new.dat" 0 SIZE SIZE


Thanks for the info. Yes, I figured there probably was some kind of internal lzma compression function available, but I figured that it would be quicker for me to just use the command line version rather than spend more time trying to figure out how to make the internal one work correctly. As I mentioned earlier, I was just trying to get the job finished ASAP, wasn't so concerned about making things perfect. ;)