for some reason 7z dropped the signature for zip at some point.

so add our own PK signature checker
This commit is contained in:
zeromus 2021-06-05 05:16:26 -04:00
parent f92b4ae541
commit 84ae911e09
1 changed files with 12 additions and 0 deletions

View File

@ -370,6 +370,18 @@ void initArchiveSystem()
for(int j=0;j<len;j++)
fr.signature.push_back(((char*)prop.bstrVal)[j]);
//for some reason 7z dropped the signature for zip at some point
//it was working perfectly fine before...
GetHandlerProperty2(i,NArchive::kExtension,&prop);
if(!wcscmp((wchar_t*)prop.bstrVal,L"zip z01 zipx jar xpi odt ods docx xlsx epub ipa apk appx"))
{
if(fr.signature.size() == 0)
{
fr.signature.push_back('P');
fr.signature.push_back('K');
}
}
GetHandlerProperty2(i,NArchive::kClassID,&prop);
memcpy((char*)&fr.guid,(char*)prop.bstrVal,16);