XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Sun Mar 26, 2017 2:58 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Godzilla PS3 LZS Compressed Files
PostPosted: Thu May 14, 2015 9:35 pm 
Offline
n00b
User avatar

Joined: Thu May 14, 2015 9:15 pm
Posts: 15
Has thanked: 7 times
Have thanks: 1 time

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!

You can make the ads go away by registering



Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Tue Aug 04, 2015 3:27 am 
Offline
veteran

Joined: Mon Oct 13, 2014 6:54 am
Posts: 83
Has thanked: 43 times
Have thanks: 2 times
Just wanted to bump this one to see if you, or anyone else had managed to get anywhere with this. The models in this game look fantastic!


Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Thu Sep 17, 2015 12:36 pm 
Offline
ultra-n00b

Joined: Thu Sep 17, 2015 12:26 pm
Posts: 2
Has thanked: 0 time
Have thanks: 0 time
It is not strange, yet it would have been talking about for a long time.

_________________
sbobet


Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Tue Nov 29, 2016 5:24 am 
Offline
VIP member
VIP member
User avatar

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 699
Has thanked: 1557 times
Have thanks: 346 times
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 :D
Code:
# 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

_________________
Noesis
Hex2obj
QuickBMS
TextureFinder
Unity Assets Bundle Extractor


Last edited by AceWell on Sun Dec 18, 2016 1:42 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Tue Nov 29, 2016 5:23 pm 
Offline
veteran

Joined: Mon Oct 13, 2014 6:54 am
Posts: 83
Has thanked: 43 times
Have thanks: 2 times
Would love to know what it is -- this game has EASILY the best and broadest selection of Godzilla models to date!


Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Wed Dec 14, 2016 5:56 pm 
Offline
double-veteran
double-veteran

Joined: Tue Mar 24, 2015 8:12 pm
Posts: 1060
Has thanked: 14 times
Have thanks: 424 times
Unpacked the files. Now getting models
Image

textures
Image

and skeletons
Image


Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Wed Dec 14, 2016 9:53 pm 
Offline
veteran

Joined: Mon Oct 13, 2014 6:54 am
Posts: 83
Has thanked: 43 times
Have thanks: 2 times
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


Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Wed Dec 14, 2016 11:49 pm 
Offline
VIP member
VIP member
User avatar

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 699
Has thanked: 1557 times
Have thanks: 346 times
daemon1 wrote:
Unpacked the files....

what was the solution to the lzs compression so aluigi can fix his script :D

_________________
Noesis
Hex2obj
QuickBMS
TextureFinder
Unity Assets Bundle Extractor


Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Thu Dec 15, 2016 4:39 pm 
Offline
double-veteran
double-veteran

Joined: Tue Mar 24, 2015 8:12 pm
Posts: 1060
Has thanked: 14 times
Have thanks: 424 times
AceWell wrote:
what was the solution to the lzs compression so aluigi can fix his script :D


This is what I did:

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.


Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Thu Dec 15, 2016 5:07 pm 
Offline
VIP member
VIP member
User avatar

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 699
Has thanked: 1557 times
Have thanks: 346 times
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 :eek:

_________________
Noesis
Hex2obj
QuickBMS
TextureFinder
Unity Assets Bundle Extractor


Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Thu Dec 15, 2016 5:36 pm 
Offline
double-veteran
double-veteran

Joined: Tue Mar 24, 2015 8:12 pm
Posts: 1060
Has thanked: 14 times
Have thanks: 424 times
meanwhile i found bone remaps and it seems it all work ok

Image


Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Thu Dec 15, 2016 10:06 pm 
Offline
VIP member
VIP member
User avatar

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 699
Has thanked: 1557 times
Have thanks: 346 times
Quote:
Compressed files and methods
Quote:
Godzilla PS3 LZS Compressed Files
Quote:
all of the files appear to be LZS compressed....Any help decompressing these files would be appreciated!


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 curious
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. :D

_________________
Noesis
Hex2obj
QuickBMS
TextureFinder
Unity Assets Bundle Extractor


Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Fri Dec 16, 2016 5:50 am 
Offline
double-veteran
double-veteran

Joined: Tue Mar 24, 2015 8:12 pm
Posts: 1060
Has thanked: 14 times
Have thanks: 424 times
sure i will post the code as soon as i get back home this evening


Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Fri Dec 16, 2016 4:57 pm 
Offline
double-veteran
double-veteran

Joined: Tue Mar 24, 2015 8:12 pm
Posts: 1060
Has thanked: 14 times
Have thanks: 424 times
ok this is the code. First reading the header:

Code:
            fs.Seek(8, SeekOrigin.Begin);
            int dataoff = br.ReadInt32();
            int dictoff = br.ReadInt32();
            int usize = br.ReadInt32();
            int psize = br.ReadInt32();


then reading the whole data block into memory:
Code:
            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();
            }

and then decompressing it according to Luigi's code. Note that I was too lazy to make any checks present in his code.

Code:
            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++;
                    }
                }
            }

in the end write output to file

Code:
            File.WriteAllBytes("out.bin", outb);


As you can see, this code does exactly the same what LZS code from quickbmx does.


Top
 Profile  
 
 Post subject: Re: Godzilla PS3 LZS Compressed Files
PostPosted: Sun Dec 18, 2016 8:23 am 
Offline
n00b
User avatar

Joined: Thu May 14, 2015 9:15 pm
Posts: 15
Has thanked: 7 times
Have thanks: 1 time
Woah, that's awesome! Thanks a lot! :D

EDIT: How did you get the model itself? Should I try to extract it with Hex2Obj or is there an easier way to do it?



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


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:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group