Page 1 of 1

Tales of Legendia cps

Posted: Tue May 04, 2010 2:11 am
by prototypesky
Any clues as to how to parse these files?

Re: Tales of Legendia cps

Posted: Tue May 04, 2010 10:10 am
by Vash
it's well compressed...it seems some LZSS variation

Re: Tales of Legendia cps

Posted: Wed May 05, 2010 6:50 am
by prototypesky
Guess you're right
the header if the CPS seems to be

struct
{
char[4] id; //always "CPS"
int filesize; //size of the CPS file header + data
int deflated size; //size of the uncompressed data
int padding; //always 0
}

followed by the compressed data//

Re: Tales of Legendia cps

Posted: Wed May 05, 2010 8:32 am
by Vash
yeah, the best thing you could do is to find the same file in a savestate because it will be decompressed and comparing it to the compressed one could bring us to the algo.

Re: Tales of Legendia cps

Posted: Wed May 05, 2010 8:01 pm
by prototypesky
I tried a generic Lzss algo on the compressed data and this was the result. It seems to be working as the expected filesize match trying to varify now if the uncompressed data is a swizzled image of an apple icon.

Re: Tales of Legendia cps

Posted: Thu May 06, 2010 4:22 am
by prototypesky
Ok one of the lzss compress algorithms posted on this site actually seemed to worked :D

I did a test with a one of the lzss compressed battle.mid and I was able to get a playable midi in winamp and then in all players
if I remove the first 64 bytes which seems like game file header info.

Re: Tales of Legendia cps

Posted: Thu May 06, 2010 9:38 am
by Vash
very nice. Thank for the info, it will be useful for romahackers :D