PDA

View Full Version : pUnity - Unity game file precompressor


Razor12911
06-03-2018, 16:10
This was originally a test tool, reason it was not posted here was the fact that I left that decision to the person who helped make it in the first place, my reason was the fact that it uses temps at its current state and I hate those so there is literary no point in posting it, it doesn't come with internal diff maker so there is a chance the restored file might have crc mismatch meaning xdelta has to be used, it's also slow af due to the settings used plus also it doesn't come with multi threading for stream restoration, there is no stdio and it doesn't work on all Unity files, headers are not the same for some versions.

Decided to post it since a few people seem interested in it.

JustFun
06-03-2018, 16:13
Nice tool honestly, cause there are a lot of games that use unity and tool like this really really comes in handy, one cane only hope that this one will get updated eventually :D

78372
06-03-2018, 19:51
Let me make something clear about pUnity so people don't get trouble using it.

1. pUnity doesn't work for every unity games. Only 5.5.x games are supposed to work with pUnity.
2. pUnity can't search for archives in your games which means you can't use it in a method chain (Ex: pUnity+msc+srep+lolz), that's not possible at all. You need to use seperately on unity archives.
3. Always verify your files
4. If you want to implement it in a real repack installer, you need to include a bat/cmd file or something like that to restore files and you may need to use ISExec to show progress and xdelta to keep crc as Razor12911 said
5. Using the correct liblz4.dll that was used for compression in the first place could fix crc mismatch and the xdelta part can be skipped.

ZakirAhmad
06-03-2018, 20:53
thanks man..

Andu21
08-03-2018, 06:25
Thanks, it's a shame it doesn't work on prior versions.

I have at least two games that use 5.2.x and all they do is this.

Unity 5.x precompressor v0.1

Created by Razor12911

Exception: Cannot process input
Unity 5.x precompressor v0.1

Created by Razor12911

EAccessViolation: Access violation at address 004D493F in module 'pUnity.exe'. Read of address 00000000

KaktoR
08-03-2018, 06:33
^I think the same.

elit
09-03-2018, 14:11
I always thought Unity files are not compressed because I could read within them in plain text. That said, if its lz4 it mean hell to keep up and maintain, as you know we both have our fair experience and opinions about anything coming from Yann Collet - especially lz4 :).

That said, why not just update ztool which already have infrastructure, lz4 support, is stable and can do stdio?

panker1992
09-03-2018, 17:53
because lz4 is heavily modded compressor, you can even call lz4 an anarchy tool!!

many engines use custom headers and if you try to decomp a version below the original one you will get crc error !!

ZakirAhmad
09-03-2018, 18:57
I always thought Unity files are not compressed because I could read within them in plain text. That said, if its lz4 it mean hell to keep up and maintain, as you know we both have our fair experience and opinions about anything coming from Yann Collet - especially lz4 :).

That said, why not just update ztool which already have infrastructure, lz4 support, is stable and can do stdio?

Razor cant unpdate ztool, becase he deleted the source code. pzlib too.
He has to start from scratch.

elit
10-03-2018, 07:21
because lz4 is heavily modded compressor, you can even call lz4 an anarchy tool!!

many engines use custom headers and if you try to decomp a version below the original one you will get crc error !!
Yes but that would go for ztool as well. I was thinking long time already about it, one solution could be to have set of dll's and call them depending on input parameters, then also regarding block structure this could be controlled by input params as well, for example:

ztool:dll3.1:crc1:crcu:bhd = use dll version 3.1, block checksum on(blocks contain checksum), checksum precede block(checksum is at the beginning of block), block header is located at the end of block(down). In the end most of games streams are about blocks with or without metadata. It wont cover everything but I think its a good start. Also in case of no block metadata one could specify precise parameters, like in case of FitGirl's XCOM2 WotCH for oodle which is precisely: codec 8 level 4 block 2. And so on, just some ideas.

Razor cant unpdate ztool, becase he deleted the source code. pzlib too.
He has to start from scratch.
Oh my, is this really true? Such a loss, sigh...

elit
10-03-2018, 07:28
One more thing about lz4, during my modding I tried many/most versions available to find the most accurate compression match. Byte comparing I found that there is usually set of versions that are compatible, then next set and so on. For example if I recall <r126, r126-131, v1.7.3 - v1.7.4(or 1.7.5), v1.8.0+ and so on. So you dont need every single version probably 3-4 currently is enough to process most games. The one I made mod for required r131 but I could use any from that range.

TheGeekyGamer
13-08-2018, 00:50
Unity 5.x precompressor v0.1

Created by Razor12911

Exception: liblz4.dll not loaded
Unity 5.x precompressor v0.1

Created by Razor12911

Exception: liblz4.dll not loaded
Press any key to continue . . .

i have placed the liblz4.dll beside pUnity.exe but still it does not work...???

Shateiel
14-08-2018, 03:50
Unity 5.x precompressor v0.1

Created by Razor12911

Exception: liblz4.dll not loaded
Unity 5.x precompressor v0.1

Created by Razor12911

Exception: liblz4.dll not loaded
Press any key to continue . . .

i have placed the liblz4.dll beside pUnity.exe but still it does not work...???

Same architecture?

TheGeekyGamer
14-08-2018, 07:11
Same architecture?
Are you talking about the architecture of dll.I am using the same liblz4 dll present in this punity 7z file. And i think it should work as shown in the pic by razor19211. I tried using xtool's liblz4 but i get the same error. And both these dlls are different in sizes....

Shateiel
14-08-2018, 10:07
Are you talking about the architecture of dll.I am using the same liblz4 dll present in this punity 7z file. And i think it should work as shown in the pic by razor19211. I tried using xtool's liblz4 but i get the same error. And both these dlls are different in sizes....

Not sure then, try testing it in different directory.