|
> you should inspect the 7-Zip code in order to be 100% sure that the magic number detection in your filter is identical (or matches a superset) to the one from 7-Zip CPP/7zip/Archive/Rar/RarHandler.cpp: #define SIGNATURE { 0x52 , 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00 }
CPP/7zip/UI/Common/OpenArchive.cpp: const Byte kRarHeader[] = { 0x52 , 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00 };
CPP/7zip/Archive/Rar/Rar5Handler.cpp: #define SIGNATURE { 0x52 , 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0 }
Those are the two magic numbers for RAR archive version 1.50 onwards and RAR archive version 5.0 onwards respectively, and those are the places they are referenced in the 7-zip source code. I looked at the source archive of the 18.05 version, downloaded from https://www.7-zip.org/a/7z1805-src.7z. I guess if you wanted to be really rigorous you'd look at previous versions as well. If the 7-zip project makes use of a version control system and that vcs supports the equivalent of git blame then that should not be too difficult of a task for whoever wanted to go to that extent of investigation.And here is where one copy of the 'file' command identifies the same magic numbers as RAR archives: https://github.com/file/file/blob/f0a725a13fe0c1b046d8e07057... 0 string Rar!\x1a\7\0 RAR archive data
https://github.com/file/file/blob/f0a725a13fe0c1b046d8e07057... 0 string Rar!\x1a\7\1\0 RAR archive data, v5
:) |