Miscellaneous Forums > Scripting and Reverse Engineering

How the LZS compression works?

<< < (2/4) > >>

bspbsp:
now i understand the Haruhiko compression that ficedula mentioned  is the original LZSS compression,thanks to mirex!
and to Srethron Askvelhtnod:also thanks to your google site! i have found some source codes there.may raise new questions if i have any

mav:
Yeah, but there's a diffrence between Haruhiko LZSS and FF7 LZSS alghoritm. I'm looking for Delphi source to compress files using FF7 LZSS alghoritm. Does anyone have some ? .

Edit: I've developed a tool that can compress and decompress them (finally ;)), and it works pretty well. Win32 app. Link:
http://mav.pix.pl/personal/Lzss.zip

bspbsp:
good news!!
i've found the differences between Haruhiko LZSS and the method SQUARESOFT used to compress their files.
this is a c source code about standard LZSS compression:
http://sprite.phys.ncku.edu.tw/NCKUtech/DCM/pub/DCM_CODE_ASM/lzss.c
then make some changes:
1.initialize the ring buffer with NUL chars instead of space(standard LZSS),both in encode() and decode().
2.add a dword at the head of the file indicating the length of the whole block,encoded or decoded,not so difficult,i think. :wink:
complete,now it works as a compressing method which SQUARESOFT uses

Haruhiko:
@bspbsp

What do you exactly mean with "2.". I don't understand, sorry.

When I get 32 bits from infile before decoding it, the decompressed file has the same size as the decompressed file produced by ficedulas lzs.exe.

When I put 32 bits to outfile before encoding the infile into it, it ends up with a different size as the original LZS file.

mav:
Bspbsp: Yes, i know this diffrences and they're applied to my program. If you want, you can use it, and I can send you a Delphi source eventually ;).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version