Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!cbmvax!heimat!sneakers From: sneakers@heimat.UUCP (Dan "Sneakers" Schein) Newsgroups: comp.sys.amiga Subject: Re: LHarc magic number query Message-ID: <10332.AA10332@heimat> Date: 23 Dec 89 03:16:28 GMT Followup-To: comp.sys.amiga Organization: Sneakers Computing Lines: 59 In Message <934@lpami.wimsey.bc.ca>, lphillips@lpami.wimsey.bc.ca (Larry Phillips) writes: |In <10296.AA10296@heimat>, sneakers@heimat.UUCP (Dan "Sneakers" Schein) writes: |> |> Does anyone know of a magic number sequence for the "LHarc" archive files? |> Ive made several test files and it lookes like the first couple of bytes |> are never the same. | |I just checked about 20 .lzh files with a handy little utility called dumpdiff, |and they all share a common string in offset start+2, for 5 bytes. | Larry I received this from Martin J. Laubach ------ Format of file headers within .LZH archives: Byte 0: No. bytes in header - 2 (0 = end of file) 1: Checksum of remaining bytes (counted by byte 0) 2-6: ASCII compression type: '-lh0-' = no compression '-lh1-' = LHARC compression (presumably other valid types used by the separate LARC program?) 7-10: Comressed file size \ (low byte 11-14: Original file length / first) 15-16: File time \ (INT 21H, 17-18: File date / function 57H) 19-20: File attributes (INT 21H, function 43H) 21: No. bytes in path/file name (n) 22...: Path/file name (n bytes) 22+n: CRC-16 (2 bytes, optional; requires byte 0 - byte 21 = 22) 22+n = Header length, if no CRC (generated by ???) 24+n = Header length, if CRC Notes: (1) Above inferred by manual inspection and confirmed by disassembly of LHARC10E self-extraction code, except for bytes 19-20, which are not used by self-extraction code. (2) Maximum path/file name length = 233 bytes (235 bytes, if no CRC), given max. byte 0 count = 255 (3) CRC-16 polynomial identical to that used by .ARC archives. ------ So I guess there really is no magic number like ARC, ZOO, or WARP. Guess im going to have to just be a bit more creative ;-) Merry Christmas to all! -- ___ Dan "Sneakers" Schein //// Father of a bouncing baby BOY! Sneakers Computing //// Stephan Maxwell Schein 2455 McKinley Ave. ___ //// Born Dec-21-89 at 9:43 am West Lawn, PA 19609 \\\\//// \\\/// sneakers%heimat@commodore.com (or) uunet!cbmvax!heimat!sneakers