home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / a / arj239d.zip / TECHNOTE.DOC < prev    next >
Text File  |  1993-03-05  |  7KB  |  175 lines

  1.  
  2.      ARJ TECHNICAL INFORMATION                             February 1993
  3.  
  4.  
  5.      ** IMPORTANT NEWS ****************************************************
  6.  
  7.      Some archiver support programs have incorporated ARJ archive
  8.      identification schemes that are not reliable.  At ARJ 2.39, there
  9.      are now two versions of the large self-extraction module.  The 17K
  10.      byte ARJSFX module supports ARJ-SECURITY.  The standard 15K byte
  11.      ARJSFX module does NOT support ARJ-SECURITY.  For the first time, the
  12.      ARJ-SECURITY fields in the main ARJ header are publicly defined.
  13.  
  14.      ARJ has used the same ARJ archive identification scheme since ARJ
  15.      1.0.  The following is the algorithm:
  16.  
  17.      (1) find the ARJ header id bytes 0x60, 0xEA,
  18.      (2) read the next two bytes as the header record size in bytes,
  19.      (3) if the record size is greater than 2600, go back to the header
  20.          id file position, increment the file position, and go back to
  21.          step (1),
  22.      (4) read the header record based upon the previous byte count,
  23.      (5) calculate the 32 bit CRC of the header record data,
  24.      (6) read the next four bytes as the actual header record CRC,
  25.      (7) if the actual CRC does not equal the calculated CRC, go back
  26.          to the header id file position, increment the file position,
  27.          and go back to step (1).
  28.  
  29.      This algorithm is fully demonstrated in the UNARJ C source code.
  30.  
  31.      There is an extended header bug in older versions of ARJ, AV.C and
  32.      UNARJ.C.  The extended header processing in read_header() should
  33.      skip 4 bytes for the extended header CRC and not 2.  This is NOT a
  34.      current problem as no versions of ARJ use the extended header.
  35.  
  36.      **********************************************************************
  37.  
  38.  
  39.      Modification history:
  40.      Date      Description of modification:
  41.      --------  ------------------------------------------------------------
  42.      02/17/93  Added description of ARJ security fields.
  43.                Added archive date-modified field.
  44.      12/03/91  Added BACKUP flag to header arj flags.
  45.      11/21/91  Described the two types of headers separately.
  46.      11/11/91  Added information about the change in text mode processing.
  47.      06/28/91  Added several new HOST OS numbers.
  48.      05/19/91  Improved the description of extended header processing.
  49.      05/11/91  Simplified this document.  Added volume label type.
  50.      03/11/91  Added directory file type.
  51.      02/23/91  Added more comments.
  52.      01/10/91  Corrected timestamp description and header order of file mode.
  53.      10/30/90  Corrected values of flags in ARJ flags.
  54.  
  55.  
  56.      ARJ archives contains two types of header blocks:
  57.  
  58.     Archive main header - This is located at the head of the archive
  59.     Local file header   - This is located before each archived file
  60.  
  61.      Structure of main header (low order byte first):
  62.  
  63.      Bytes Description
  64.      ----- -------------------------------------------------------------------
  65.        2   header id (main and local file) = 0x60 0xEA
  66.        2   basic header size (from 'first_hdr_size' thru 'comment' below)
  67.          = first_hdr_size + strlen(filename) + 1 + strlen(comment) + 1
  68.          = 0 if end of archive
  69.                  maximum header size is 2600
  70.  
  71.        1   first_hdr_size (size up to and including 'extra data')
  72.        1   archiver version number
  73.        1   minimum archiver version to extract
  74.        1   host OS   (0 = MSDOS, 1 = PRIMOS, 2 = UNIX, 3 = AMIGA, 4 = MAC-OS)
  75.              (5 = OS/2, 6 = APPLE GS, 7 = ATARI ST, 8 = NEXT)
  76.              (9 = VAX VMS)
  77.        1   arj flags
  78.              (0x01 = NOT USED)
  79.                      (0x02 = OLD_SECURED_FLAG)
  80.              (0x04 = VOLUME_FLAG)  indicates presence of succeeding
  81.                        volume
  82.              (0x08 = NOT USED)
  83.              (0x10 = PATHSYM_FLAG) indicates archive name translated
  84.                        ("\" changed to "/")
  85.              (0x20 = BACKUP_FLAG) indicates backup type archive
  86.                      (0x40 = SECURED_FLAG)
  87.        1   security version (2 = current)
  88.        1   file type        (must equal 2)
  89.        1   reserved
  90.        4   date time when original archive was created
  91.        4   date time when archive was last modified
  92.        4   archive size (currently used only for secured archives)
  93.        4   security envelope file position
  94.        2   filespec position in filename
  95.        2   length in bytes of security envelope data
  96.        2   (currently not used)
  97.        ?   (currently none)
  98.  
  99.        ?   filename of archive when created (null-terminated string)
  100.        ?   archive comment  (null-terminated string)
  101.  
  102.        4   basic header CRC
  103.  
  104.        2   1st extended header size (0 if none)
  105.        ?   1st extended header (currently not used)
  106.        4   1st extended header's CRC (not present when 0 extended header size)
  107.  
  108.  
  109.      Structure of local file header (low order byte first):
  110.  
  111.      Bytes Description
  112.      ----- -------------------------------------------------------------------
  113.        2   header id (main and local file) = 0x60 0xEA
  114.        2   basic header size (from 'first_hdr_size' thru 'comment' below)
  115.          = first_hdr_size + strlen(filename) + 1 + strlen(comment) + 1
  116.          = 0 if end of archive
  117.                  maximum header size is 2600
  118.  
  119.        1   first_hdr_size (size up to and including 'extra data')
  120.        1   archiver version number
  121.        1   minimum archiver version to extract
  122.        1   host OS   (0 = MSDOS, 1 = PRIMOS, 2 = UNIX, 3 = AMIGA, 4 = MAC-OS)
  123.              (5 = OS/2, 6 = APPLE GS, 7 = ATARI ST, 8 = NEXT)
  124.              (9 = VAX VMS)
  125.        1   arj flags (0x01 = GARBLED_FLAG) indicates passworded file
  126.                      (0x02 = NOT USED)
  127.              (0x04 = VOLUME_FLAG)  indicates continued file to next
  128.                        volume (file is split)
  129.              (0x08 = EXTFILE_FLAG) indicates file starting position
  130.                        field (for split files)
  131.              (0x10 = PATHSYM_FLAG) indicates filename translated
  132.                        ("\" changed to "/")
  133.              (0x20 = BACKUP_FLAG)  indicates file marked as backup
  134.        1   method    (0 = stored, 1 = compressed most ... 4 compressed fastest)
  135.        1   file type (0 = binary,    1 = 7-bit text)
  136.              (3 = directory, 4 = volume label)
  137.        1   reserved
  138.        4   date time modified
  139.        4   compressed size
  140.        4   original size (this will be different for text mode compression)
  141.        4   original file's CRC
  142.        2   filespec position in filename
  143.        2   file access mode
  144.        2   host data (currently not used)
  145.        ?   extra data
  146.        4 bytes for extended file starting position when used
  147.            (these bytes are present when EXTFILE_FLAG is set).
  148.            0 bytes otherwise.
  149.  
  150.        ?   filename (null-terminated string)
  151.        ?   comment  (null-terminated string)
  152.  
  153.        4   basic header CRC
  154.  
  155.        2   1st extended header size (0 if none)
  156.        ?   1st extended header (currently not used)
  157.        4   1st extended header's CRC (not present when 0 extended header size)
  158.  
  159.        ...
  160.  
  161.        ?   compressed file
  162.  
  163.  
  164.      Time stamp format:
  165.  
  166.         31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
  167.        |<---- year-1980 --->|<- month ->|<--- day ---->|
  168.  
  169.     15 14 13 12 11 10  9  8  7  6  5  4  3    2  1  0
  170.        |<--- hour --->|<---- minute --->|<- second/2 ->|
  171.  
  172.  
  173.      end of document
  174.  
  175.