Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Tech Note

Tech Note

Ratings: (0)|Views: 3 |Likes:
Published by saravanand1983

More info:

Published by: saravanand1983 on Apr 17, 2013
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less





RAR version 4.10 - Technical information~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~THE ARCHIVE FORMAT DESCRIBED BELOW IS ONLY VALID FOR VERSIONS SINCE 1.50==========================================================================RAR archive file format==========================================================================Archive file consists of variable length blocks. The order of theseblocks may vary, but the first block must be a marker block followed byan archive header block.Each block begins with the following fields:HEAD_CRC 2 bytes CRC of total block or block partHEAD_TYPE 1 byte Block typeHEAD_FLAGS 2 bytes Block flagsHEAD_SIZE 2 bytes Block sizeADD_SIZE 4 bytes Optional field - added block sizeField ADD_SIZE present only if (HEAD_FLAGS & 0x8000) != 0Total block size is HEAD_SIZE if (HEAD_FLAGS & 0x8000) == 0and HEAD_SIZE+ADD_SIZE if the field ADD_SIZE is present - when(HEAD_FLAGS & 0x8000) != 0.In each block the followings bits in HEAD_FLAGS have the same meaning:0x4000 - if set, older RAR versions will ignore the blockand remove it when the archive is updated.if clear, the block is copied to the new archivefile when the archive is updated;0x8000 - if set, ADD_SIZE field is present and the full blocksize is HEAD_SIZE+ADD_SIZE.Declared block types:HEAD_TYPE=0x72 marker blockHEAD_TYPE=0x73 archive headerHEAD_TYPE=0x74 file headerHEAD_TYPE=0x75 old style comment headerHEAD_TYPE=0x76 old style authenticity informationHEAD_TYPE=0x77 old style subblockHEAD_TYPE=0x78 old style recovery recordHEAD_TYPE=0x79 old style authenticity informationHEAD_TYPE=0x7a subblockComment block is actually used only within other blocks and doesn'texist separately.Archive processing is made in the following manner:1. Read and check marker block2. Read archive header3. Read or skip HEAD_SIZE-sizeof(MAIN_HEAD) bytes4. If end of archive encountered then terminate archive processing,else read 7 bytes into fields HEAD_CRC, HEAD_TYPE, HEAD_FLAGS,
HEAD_SIZE.5. Check HEAD_TYPE.if HEAD_TYPE==0x74read file header ( first 7 bytes already read )read or skip HEAD_SIZE-sizeof(FILE_HEAD) bytesif (HEAD_FLAGS & 0x100)read or skip HIGH_PACK_SIZE*0x100000000+PACK_SIZE byteselseread or skip PACK_SIZE byteselseread corresponding HEAD_TYPE block:read HEAD_SIZE-7 bytesif (HEAD_FLAGS & 0x8000)read ADD_SIZE bytes6. go to 4.==========================================================================Block Formats==========================================================================Marker block ( MARK_HEAD )HEAD_CRC Always 0x61522 bytesHEAD_TYPE Header type: 0x721 byteHEAD_FLAGS Always 0x1a212 bytesHEAD_SIZE Block size = 0x00072 bytesThe marker block is actually considered as a fixed bytesequence: 0x52 0x61 0x72 0x21 0x1a 0x07 0x00Archive header ( MAIN_HEAD )HEAD_CRC CRC of fields HEAD_TYPE to RESERVED22 bytesHEAD_TYPE Header type: 0x731 byteHEAD_FLAGS Bit flags:2 bytes0x0001 - Volume attribute (archive volume)0x0002 - Archive comment presentRAR 3.x uses the separate comment blockand does not set this flag.0x0004 - Archive lock attribute0x0008 - Solid attribute (solid archive)
0x0010 - New volume naming scheme ('volname.partN.rar')0x0020 - Authenticity information presentRAR 3.x does not set this flag.0x0040 - Recovery record present0x0080 - Block headers are encrypted0x0100 - First volume (set only by RAR 3.0 and later)other bits in HEAD_FLAGS are reserved forinternal useHEAD_SIZE Archive header total size including archive comments2 bytesRESERVED1 Reserved2 bytesRESERVED2 Reserved4 bytesFile header (File in archive)HEAD_CRC CRC of fields from HEAD_TYPE to FILEATTR2 bytes and file nameHEAD_TYPE Header type: 0x741 byteHEAD_FLAGS Bit flags:2 bytes0x01 - file continued from previous volume0x02 - file continued in next volume0x04 - file encrypted with password0x08 - file comment presentRAR 3.x uses the separate comment blockand does not set this flag.0x10 - information from previous files is used (solid flag)(for RAR 2.0 and later)bits 7 6 5 (for RAR 2.0 and later)0 0 0 - dictionary size 64 KB0 0 1 - dictionary size 128 KB0 1 0 - dictionary size 256 KB0 1 1 - dictionary size 512 KB1 0 0 - dictionary size 1024 KB1 0 1 - dictionary size 2048 KB1 1 0 - dictionary size 4096 KB1 1 1 - file is directory0x100 - HIGH_PACK_SIZE and HIGH_UNP_SIZE fieldsare present. These fields are used to archiveonly very large files (larger than 2Gb),for smaller files these fields are absent.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->