|
|
|
|
|
by landave
2963 days ago
|
|
Of course, but I would still strongly advise against this. If you really cannot avoid implementing something like this, 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:
CPP/7zip/UI/Common/OpenArchive.cpp: CPP/7zip/Archive/Rar/Rar5Handler.cpp: 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...
https://github.com/file/file/blob/f0a725a13fe0c1b046d8e07057... :)