comtype xmemdecompress get name basename log MEMORY_FILE 0 0 goto 0x10 get chunks long append for i = 0 < chunks get zsize short get size short if size = 0 math size = 0x10000 endif get offset long math offset + 0x13 clog MEMORY_FILE offset zsize size next i append get size asize MEMORY_FILE log name 0x00 size MEMORY_FILE
Anyone please help me decompress those files from ps4. Many thanks!
yes and no. Basically they are just "segs" files with a "ZLDR" magic at the beginning, so it's enough to strip the first 8 bytes and it's done. But there is a problem with the obtained segs file because it uses lzma compression instead of deflate (no problem here) and some chunks can't be decompressed for some unknown reasons not depending by the algorithm or quickbms, the first byte of the lzma stream should be 0 or 1 while it's a "random" number in these particular chunks. So both this and the segs scripts have been updated but you can't extract the data.
aluigi wrote:yes and no. Basically they are just "segs" files with a "ZLDR" magic at the beginning, so it's enough to strip the first 8 bytes and it's done. But there is a problem with the obtained segs file because it uses lzma compression instead of deflate (no problem here) and some chunks can't be decompressed for some unknown reasons not depending by the algorithm or quickbms, the first byte of the lzma stream should be 0 or 1 while it's a "random" number in these particular chunks. So both this and the segs scripts have been updated but you can't extract the data.
aluigi wrote:yes and no. Basically they are just "segs" files with a "ZLDR" magic at the beginning, so it's enough to strip the first 8 bytes and it's done. But there is a problem with the obtained segs file because it uses lzma compression instead of deflate (no problem here) and some chunks can't be decompressed for some unknown reasons not depending by the algorithm or quickbms, the first byte of the lzma stream should be 0 or 1 while it's a "random" number in these particular chunks. So both this and the segs scripts have been updated but you can't extract the data.
goto 0x400 get files long getdstring dummy 0xc math extoffset = files math extoffset * 4 math extoffset + 0x410 for i = 0 < files get name basename #get name2 basename log MEMORY_FILE 0 0 put i byte MEMORY_FILE goto 0x00 MEMORY_FILE getvarchr index MEMORY_FILE 0 get offset long savepos TMP get nextoffset long math nextoffset - offset math offset + 0x400 goto extoffset getdstring ext 3 get dummy byte savepos extoffset goto TMP #string name + "/" #string name + name2 string name + "_" string name + index string name + "." string name + ext if ext = "MDT" log name offset nextoffset endif next i