ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Tue Oct 27, 2020 12:04 pm

All times are UTC




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Jul 24, 2020 6:52 pm 

Joined: Fri Jul 24, 2020 6:47 pm
Posts: 2
Hi,

I have been trying to decompress the PVRTC4bpp found in ATF texture (.atf) file but without success. The documentation here https://www.adobe.com/devnet/archive/fl ... edheader_2 implies it is LZMA and from the forum posting, it would seem to match LZMA86DEC:

Code:
00000000: 4154 4600 0000 ff03 0002 1fcc 0c0a 0a0b  ATF.............
00000010: 0000 0000 0000 0000 0000 0662 5d00 0010  ...........b]...
00000020: 0000 006e 9847 1814 cd7d 3240 9416 8d99  ...n.G...}2@....
00000030: 9479 b6de fc50 3f73 1421 7453 6fa4 f1ce  .y...P?s.!tSo...
00000040: d1c4 51cd 9e6c 2492 754d 37ec 4500 579d  ..Q..l$.uM7.E.W.
00000050: 1ca7 5994 beeb a092 3493 04ba e1fe de7f  ..Y.....4.......
00000060: ab00 9291 ad13 67a2 110e 67d9 170f a74a  ......g...g....J
00000070: ad44 4149 f716 254c ce00 facb 5ddc b4ba  .DAI..%L....]...
00000080: 87b9 71a2 f069 ff0a 3ca1 a48c b2e4 5cb2  ..q..i..<.....\.
00000090: e277 ac2c fd4f de6a 3824 c3cc 7de4 ea60  .w.,.O.j8$..}..`


But when I tried to extract it with the following script:

Code:
idstring "ATF"
endian big
get NAME basename
string NAME += "_data.atf"
get FSIZE threebyte

if FSIZE != 0 #double check if new ATF format
   print "ATF file in wrong format"
   cleanexit
endif

get FF byte
get VERSION byte

if FF != 255
   print "Wrong reserved byte"
   cleanexit
endif

if VERSION != 3
   print "Unsupported version"
   cleanexit
endif

get SIZE long

get FORMAT byte
get WIDTH byte
get HEIGHT byte
get COUNT byte

if FORMAT != 0x0c
   print "Unsupported format %FORMAT%"
   cleanexit
endif

get DXT1DataLength long
get DXT1ImageDataLength long
get PVRTCTopDataLength long
comtype lzma86dec
SavePos POS
clog "dump.dat" POS PVRTCTopDataLength 10000000


It produces the following error:

Code:
- open input file /Users/fmoraes/Downloads/shot.atf
- open script ATF3.bms
- set output folder shot_pvr

  offset   filesize   filename
--------------------------------------
  0000001c 10000000   dump.dat

Error: the compressed LZMA input is wrong or incomplete (0)
Info:  algorithm   18
       offset      0000001c
       input size  0x00000662 1634
       output size 0x00989680 10000000
       result      0xffffff9c -100

Error: the uncompressed data (-100) is bigger than the allocated buffer (10000000)
       It usually means that data is not compressed or uses another algorithm

Last script line before the error or that produced the error:
  46  clog "dump.dat" POS PVRTCTopDataLength 10000000


I am attaching the file in question if someone can help figure out how to decompress it. It was produced by png2atf with lossy compression and it should have 2 LZMA sections plus the color data in JPEG-HR.


Attachments:
shot.zip [133.41 KiB]
Downloaded 26 times
Top
   
PostPosted: Wed Jul 29, 2020 9:34 pm 

Joined: Fri Jul 24, 2020 6:47 pm
Posts: 2
Well, it seems like the uncompressed size needs to be calculated based on the dimensions of the image from the header: https://github.com/adobe/dds2atf/issues/5


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited