{"id":471,"date":"2016-03-14T00:13:21","date_gmt":"2016-03-13T15:13:21","guid":{"rendered":"http:\/\/manatails.net\/blog\/?p=471"},"modified":"2022-04-03T13:48:54","modified_gmt":"2022-04-03T04:48:54","slug":"rar-header","status":"publish","type":"post","link":"https:\/\/manatails.net\/blog\/2016\/03\/rar-header\/","title":{"rendered":"RAR header"},"content":{"rendered":"<p><a href=\"http:\/\/manatails.net\/blog\/wp-content\/uploads\/2016\/03\/rar.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-472\" src=\"http:\/\/manatails.net\/blog\/wp-content\/uploads\/2016\/03\/rar.png\" alt=\"rar\" width=\"671\" height=\"418\" srcset=\"https:\/\/manatails.net\/blog\/wp-content\/uploads\/2016\/03\/rar.png 671w, https:\/\/manatails.net\/blog\/wp-content\/uploads\/2016\/03\/rar-300x187.png 300w\" sizes=\"auto, (max-width: 671px) 100vw, 671px\" \/><\/a><\/p>\n<p>From Forensics Wiki:<\/p>\n<table class=\"wikitable\">\n<tbody>\n<tr>\n<th>Field Name<\/th>\n<th>Size (bytes)<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>HEAD_CRC<\/td>\n<td>2<\/td>\n<td>CRC of fields from HEAD_TYPE to FILEATTR and file name<\/td>\n<\/tr>\n<tr>\n<td>HEAD_TYPE<\/td>\n<td>1<\/td>\n<td>Header Type: 0x74<\/td>\n<\/tr>\n<tr>\n<td>HEAD_FLAGS<\/td>\n<td>2<\/td>\n<td>Bit Flags (Please see &#8216;Bit Flags for File in Archive&#8217; table for all possibilities)<\/td>\n<\/tr>\n<tr>\n<td>HEAD_SIZE<\/td>\n<td>2<\/td>\n<td>File header full size including file name and comments<\/td>\n<\/tr>\n<tr>\n<td>PACK_SIZE<\/td>\n<td>4<\/td>\n<td>Compressed file size<\/td>\n<\/tr>\n<tr>\n<td>UNP_SIZE<\/td>\n<td>4<\/td>\n<td>Uncompressed file size<\/td>\n<\/tr>\n<tr>\n<td>HOST_OS<\/td>\n<td>1<\/td>\n<td>Operating system used for archiving (See the &#8216;Operating System Indicators&#8217; table for the flags used)<\/td>\n<\/tr>\n<tr>\n<td>FILE_CRC<\/td>\n<td>4<\/td>\n<td>File CRC<\/td>\n<\/tr>\n<tr>\n<td>FTIME<\/td>\n<td>4<\/td>\n<td>Date and time in standard MS DOS format<\/td>\n<\/tr>\n<tr>\n<td>UNP_VER<\/td>\n<td>1<\/td>\n<td>RAR version needed to extract file (Version number is encoded as 10 * Major version + minor version.)<\/td>\n<\/tr>\n<tr>\n<td>METHOD<\/td>\n<td>1<\/td>\n<td>Packing method (Please see &#8216;Packing Method&#8217; table for all possibilities<\/td>\n<\/tr>\n<tr>\n<td>NAME_SIZE<\/td>\n<td>2<\/td>\n<td>File name size<\/td>\n<\/tr>\n<tr>\n<td>ATTR<\/td>\n<td>4<\/td>\n<td>File attributes<\/td>\n<\/tr>\n<tr>\n<td>HIGH_PACK_SIZE<\/td>\n<td>4<\/td>\n<td>High 4 bytes of 64-bit value of compressed file size. Optional value, presents only if bit 0x100 in HEAD_FLAGS is set.<\/td>\n<\/tr>\n<tr>\n<td>HIGH_UNP_SIZE<\/td>\n<td>4<\/td>\n<td>High 4 bytes of 64-bit value of uncompressed file size. Optional value, presents only if bit 0x100 in HEAD_FLAGS is set.<\/td>\n<\/tr>\n<tr>\n<td>FILE_NAME<\/td>\n<td>NAME_SIZE bytes<\/td>\n<td>File name &#8211; string of NAME_SIZE bytes size<\/td>\n<\/tr>\n<tr>\n<td>SALT<\/td>\n<td>8<\/td>\n<td>present if (HEAD_FLAGS &amp; 0x400)\u00a0!= 0<\/td>\n<\/tr>\n<tr>\n<td>EXT_TIME<\/td>\n<td>variable size<\/td>\n<td>present if (HEAD_FLAGS &amp; 0x1000)\u00a0!= 0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>But the actual implementation of HEAD_CRC is the lower bits of CRC32 of header defined as in HEAD_SIZE without HEAD_CRC part calculated with standard polynomial of 0xEDB88320. I write it up here because RAR spec documents are crap. I hope this saves a couple of hours for someone.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From Forensics Wiki: Field Name Size (bytes) Description HEAD_CRC 2 CRC of fields from HEAD_TYPE to FILEATTR and file name HEAD_TYPE 1 Header Type: 0x74 HEAD_FLAGS 2 Bit Flags (Please see &#8216;Bit Flags for File in Archive&#8217; table for all possibilities) HEAD_SIZE 2 File header full size including file name and comments PACK_SIZE 4 Compressed &hellip; <a href=\"https:\/\/manatails.net\/blog\/2016\/03\/rar-header\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">RAR header<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-471","post","type-post","status-publish","format-standard","hentry","category-computer"],"_links":{"self":[{"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/posts\/471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/comments?post=471"}],"version-history":[{"count":2,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/posts\/471\/revisions"}],"predecessor-version":[{"id":474,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/posts\/471\/revisions\/474"}],"wp:attachment":[{"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/media?parent=471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/categories?post=471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/tags?post=471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}