lhasa icon indicating copy to clipboard operation
lhasa copied to clipboard

lh2 and lh3

Open polluks opened this issue 4 years ago • 6 comments

  • lh2

    lh1 variant. This method supports 8 KiB sliding window, with support of maximum 256 bytes of matching length. Dynamic Huffman encoding is used.

  • lh3

    lh2 variant with Static Huffman.

https://en.wikipedia.org/wiki/LHA_(file_format)#Canonical_LZH

polluks avatar Apr 08 '20 14:04 polluks

If any examples of these archives exist in the wild then I'd love to support them. However, I'm pretty sure there aren't any. I don't really want to support these formats without test archives that can be used for regression testing. If you find any tools that can generate lh2 or lh3, let me know.

fragglet avatar Apr 08 '20 15:04 fragglet

these files can be created with unlha32.dll (-jm5 for -lh2-, with file size limit 8KB, and -jm6 for -lh3-) you can use undll.exe (http://k-takata.o.oo7.jp/mysoft/undllexe.html) and rename undll.exe as unlha32.exe and put unlha32.dll (from http://www.madobe.net/archiver/lib/unlha32.html) aside to use.

and created lzh files are test OK with LHA32 2.67.00.

command to create lh2.lzh:

unlha32 a -jm5 lh2.lzh LICENSE.MIT

command to create lh3.lzh:

unlha32 a -jm6 lh3.lzh LICENSE.MIT

lh2-lh3.zip source of LICENSE.MIT: https://raw.githubusercontent.com/theupdateframework/specification/master/LICENSE-MIT.txt

roytam1 avatar Nov 10 '21 16:11 roytam1

I think I should tag #11 as well

roytam1 avatar Nov 12 '21 01:11 roytam1

-jm5 for -lh2-, with file size limit 8KB

this limit respects original LH(arc) 1.9x original implementation, but can be bypassed by hex-editing unlha32.dll (I used unlha32.dll v3.00 as example) search "72 03 6a 03 5f 33" and change "72" to "eb" to bypass original file size check.

roytam1 avatar Nov 13 '21 15:11 roytam1

Any idea why there's an 8KB file size limit?

fragglet avatar Nov 13 '21 22:11 fragglet

Any idea why there's an 8KB file size limit?

maybe because of processing power in 1989 is not that capable for generating Dynamic Huffman encoding for larger than 8KB.

roytam1 avatar Nov 13 '21 23:11 roytam1