LHA (file format)

LHA
Other namesLHarc, LHx, LH
Original author(s)Haruyasu Yoshizaki
Stable release
2.13 / 20 July 1991; 33 years ago (1991-07-20)
Preview release
2.55b / 24 November 1992; 31 years ago (1992-11-24)
Written inAssembly language, C
Operating systemDOS
SuccessorLHA32
LicensePermissive license
Websitehttps://www.vector.co.jp/vpack/browse/person/an000224.html
LZH
Filename extension
.lzh, .lha
Internet media type
application/x-lzh-compressed
Type code"LHA␣" (L-H-A-SPACE)
Uniform Type Identifier (UTI)public.archive.lha
Developed byHaruyasu Yoshizaki (Yoshi)
Type of formatData compression
Extended fromLArc

LHA or LZH is a freeware compression utility and associated file format. It was created in 1988 by Haruyasu Yoshizaki (吉崎栄泰, Yoshizaki Haruyasu), a doctor, and originally named LHarc. A complete rewrite of LHarc, tentatively named LHx, was eventually released as LH. It was then renamed to LHA to avoid conflicting with the then-new MS-DOS 5.0 LH ("load high") command. The original LHA and its Windows port, LHA32, are no longer in development because Yoshizaki is busy at work.[1]

Although no longer much used in the west, LHA remained popular in Japan until the 2000s.[2] It was used by id Software to compress installation files for their earlier games, including Doom and Quake. Because some versions of LHA have been distributed with source code under the permissive license, LHA has been ported to many operating systems and is still the main archiving format used on the Amiga computer, although it competed with LZX in the mid-1990s. This was due to Aminet, the world's largest archive of Amiga-related software and files, standardising on Stefan Boberg's implementation of LHA for the Amiga.

Microsoft released the Microsoft Compressed (LZH) Folder Add-on, which was designed for the Japanese version of Windows XP.[3] The Japanese version of Windows 7 ships with the LZH folder add-on built-in.[4] Users of non-Japanese versions of Windows 7 Enterprise and Ultimate can also install the LZH folder add-on by installing the optional Japanese language pack from Windows Update.

Compression methods

In an LZH archive, the compression method is stored as a five-byte text string, e.g. -lz1-. These are the third through seventh bytes of the file.

Canonical LZH

LHarc compresses files using an algorithm from Yoshizaki's earlier LZHUF product, which was modified from LZARI developed by Haruhiko Okumura (奥村晴彦, Okumura Haruhiko), but uses Huffman coding instead of arithmetic coding. LZARI uses Lempel–Ziv–Storer–Szymanski with arithmetic coding.

lh0
No compression method is applied to the source data.
lh1
This method is introduced in LHarc version 1.
It supports 4 KiB sliding window, with support of maximum 60 bytes of matching length. Dynamic Huffman encoding is used.
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.
lh4, lh5, lh6, lh7
Methods 4, 5, 6, 7 support 4, 8, 32, 64 KiB sliding window respectively, with support of maximum 256 bytes of matching length. Static Huffman encoding is used. lh5 is first introduced in LHarc 2, followed by lh6 in LHA 2.66 (MSDOS), lh7 in LHA 2.67 beta (MSDOS). LHA itself never compresses into lh4.
lhd
Technically it is not a compression method, but it is used in .LZH archive to indicate that the compressed object is an empty directory.

Joe Jared extensions

Joe Jared extended LZSS to use larger dictionaries.

lh8, lh9, lha, lhb, lhc, lhe
Dictionary (sliding window) sizes are 64, 128, 256, 512, 1024, 2048 KiB respectively.

Jared ported LZH to Atari. The fact that lh8 is the same as lh7 was an oversight. Files using larger numbered methods may as well not exist, as Jared only considers them planned features.[5]

UNLHA32 extensions

UNLHA32.DLL uses its own method for testing purposes.

lhx
It uses 128–256 KiB dictionary.

PMarc extensions

These compression methods are created by PMarc, a CP/M archiver created by Miyo. The archive usually has a .PMA extension.

pc1
PopCom compressed executable archive. Details unknown.
pm0
No compression method is applied to the source data.
pm1
8 KB sliding window, static huffman. Seldom generated, decompressor is reverse-engineered.[6]
pm2
lh5 variant, 4K sliding window.
pms
Used to indicate PMarc self-extracting archive. Should be skipped to reveal the real format.

LArc extensions

LArc uses the same file format as .LZH, but was written by Kazuhiko Miki, Haruhiko Okumura and Ken Masuyama, with extension name ".LZS".[7] The program seems to have come before LZH. It uses a binary search tree in the LZ matching.[8]

lzs
It supports 2 KiB sliding window, with support of maximum 17 bytes of matching length.
lz2
It is similar to lzs, except dictionary size and match length can be changed.
lz3
Unknown.
lz4
No compression method is applied to the source data.
lz5
It supports 4 KiB sliding window, with support of maximum 17 bytes of matching length.
lz7
lz8
Unknown.

Common implementations appear to only support lzs, lz5, plus the storage-only lz4.

Issues

LHICE/ICE

There are copies of LHICE marked as version 1.14. According to Okumura, LHICE is not written by Yoshizaki.[9]

Y2K11 bug

Because of a bug, DOS time stamps from Level 0 and 1 headers after the year 2011 will be set to 1980, meaning that some utilities need to be patched. This is caused by a bug that interprets the unsigned 7-bit year number bitfield as a 5-bit number. The maximum year should be 2107 instead.[10][11]

The newer Level 2 and 3 headers use a 32-bit Unix time instead. It suffers from the Year 2038 problem.[12]

Header size

According to Micco, the author of a popular LHA library UNLHA32.DLL, many LHA implementations do not check for the length of LHA file headers when reading the archive. Two problems could emerge from this scenario: a buffer-overrun may occur for naive implementations assuming a 4KB max size from the original specification; antivirus software may skip over files with such large headers and fail to scan for a virus. A similar problem exists with ARJ. Micco reported this problem to Japanese authorities, but they do not consider it a valid vulnerability.[13]

Micco went so far to conclude the development of UNLHA32 and advise people to give up on the format. Nevertheless, they came back in 2017 to fix a DLL hijacking issue.

See also

References

  1. ^ "LHA World by Dr.Haruyasu Yoshizaki". 1999-04-28. Archived from the original on 1999-04-28. Retrieved 2021-01-12.
  2. ^ 吉澤, 亨史 (2010-06-07). "「LZH」の開発中止--企業などは使用しないよう作者が注意喚起". CNET Japan (in Japanese). Retrieved 2021-01-12.
  3. ^ "Microsoft Compressed (LZH) Folder Add-on". Microsoft. Archived from the original on 2007-08-19. Retrieved 2007-10-05.
  4. ^ "Windows 7 で (LZH の圧縮に Microsoft) フォルダーのアドインをインストールできません". Support.microsoft.com. Retrieved 2016-07-17.
  5. ^ Jared (1998). lzhformat.html
  6. ^ "fragglet/lhasa". GitHub. 7 July 2022.
  7. ^ "圧縮データの拡張子 ".LZS" | 圧縮・解凍ソフトのガイド". Lzh-zip.com. Retrieved 2016-07-17.
  8. ^ "Data Compression Algorithms of LARC and LHarc". GameDev.net.
  9. ^ "History of Data Compression in Japan". Oku.edu.mie-u.ac.jp. Retrieved 12 July 2016.
  10. ^ "Aminet - util/arc/lha138pch.lha". Aminet.net. Retrieved 12 July 2016.
  11. ^ "Aminet - util/arc/lha_68k.lha". Aminet.net. Retrieved 12 July 2016.
  12. ^ Nifty's LHA Format Notes, Other data formats.
  13. ^ "LZH書庫のヘッダー処理における脆弱性について(2010年版)". micco.mars.jp.

Read other articles:

Asia TengahPeta lokasi Asia TengahWilayah4.003.451 km2 (1.545.741 sq mi)[note 1]PopulasiKepadatan 71,982,775 1.743/km2 (4.510/sq mi)Negara Kazakhstan Kirgizstan Tajikistan Turkmenistan UzbekistanNominal PDB$260 billion (2017)[1]Nominal PDB per capita$3,700 (2017)Bahasa resmiKazakh, Kyrgyz, Rusia, Tajik, Turkmen, Uzbek Asia Tengah adalah sebuah kawasan yang terkurung daratan di benua Asia. Banyak arti yang berbeda dalam kom...

 

One of the Ten Commandments Part of a series on theTen Commandments I am the LORD thy God No other gods before me No graven images or likenesses Not take the LORD's name in vain Remember the sabbath day Honour thy father and thy mother Thou shalt not kill Thou shalt not commit adultery Thou shalt not steal Thou shalt not bear false witness Thou shalt not covet Related articles Tablets of Stone Ritual Decalogue Finger of God Moses Ark of the Covenant Mount Sinai In Catholic theology vte Thou s...

 

Lollipop F Información artísticaGénero(s) C-popPeríodo de actividad 2006WebSitio web http://www.lollipopf.net/ [editar datos en Wikidata] Lollipop F (nombre en mandarín 棒棒 堂, nombre japonés ロ リ ポ ッ プ F, nombre coreano 롤리팝 F) es una banda mandopop formada en Taiwán, en la que han ganado popularidad en todo el continente asiático. El grupo comenzó con seis integrantes, todos elegidos por la red televisiva de Channel [V], a través de un programa lla...

 

Operndaten Titel: Der Spieler Originaltitel: 1) Игрок (Igrok) 2) Le joueur Rückseite einer 100-Rubel-Münze der Bank von Russland mit einer Szene aus der Oper Form: Oper in vier Akten Originalsprache: 1) Russisch 2) Russisch, französische Übersetzung Musik: Sergei Prokofjew Libretto: Sergei Prokofjew Literarische Vorlage: Dostojewski: Der Spieler Uraufführung: 1) 5. Juni 2001 2) 29. April 1929 Ort der Uraufführung: 1) Bolschoi-Theater, Moskau 2) Théâtre Royal de la Monnaie, Brüss...

 

New York City Subway station in Manhattan New York City Subway station in Manhattan, New York 5 Avenue/53 Street ​ New York City Subway station (rapid transit)People waiting for a train on the upper level platformStation statisticsAddressFifth Avenue & 53rd StreetNew York, NY 10019BoroughManhattanLocaleMidtown ManhattanCoordinates40°45′37″N 73°58′32″W / 40.76028°N 73.97556°W / 40.76028; -73.97556DivisionB (IND)[1]LineIND Queens B...

 

Guerra del agua Ciudad de Cochabamba en la que tuvo lugar la Guerra del Agua.Fecha Noviembre de 1999-abril de 2001Lugar Cochabamba, BoliviaCausas Privatización del sistema de agua de Cochabamba (SEMAPA) y suministro de agua por parte de Aguas del Tunari.Métodos Manifestaciones, referéndum, bloqueos de carreteras, disturbiosResultado Expulsión de Aguas del TunariDerogación Ley 2029Partes enfrentadas Coordinadora en Defensa del Agua y la Vida Movimiento al Socialismo Conciencia de Patria M...

 

Тема цієї статті може не відповідати загальним критеріям значущості Вікіпедії. Будь ласка, допоможіть підтвердити значущість, додавши посилання на надійні вторинні джерела, які є незалежними для цієї теми. Якщо значущість залишиться непідтвердженою, стаття може бути об'

 

北京地铁14号线14号线列车驶出张郭庄站(2023年6月)概覽營運地點 中国北京市丰台区、东城区、朝阳区服務類型地铁所屬系統北京地铁目前狀況运营中起點站张郭庄終點站善各庄系統代號M14线技術數據路線結構地下、高架路線長度47.3 km(29.4 mi)[1]最高速度最高80公里/小時正線數目2条車站數目33座(已开通)36座(全线)軌距1,435毫米(標準軌)電氣化方式DC...

 

Sender Moosbrunn Drehstandantenne, 360° drehbar für weltweite KurzwellenausstrahlungDrehstandantenne, 360° drehbar für weltweite Kurzwellenausstrahlung Basisdaten Ort: Moosbrunn Bundesland: Niederösterreich Staat: Österreich 48.006716.46205Koordinaten: 48° 0′ 24,1″ N, 16° 27′ 43,4″ O Verwendung: Rundfunksender Zugänglichkeit: Sendeanlage nach Voranmeldung zugänglich Besitzer: Österreichische Rundfunksender GmbH (ORS) Daten zur Sendeanlage Welle...

 

1948 party congress 2nd Congress of the Workers' Party of North KoreaThe Flag of the Workers' Party of North KoreaDate27–30 March 1948 (4 days)LocationPyongyang, North KoreaParticipants999 delegates (990 of them attended the congress)OutcomeElection of the 2nd Central Committee and 2nd Central Auditing Commission The 2nd Congress of the Workers' Party of North Korea(Korean: 북조선로동당 제 2차 대회) (WPNK) was held in Pyongyang, North Korea, from 27–30 March 1948. The c...

 

American artistic gymnast Kimberly ChaceChace in 1976Personal informationBorn (1956-05-04) May 4, 1956 (age 67)Manchester, Tennessee, U.S.[1]Height5 ft 2 in (157 cm)Weight110 lb (50 kg)SportSportArtistic gymnasticsClubChace School of Gymnastics Medal record Representing the  United States Pan American Games 1971 Cali Team 1971 Cali Balance beam 1971 Cali Floor 1971 Cali All-around 1971 Cali Uneven bars Kimberly Ann Chace (later Boyle, then May, born ...

 

  Cuco hormiguero alirrufo Ilustracón basada en espécimen muerto. La piel de alrededor de los ojos es roja en los individuos vivos.Estado de conservaciónPreocupación menor (UICN 3.1)[1]​TaxonomíaReino: AnimaliaFilo: ChordataClase: AvesOrden: CuculiformesFamilia: CuculidaeSubfamilia: NeomorphinaeGénero: NeomorphusEspecie: N. rufipennis(Gray, 1849)Distribución [editar datos en Wikidata] El cuco hormiguero alirrufo (Neomorphus rufipennis), también denominado cuc...

 

U.S. conscription procedure during the Vietnam War This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (October 2017) (Learn how and when to remove this template message) Representative Alexander Pirnie (R-NY) drawing the first number. On December 1, 1969, the Selective Service System of the United States conducted two lotteries to determine the order of call to m...

 

Umar Sugeng HariyonoAsops KasauMasa jabatan14 Agustus 2019 – 26 Mei 2020PendahuluJohannes Berchman SWPenggantiHenri AlfiandiKoorsahli KasauMasa jabatan14 Februari 2018 – 14 Agustus 2019PendahuluEko SupriyantoPenggantiYadi Indrayadi Sutanandika Informasi pribadiLahir30 Mei 1962 (umur 61)JakartaSuami/istriHj. Dwiana Ikafitri Narukaya, S.I.P.AnakAriya Cakra (Pilot)Ardelia Vidya Riana, B.B.A.(Hons.)Alma materAkademi Angkatan Udara (1986)Karier militerPihak Indonesi...

 

Comune in Veneto, ItalyMonselice Monséłexe (Venetian)ComuneComune di Monselice Coat of armsLocation of Monselice MonseliceLocation of Monselice in ItalyShow map of ItalyMonseliceMonselice (Veneto)Show map of VenetoCoordinates: 45°14′N 11°45′E / 45.233°N 11.750°E / 45.233; 11.750CountryItalyRegionVenetoProvincePadua (PD)FrazioniMarendole, Monticelli, Ca' Oddo, San Cosma, San Bortolo, CarmineGovernment • MayorGiorgia Bedin (since 2019) (Leg...

 

1969 Pakistani Urdu film ZarqaDirected byRiaz ShahidWritten byRiaz ShahidScreenplay byRiaz ShahidBased onBased on the life of Zarqa[a]Produced byRiaz ShahidStarringNeeloAlauddinEjaz DurraniSaqiNasiraTalishMusic byRashid AttreWajahat AttreRelease date 17 October 1969 (1969-10-17) (Pakistan)[1] CountryPakistanLanguageUrdu Zarqa is a 1969 Pakistani epic historical drama film directed, produced and written by Riaz Shahid while the music is composed by Rashid Att...

 

British children's educational writer Julia CornerLittle Mary's Reading BookBorn1798London, EnglandDied16 August 1875Notting HillPen nameMiss Julia CornerGenreinstructional books for children Julia Corner (1798–1875), also known as Miss Corner, was a British children's educational writer who created Miss Corner's Historical Library. Life Corner was born in London in 1798. Her father, John Corner, was an engraver.[1] She initially wrote novels which she continued after she became ass...

 

Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada Oktober 2022. Baka (馬鹿, ばか dalam hiragana, atau バカ dalam katakana) berarti bodoh, atau (sebagai kata benda ajektif) konyol dan merupakan istilah merendahkan yang paling sering digunakan dalam bahasa Jepang.[1] Kata baka ini memiliki sejarah yang ...

 

American businessman and politician (1923–2010) For other people named Thomas Ashley, see Thomas Ashley (disambiguation). Thomas L. AshleyMember of the U.S. House of Representativesfrom Ohio's 9th districtIn officeJanuary 3, 1955 – January 3, 1981Preceded byFrazier ReamsSucceeded byEd Weber Personal detailsBornThomas William Ludlow Ashley(1923-01-11)January 11, 1923Toledo, Ohio, U.S.DiedJune 15, 2010(2010-06-15) (aged 87)Leland, Michigan, U.S.Resting placeWoodlaw...

 

Koordinat: 5°04′37″S 119°32′59″E / 5.0769893°S 119.5497434°E / -5.0769893; 119.5497434 TenrigangkaeDesaKantor Desa Tenrigangkae di Jl. Poros Kariango, Dusun TinggitoNegara IndonesiaProvinsiSulawesi SelatanKabupatenMarosKecamatanMandaiKode pos90552[1]Kode Kemendagri73.09.01.2003 Luas6,43 km² tahun 2017Jumlah penduduk3.849 jiwa tahun 2017Kepadatan598,60 jiwa/km² tahun 2017Jumlah RT19Jumlah RW5 Tenrigangkae (Lontara Bugis: ᨈᨛᨋᨗᨁᨃᨕ�...