LHA
Line 10: | Line 10: | ||
The file format is also known as '''LZH'''. | The file format is also known as '''LZH'''. | ||
+ | |||
+ | == Format details == | ||
+ | LHA consists of a sequence of elements, each representing a member file or directory. There is no global archive-level header. | ||
+ | |||
+ | There are at least four different formats that an element can have. (Note that this is independent of compression schemes.) In LHA jargon, the formats are known as "header levels". The formats are sometimes called "header level 0", "1", "2", and "3". | ||
+ | |||
+ | The format of an element is determined by the byte at offset 20 from the beginning of that element. It is possible for different formats to be used in the same LHA file. | ||
+ | |||
+ | The formats are similar, but infuriatingly different. They don't even follow the same principles with respect to parsing logic. | ||
== Identification == | == Identification == | ||
Line 28: | Line 37: | ||
* [https://web.archive.org/web/20130906133859/http://homepage1.nifty.com/dangan/en/Content/Program/Java/jLHA/jLHA.html Java library] (from archive.org) | * [https://web.archive.org/web/20130906133859/http://homepage1.nifty.com/dangan/en/Content/Program/Java/jLHA/jLHA.html Java library] (from archive.org) | ||
* [https://www.libarchive.org/ libarchive] | * [https://www.libarchive.org/ libarchive] | ||
+ | |||
+ | == Sample files == | ||
+ | * [https://github.com/libarchive/libarchive/tree/master/libarchive/test libarchive test files] → test_read_format_lha_*.lzh.uu | ||
== Other links == | == Other links == | ||
* [[Wikipedia:LHA (file format)|Wikipedia article]] | * [[Wikipedia:LHA (file format)|Wikipedia article]] |
Revision as of 17:02, 10 July 2017
LHA is an archiving program and file format created by Haruyasu Yoshizaki in 1988. It was originally called LHArc, then was briefly LH before settling on LHA. In the 1990s it was the most popular archiving format on the Amiga platform, and also got some use on the PC platform including in the installers for id Software games such as Doom and Quake, because ZIP compression was inferior until the release of PKZIP 2.0, which brought the formats to parity. At present, it is mostly used in Japan.
The file format is also known as LZH.
Contents[hide] |
Format details
LHA consists of a sequence of elements, each representing a member file or directory. There is no global archive-level header.
There are at least four different formats that an element can have. (Note that this is independent of compression schemes.) In LHA jargon, the formats are known as "header levels". The formats are sometimes called "header level 0", "1", "2", and "3".
The format of an element is determined by the byte at offset 20 from the beginning of that element. It is possible for different formats to be used in the same LHA file.
The formats are similar, but infuriatingly different. They don't even follow the same principles with respect to parsing logic.
Identification
Bytes '-' 'l' ?? ?? '-'
appear at offset 2. This is not a global file signature, but represents the compression scheme of the first member file of the archive.
Format documentation
- jLHA software: LHA Notes
- Japanese
- English (translation?) (from archive.org)
- Archive format info
- LZH file header format (among other archive types)
- libarchive: archive_read_support_format_lha.c - Has comments with information about the header formats
Software
- lhasa
- 7-Zip
- Explzh for Windows
- Java library (from archive.org)
- libarchive
Sample files
- libarchive test files → test_read_format_lha_*.lzh.uu