arj technical information
     ** important news ****************************************************
     some archiver support programs have incorporated arj archive
     identification schemes that are not reliable.  at arj 2.39, there
     are now two versions of the large self-extraction module.	the 17k
     byte arjsfx module supports arj-security.	the standard 15k byte
     arjsfx module does not support arj-security.  for the first time, the
     arj-security fields in the main arj header are publicly defined.
     in addition, the main arj header in self-extracting archives does not
     immediately follow the exe module now.
     arj has used the same arj archive identification scheme since arj
     1.0.  the following is the algorithm:
     (1) find the arj header id bytes 0x60, 0xea,
     (2) read the next two bytes as the header record size in bytes,
     (3) if the record size is greater than 2600, go back to the header
	 id file position, increment the file position, and go back to
	 step (1),
     (4) read the header record based upon the previous byte count,
     (5) calculate the 32 bit crc of the header record data,
     (6) read the next four bytes as the actual header record crc,
     (7) if the actual crc does not equal the calculated crc, go back
	 to the header id file position, increment the file position,
	 and go back to step (1).
     this algorithm is fully demonstrated in the unarj c source code.
     when using listfiles with arj, arj support programs should use the
     "-p" option to ensure that arj will only extract the selected files
     from an arj archive.  this is important for arj archives that have
     pathname information stored.
     there is an extended header bug in older versions of arj, av.c and
     unarj.c.  the extended header processing in read_header() should
     skip 4 bytes for the extended header crc and not 2.  this is not a
     current problem as no versions of arj use the extended header.
     **********************************************************************
     modification history:
     date      description of modification:
     --------  ------------------------------------------------------------
     03/17/93  added information about arjsfx change.
     02/17/93  added description of arj security fields.
	       added archive date-modified field.
     12/03/91  added backup flag to header arj flags.
     11/21/91  described the two types of headers separately.
     11/11/91  added information about the change in text mode processing.
     06/28/91  added several new host os numbers.
     05/19/91  improved the description of extended header processing.
     05/11/91  simplified this document.  added volume label type.
     03/11/91  added directory file type.
     02/23/91  added more comments.
     01/10/91  corrected timestamp description and header order of file mode.
     10/30/90  corrected values of flags in arj flags.
     arj archives contains two types of header blocks:
	archive main header - this is located at the head of the archive
	local file header   - this is located before each archived file
     structure of main header (low order byte first):
     bytes description
     -----
-------------------------------------------------------------------
       2   header id (main and local file) = 0x60 0xea
       2   basic header size (from 'first_hdr_size' thru 'comment' below)
		 = first_hdr_size + strlen(filename) + 1 + strlen(comment) + 1
		 = 0 if end of archive
		 maximum header size is 2600
       1   first_hdr_size (size up to and including 'extra data')
       1   archiver version number
       1   minimum archiver version to extract
       1   host os   (0 = msdos, 1 = primos, 2 = unix, 3 = amiga, 4 = mac-os)
		     (5 = os/2, 6 = apple gs, 7 = atari st, 8 = next)
		     (9 = vax vms)
       1   arj flags
		     (0x01 = not used)
		     (0x02 = old_secured_flag)
		     (0x04 = volume_flag)  indicates presence of succeeding
					   volume
		     (0x08 = not used)
		     (0x10 = pathsym_flag) indicates archive name translated
					   ("\" changed to "/")
		     (0x20 = backup_flag) indicates backup type archive
		     (0x40 = secured_flag)
       1   security version (2 = current)
       1   file type	    (must equal 2)
       1   reserved
       4   date time when original archive was created
       4   date time when archive was last modified
       4   archive size (currently used only for secured archives)
       4   security envelope file position
       2   filespec position in filename
       2   length in bytes of security envelope data
       2   (currently not used)
       ?   (currently none)
       ?   filename of archive when created (null-terminated string)
       ?   archive comment  (null-terminated string)
       4   basic header crc
       2   1st extended header size (0 if none)
       ?   1st extended header (currently not used)
       4   1st extended header's crc (not present when 0 extended header size)
     structure of local file header (low order byte first):
     bytes description
     -----
-------------------------------------------------------------------
       2   header id (main and local file) = 0x60 0xea
       2   basic header size (from 'first_hdr_size' thru 'comment' below)
		 = first_hdr_size + strlen(filename) + 1 + strlen(comment) + 1
		 = 0 if end of archive
		 maximum header size is 2600
       1   first_hdr_size (size up to and including 'extra data')
       1   archiver version number
       1   minimum archiver version to extract
       1   host os   (0 = msdos, 1 = primos, 2 = unix, 3 = amiga, 4 = mac-os)
		     (5 = os/2, 6 = apple gs, 7 = atari st, 8 = next)
		     (9 = vax vms)
       1   arj flags (0x01 = garbled_flag) indicates passworded file
		     (0x02 = not used)
		     (0x04 = volume_flag)  indicates continued file to next
					   volume (file is split)
		     (0x08 = extfile_flag) indicates file starting position
					   field (for split files)
		     (0x10 = pathsym_flag) indicates filename translated
					   ("\" changed to "/")
		     (0x20 = backup_flag)  indicates file marked as backup
       1   method    (0 = stored, 1 = compressed most ... 4 compressed fastest)
       1   file type (0 = binary,    1 = 7-bit text)
		     (3 = directory, 4 = volume label)
       1   reserved
       4   date time modified
       4   compressed size
       4   original size (this will be different for text mode compression)
       4   original file's crc
       2   filespec position in filename
       2   file access mode
       2   host data (currently not used)
       ?   extra data
	   4 bytes for extended file starting position when used
	   (these bytes are present when extfile_flag is set).
	   0 bytes otherwise.
       ?   filename (null-terminated string)
       ?   comment  (null-terminated string)
       4   basic header crc
       2   1st extended header size (0 if none)
       ?   1st extended header (currently not used)
       4   1st extended header's crc (not present when 0 extended header size)
       ...
       ?   compressed file
     time stamp format:
	31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
       |<---- year-1980 --->|<- month ->|<--- day ---->|
	15 14 13 12 11 10  9  8  7  6  5  4  3	2  1  0
       |<--- hour --->|<---- minute --->|<- second/2 ->|
     end of document

返回




月光软件源码下载编程文档电脑教程网站优化网址导航网络文学游戏天地生活休闲写作范文安妮宝贝站内搜索
电脑技术编程开发网络专区谈天说地情感世界游戏元素分类游戏热门游戏体育运动手机专区业余爱好影视沙龙
音乐天地数码广场教育园地科学大观古今纵横谈股论金人文艺术医学保健动漫图酷二手专区地方风情各行各业

月光软件站·版权所有