fragglet / lhasa

Free Software LHA implementation
http://fragglet.github.io/lhasa/
ISC License
80 stars 15 forks source link

lh2 and lh3 #32

Open polluks opened 4 years ago

polluks commented 4 years ago

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

fragglet commented 4 years ago

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.

roytam1 commented 2 years ago

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 commented 2 years ago

I think I should tag #11 as well

roytam1 commented 2 years ago

-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.

fragglet commented 2 years ago

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

roytam1 commented 2 years ago

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.