Help with LZSS encoder

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Mirakichi
Posts: 25
Joined: Wed Jul 26, 2017 2:44 pm

Help with LZSS encoder

Post by Mirakichi »

Hi aluigi, I've found this LZSS encoder in the net https://drive.google.com/file/d/1Opgvyn ... p=drivesdk and it seems he is used by quickbms to support the LZSS algorithm. I want to use this encoder to recompress a graphics archive, this graphics archive is the "LESS20" file included in the link, and the "LESS20.LED" is the LESS20 decompressed.

I use an bms script to decompress the "LESS20", the encoder recompress the "LESS20.LED" to "LESS20" again, but when I edit the textures, same keeping the original size, the encoder do not recompress.

The source code of this encoder is included, I would like to know if can adapt this encoder to compress the LESS20.LED with the edited textures to LESS20 again, since it is used by quickbms.
In the link I've included two bms scripts that I use to decompress the LESS20 and to dump the textures and reimport them. Altough the encoder create the new encoded file, after decompress, the modified texture is no there.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Help with LZSS encoder

Post by aluigi »

That format is a bit more complicated than just compressing and decompressing a file, there is a header and moreover chunks as visible in less.cpp.

Anyway I guess the problem of the script is the following:

Code: Select all

    savepos TMP
    goto DATA_OFFSET
    do
        get CHECK byte
    while CHECK == 0
    goto -1 0 seek_cur
Replace it with "padding 16" and it may work (not tested, limited time)
Mirakichi
Posts: 25
Joined: Wed Jul 26, 2017 2:44 pm

Re: Help with LZSS encoder

Post by Mirakichi »

Hi, I've tried replace here, but I don't know where is the "padding" in the script to update with 32, can you update for me, please?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Help with LZSS encoder

Post by aluigi »

eh???
Anyway I have seen your same topic on encode.ru and it was very confusing there too so probably it's better if you continue there.
Mirakichi
Posts: 25
Joined: Wed Jul 26, 2017 2:44 pm

Re: Help with LZSS encoder

Post by Mirakichi »

I am need so much of this tool, because this I've searched for a solution in 2 sites, here in the Zenhax and in the encode.ru. If this last site cannot help me, I can still count on your help?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Help with LZSS encoder

Post by aluigi »

If it's a problem with quickbms or a script sure, but I don't think it's the case because there you want to rebuild a format (quickbms is good for extraction and reimporting, not building).

If it's a problem with that C code I prefer to stay away from it :D (time reasons)
Mirakichi
Posts: 25
Joined: Wed Jul 26, 2017 2:44 pm

Re: Help with LZSS encoder

Post by Mirakichi »

Hi aluigi, the Shelwien has show to me a new way to use the LZSS recompressor and is working perfectly with the modified textures in the game, but the quickbms and the script is a crucial tool to the reimport the textures before recompression and to decompress the LESS archives, so I am using the two tools in my translation, each one with an specific purpose.