I'm trying to extract the 3D Models from the Godzilla game for PS3, which at the moment is only released in Japan. The game contains .pac files which can easily be extracted, but all of the files appear to be LZS compressed. The game apparently uses the PhyreEngine, if that information can be of any help.
Here's a link to all of the files I've extracted from ch01a_00.pac: http://www.mediafire.com/download/g1qd2 ... 282%29.rar
Any help decompressing these files would be appreciated!
Important information: this site is currently scheduled to go offline indefinitely by end of the year.
Godzilla PS3 LZS Compressed Files
Re: Godzilla PS3 LZS Compressed Files
It is not strange, yet it would have been talking about for a long time.
-
- VIP member
- Posts: 1330
- Joined: Wed Nov 05, 2008 12:16 pm
- Has thanked: 2710 times
- Been thanked: 884 times
Re: Godzilla PS3 LZS Compressed Files
it looks like aluigi's lzs bms script should decompress your samples but it goes off track somewhere
http://aluigi.altervista.org/bms/lzs.bms
*edit*
thanks to daemon1 for posting the source code that revealed the
byte swap so aluigi could fix the script to decompress properly
http://aluigi.altervista.org/bms/lzs.bms
*edit*
thanks to daemon1 for posting the source code that revealed the
byte swap so aluigi could fix the script to decompress properly
Code: Select all
# LZS (PSP_Nanoha) (script 0.1.1)
# script for QuickBMS http://quickbms.aluigi.org
quickbmsver "0.5.25"
idstring "LZS\0"
getdstring DUMMY 4
get OFFSET long
if OFFSET u> 0x10000
endian big
reverselong OFFSET
endif
get DICT_OFFSET long
get SIZE long
get ZSIZE long
getdstring DUMMY 8
get NAME string
goto DICT_OFFSET
math DICT_SIZE = ZSIZE
math DICT_SIZE -= DICT_OFFSET
getdstring DICT DICT_SIZE
comtype LZS_UNZIP DICT DICT_SIZE
math ZSIZE = DICT_OFFSET
math ZSIZE -= OFFSET
encryption swap 16 #this line was the fix
clog NAME OFFSET ZSIZE SIZE
Last edited by Acewell on Sun Dec 18, 2016 1:42 pm, edited 1 time in total.
-
- MEGAVETERAN
- Posts: 2647
- Joined: Tue Mar 24, 2015 8:12 pm
- Has thanked: 65 times
- Been thanked: 2871 times
-
- veteran
- Posts: 113
- Joined: Mon Oct 13, 2014 6:54 am
- Has thanked: 52 times
- Been thanked: 19 times
Re: Godzilla PS3 LZS Compressed Files
Hey there! Would someone be able to perhaps take a look into these .pac files? Looking for a way to get at the assets inside... It appears to be using a different compression method to the NTSC version of the game, which I find interesting!
https://mega.nz/#F!nZ4V0TqC!sKjWNJu1VTrpkowRTa288Q
https://mega.nz/#F!nZ4V0TqC!sKjWNJu1VTrpkowRTa288Q
-
- VIP member
- Posts: 1330
- Joined: Wed Nov 05, 2008 12:16 pm
- Has thanked: 2710 times
- Been thanked: 884 times
Re: Godzilla PS3 LZS Compressed Files
what was the solution to the lzs compression so aluigi can fix his scriptdaemon1 wrote:Unpacked the files....
-
- MEGAVETERAN
- Posts: 2647
- Joined: Tue Mar 24, 2015 8:12 pm
- Has thanked: 65 times
- Been thanked: 2871 times
Re: Godzilla PS3 LZS Compressed Files
This is what I did:AceWell wrote:what was the solution to the lzs compression so aluigi can fix his script
I took the quickbms LZS code, and rewritten it looking at the file data. It was all done correct, as luigi's code describes. So I don't know why script is not working, maybe some endianess issue.
-
- VIP member
- Posts: 1330
- Joined: Wed Nov 05, 2008 12:16 pm
- Has thanked: 2710 times
- Been thanked: 884 times
Re: Godzilla PS3 LZS Compressed Files
i guess the byte order could be the problem here since the script follows the file structure
perfectly and ps3 files sometimes has big endian headers with little endian data
perfectly and ps3 files sometimes has big endian headers with little endian data
-
- MEGAVETERAN
- Posts: 2647
- Joined: Tue Mar 24, 2015 8:12 pm
- Has thanked: 65 times
- Been thanked: 2871 times
-
- VIP member
- Posts: 1330
- Joined: Wed Nov 05, 2008 12:16 pm
- Has thanked: 2710 times
- Been thanked: 884 times
Re: Godzilla PS3 LZS Compressed Files
Compressed files and methods
Godzilla PS3 LZS Compressed Files
i've spent more time than i care to admit trying to figure out why the bms script didn't work, which is why i am curiousall of the files appear to be LZS compressed....Any help decompressing these files would be appreciated!
about this elusive solution you have figured out, so to avoid spinning our tires further here i'll just go ahead and ask -
how did you decompress the files properly and can you post your code associated with this lzs decompression?
forget about the bms script, i'm asking how you solved the decompression, i'm sure it wasn't accidental.
-
- MEGAVETERAN
- Posts: 2647
- Joined: Tue Mar 24, 2015 8:12 pm
- Has thanked: 65 times
- Been thanked: 2871 times
Re: Godzilla PS3 LZS Compressed Files
sure i will post the code as soon as i get back home this evening
-
- MEGAVETERAN
- Posts: 2647
- Joined: Tue Mar 24, 2015 8:12 pm
- Has thanked: 65 times
- Been thanked: 2871 times
Re: Godzilla PS3 LZS Compressed Files
ok this is the code. First reading the header:
then reading the whole data block into memory:
and then decompressing it according to Luigi's code. Note that I was too lazy to make any checks present in his code.
in the end write output to file
As you can see, this code does exactly the same what LZS code from quickbmx does.
Code: Select all
fs.Seek(8, SeekOrigin.Begin);
int dataoff = br.ReadInt32();
int dictoff = br.ReadInt32();
int usize = br.ReadInt32();
int psize = br.ReadInt32();
Code: Select all
int datasize = (dictoff - dataoff) / 2;
fs.Seek(dataoff, SeekOrigin.Begin);
int[] data = new int[datasize + 16];
int tmp, flags;
for (int i = 0; i < datasize; i++)
{
tmp = br.ReadByte();
data[i] = (tmp << 8) + br.ReadByte();
}
Code: Select all
fs.Seek(dictoff, SeekOrigin.Begin);
byte[] outb = new byte[usize + 16];
int outs = 0;
int roff, rsize;
for (int i = 0; i < datasize; i++)
{
flags = data[i];
for (int j = 0; j < 16; j++)
{
if (((flags >> j) & 1) > 0)
{
// copy byte from dictionary
outb[outs++] = br.ReadByte();
}
else
{
// repeat already unpacked bytes
rsize = (data[i + 1] & 0x1f) + 2;
roff = (data[i + 1] >> 5);
for (int k = 0; k < rsize; k++, outs++) outb[outs] = outb[outs - roff];
i++;
}
}
}
Code: Select all
File.WriteAllBytes("out.bin", outb);