[PSV] Uppers lzs

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
happydance
Posts: 81
Joined: Sun Jul 10, 2016 11:07 am

[PSV] Uppers lzs

Post by happydance »

started learning bms scripting more than a month ago. I kinda get the basics and can make script for simple zlib and some uncompressed game files, but I can't figure this out, the file extension said lzs, but it got no magic header and some of the data are visible in the hex editor. comp scanner end up with nothing or i'm not inputting the correct file size

need a little guidance

Image

sample is attached below
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: [PSV] Uppers lzs

Post by aluigi »

It seems just the normal LZSS with the initializer character set to 0x00 instead of the usual 0x20:

Code: Select all

comtype lzss0
get SIZE long
savepos OFFSET
get ZSIZE asize
math ZSIZE - OFFSET
get NAME basename
clog NAME OFFSET ZSIZE SIZE
happydance
Posts: 81
Joined: Sun Jul 10, 2016 11:07 am

Re: [PSV] Uppers lzs

Post by happydance »

thank you very much, I'll take note of this script.
I feel so stupid, it was that simple hehe.. guess I still need a lot to learn
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: [PSV] Uppers lzs

Post by aluigi »

Don't worry it's not that simple :)
Often it's just luck and experience, in this case I tried lzss and I got a readable good result but there were many 0x20 that didn't sound correct so it was the lzss0 compression (shortcut of lzss0 with 0x00 init).
Usually lzss can be recognized by the presence of readable text strings with 0xff bytes (that sort of 'y' you see with text/hex editor) at their beginning and in the middle.
That's valid also for other algorithm (lzo1x, lz4 and so on) but lzss is very diffused.