1
0

headers5.hpp 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #ifndef _RAR_HEADERS5_
  2. #define _RAR_HEADERS5_
  3. #define SIZEOF_MARKHEAD5 8 // RAR 5.0 signature length.
  4. #define SIZEOF_SHORTBLOCKHEAD5 7 // Smallest RAR 5.0 block size.
  5. // RAR 5.0 block flags common for all blocks.
  6. // Additional extra area is present in the end of block header.
  7. #define HFL_EXTRA 0x0001
  8. // Additional data area is present in the end of block header.
  9. #define HFL_DATA 0x0002
  10. // Unknown blocks with this flag must be skipped when updating an archive.
  11. #define HFL_SKIPIFUNKNOWN 0x0004
  12. // Data area of this block is continuing from previous volume.
  13. #define HFL_SPLITBEFORE 0x0008
  14. // Data area of this block is continuing in next volume.
  15. #define HFL_SPLITAFTER 0x0010
  16. // Block depends on preceding file block.
  17. #define HFL_CHILD 0x0020
  18. // Preserve a child block if host is modified.
  19. #define HFL_INHERITED 0x0040
  20. // RAR 5.0 main archive header specific flags.
  21. #define MHFL_VOLUME 0x0001 // Volume.
  22. #define MHFL_VOLNUMBER 0x0002 // Volume number field is present. True for all volumes except first.
  23. #define MHFL_SOLID 0x0004 // Solid archive.
  24. #define MHFL_PROTECT 0x0008 // Recovery record is present.
  25. #define MHFL_LOCK 0x0010 // Locked archive.
  26. // RAR 5.0 file header specific flags.
  27. #define FHFL_DIRECTORY 0x0001 // Directory.
  28. #define FHFL_UTIME 0x0002 // Time field in Unix format is present.
  29. #define FHFL_CRC32 0x0004 // CRC32 field is present.
  30. #define FHFL_UNPUNKNOWN 0x0008 // Unknown unpacked size.
  31. // RAR 5.0 end of archive header specific flags.
  32. #define EHFL_NEXTVOLUME 0x0001 // Not last volume.
  33. // RAR 5.0 archive encryption header specific flags.
  34. #define CHFL_CRYPT_PSWCHECK 0x0001 // Password check data is present.
  35. // RAR 5.0 file compression flags.
  36. #define FCI_ALGO_BIT0 0x0001 // Version of compression algorithm.
  37. #define FCI_ALGO_BIT1 0x0002 // 0 .. 63.
  38. #define FCI_ALGO_BIT2 0x0004
  39. #define FCI_ALGO_BIT3 0x0008
  40. #define FCI_ALGO_BIT4 0x0010
  41. #define FCI_ALGO_BIT5 0x0020
  42. #define FCI_SOLID 0x0040 // Solid flag.
  43. #define FCI_METHOD_BIT0 0x0080 // Compression method.
  44. #define FCI_METHOD_BIT1 0x0100 // 0 .. 5 (6 and 7 are not used).
  45. #define FCI_METHOD_BIT2 0x0200
  46. #define FCI_DICT_BIT0 0x0400 // Dictionary size.
  47. #define FCI_DICT_BIT1 0x0800 // 128 KB .. 4 GB.
  48. #define FCI_DICT_BIT2 0x1000
  49. #define FCI_DICT_BIT3 0x2000
  50. // Main header extra field values.
  51. #define MHEXTRA_LOCATOR 0x01 // Position of quick list and other blocks.
  52. // Flags for MHEXTRA_LOCATOR.
  53. #define MHEXTRA_LOCATOR_QLIST 0x01 // Quick open offset is present.
  54. #define MHEXTRA_LOCATOR_RR 0x02 // Recovery record offset is present.
  55. // File and service header extra field values.
  56. #define FHEXTRA_CRYPT 0x01 // Encryption parameters.
  57. #define FHEXTRA_HASH 0x02 // File hash.
  58. #define FHEXTRA_HTIME 0x03 // High precision file time.
  59. #define FHEXTRA_VERSION 0x04 // File version information.
  60. #define FHEXTRA_REDIR 0x05 // File system redirection (links, etc.).
  61. #define FHEXTRA_UOWNER 0x06 // Unix owner and group information.
  62. #define FHEXTRA_SUBDATA 0x07 // Service header subdata array.
  63. // Hash type values for FHEXTRA_HASH.
  64. #define FHEXTRA_HASH_BLAKE2 0x00
  65. // Flags for FHEXTRA_HTIME.
  66. #define FHEXTRA_HTIME_UNIXTIME 0x01 // Use Unix time_t format.
  67. #define FHEXTRA_HTIME_MTIME 0x02 // mtime is present.
  68. #define FHEXTRA_HTIME_CTIME 0x04 // ctime is present.
  69. #define FHEXTRA_HTIME_ATIME 0x08 // atime is present.
  70. #define FHEXTRA_HTIME_UNIX_NS 0x10 // Unix format with nanosecond precision.
  71. // Flags for FHEXTRA_CRYPT.
  72. #define FHEXTRA_CRYPT_PSWCHECK 0x01 // Store password check data.
  73. #define FHEXTRA_CRYPT_HASHMAC 0x02 // Use MAC for unpacked data checksums.
  74. // Flags for FHEXTRA_REDIR.
  75. #define FHEXTRA_REDIR_DIR 0x01 // Link target is directory.
  76. // Flags for FHEXTRA_UOWNER.
  77. #define FHEXTRA_UOWNER_UNAME 0x01 // User name string is present.
  78. #define FHEXTRA_UOWNER_GNAME 0x02 // Group name string is present.
  79. #define FHEXTRA_UOWNER_NUMUID 0x04 // Numeric user ID is present.
  80. #define FHEXTRA_UOWNER_NUMGID 0x08 // Numeric group ID is present.
  81. #endif