Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lh2 and lh3 #32

Open
polluks opened this issue Apr 8, 2020 · 6 comments
Open

lh2 and lh3 #32

polluks opened this issue Apr 8, 2020 · 6 comments

Comments

@polluks
Copy link
Contributor

polluks commented Apr 8, 2020

  • 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

@fragglet
Copy link
Owner

fragglet commented Apr 8, 2020

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 fragglet closed this as completed Apr 8, 2020
@roytam1
Copy link

roytam1 commented Nov 10, 2021

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
Copy link

roytam1 commented Nov 12, 2021

I think I should tag #11 as well

@polluks polluks changed the title lh2 and lh3 lh2 and lh3 (please reopen) Nov 12, 2021
@roytam1
Copy link

roytam1 commented Nov 13, 2021

-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 fragglet reopened this Nov 13, 2021
@fragglet fragglet changed the title lh2 and lh3 (please reopen) lh2 and lh3 Nov 13, 2021
@fragglet
Copy link
Owner

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

@roytam1
Copy link

roytam1 commented Nov 13, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants