Page 6 of 6

Re: Asphalt 8 .pig

Posted: Tue Aug 29, 2017 4:04 pm
by Dionyseuss
I'm trying to get some models out of Gameloft's Six Gun. Neither FBX2PIG or the max import script are working for me, presumably because they use a new file version.

Does anyone have an updated importer or a good workaround?

Re: Asphalt 8 .pig

Posted: Fri Sep 08, 2017 3:54 am
by Gta5KoRn
no updates for this?

Re: Asphalt 8 .pig

Posted: Thu Dec 21, 2017 1:42 pm
by Bigchillghost
The game had changed its compression algorithm ever since the last version that PIG2FBX could still handle. Its format didn't change too much whereas
the tricky part is to find the correct algorithm it uses.
You'll see the difference if you do a compare among different version of the game:

car_renault_clio_rs.pig(v1.5.0, where Chipicao's Gameloft Pig Importer still worked)

Code: Select all

Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
00000DE0   00 00 1D 00 63 61 72 5F  72 65 6E 61 75 6C 74 5F   ....car_renault_
00000DF0   63 6C 69 6F 5F 72 73 5F  64 66 5F 6E 6D 2E 74 67   clio_rs_df_nm.tg
00000E00   61 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   a...............
00000E10   00 00 00 00 70 0D 00 00  06 00 00 00 00 00 00 00   ....p...........
00000E20   77 07 14 03 F0 F8 FF 7F  77 07 07 00 5E 07 FF 7F   w.......w...^...
Geometry data size recorded as a LONG interger at 0xE14, which is 0xD70. The data start right after offset 0xE18.

car_renault_clio_rs.pig(v1.8.0, where Chipicao's PIG2FBX still worked)

Code: Select all

Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
00000DE0   00 00 1D 00 63 61 72 5F  72 65 6E 61 75 6C 74 5F   ....car_renault_
00000DF0   63 6C 69 6F 5F 72 73 5F  64 66 5F 6E 6D 2E 74 67   clio_rs_df_nm.tg
00000E00   61 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   a...............
00000E10   00 00 00 00 00 00 00 00  A7 08 00 00 A8 13 00 00   ................
00000E20   2A 0E 00 01 00 E0 77 07  14 03 F0 F8 FF 7F 77 07   *.....w.......w.
The data had been compressed with LZ4 algorithm since then. Zip size recorded at 0xE18 is 0x8A7 while the unzip size following it is 0x13A8.
Then the compressed data begin with a fixed header 2A 0E 00 01.

car_renault_clio_rs.pig(v3.3 above, which PIG2FBX doesn't support)

Code: Select all

Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
00000DE0   00 00 1D 00 63 61 72 5F  72 65 6E 61 75 6C 74 5F   ....car_renault_
00000DF0   63 6C 69 6F 5F 72 73 5F  64 66 5F 6E 6D 2E 74 67   clio_rs_df_nm.tg
00000E00   61 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   a...............
00000E10   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
00000E20   00 00 00 00 02 56 04 00  00 38 0D 00 00 26 B5 2F   .....V...8...&?.
00000E30   FD 80 38 0C 00 04 49 A2  50 77 07 14 03 F0 F8 FF   ..8...I.Pw......
The compression had changed to a different one. Zip size at offset 0xE25 is 0x456, while unzip size is 0xD38 followed by the compressed data starting with the fixed header 26 B5 2F FD.
You might notice that the unzip size is actually between 0xD70 and 0x13A8, about which I don't know why.

Edit:This is because some chunks such as tangents and binormals, as well as some sequence bytes, are removed. So
Its content is the same as the one whose size is 0xD70.

Re: Asphalt 8 .pig

Posted: Tue Jan 02, 2018 12:44 pm
by Bigchillghost
What I have found in libmyAndroid.so in the apk file:
shot.png

Re: Asphalt 8 .pig

Posted: Wed Jan 03, 2018 2:03 am
by Bigchillghost
It turns out the compression algorithm is zstd actually. I was fooled by those strings. Anyway should be easy to write a new tool to handle it now.

Re: Asphalt 8 .pig

Posted: Thu Jan 04, 2018 9:51 am
by Bigchillghost
Whoops...
Optimism now seems to premature. Face indicies are encrypted:
Faceindices.png
As far as just this small indicies buffer it seems to be some kind of offset-based encryptions, but for much larger buffer there're lots of FFFF where I can't see any regular pattern.

Again all come to a halt.

Re: Asphalt 8 .pig

Posted: Tue Jan 09, 2018 11:20 am
by Bigchillghost
Bigchillghost wrote:Again all come to a halt.
Never mind. Quite simple encryption.
bike_bmw_s_1000_rr.pig.png
Tools should be available soon. :)

Re: Asphalt 8 .pig

Posted: Sun Jan 21, 2018 4:00 pm
by Bigchillghost
Tools are released there.