Okay, so there are mentions in the log of sig file not being found of sig mismatch if I tamper with the pak files.
There are two delegates that get triggered when something goes wrong:
This one when pak is tampered with:
DECLARE_MULTICAST_DELEGATE_OneParam(FPakChunkSignatureCheckFailedHandler, const FPakChunkSignatureCheckFailedData&);
This one when sig file is missing:
DECLARE_MULTICAST_DELEGATE_OneParam(FPakMasterSignatureTableCheckFailureHandler, const FString&);
These get called pretty early in the engine initialization process, so you can use something like this if you want make sure you’re delegates are hooked early enough to catch them:
SomeClass.h
static FDelayedAutoRegisterHelper _pakIntegrityChecker;
SomeClass.cpp
FDelayedAutoRegisterHelper SomeClass::_pakIntegrityChecker(EDelayedRegisterRunPhase::FileSystemReady, []()
{
FPakPlatformFile::GetPakSigningFailureHandlerData().ChunkSignatureCheckFailedDelegate.AddLambda([](const FPakChunkSignatureCheckFailedData& data)
{
const FString message = FString::Printf(TEXT("Pak file or matching sig file integrity compromised: %s\nTry verifying the game files and starting the game again"), *data.PakFilename);
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(message));
FGenericPlatformMisc::RequestExit(true);
});
FPakPlatformFile::GetPakSigningFailureHandlerData().MasterSignatureTableCheckFailedDelegate.AddLambda([](const FString& filename)
{
const FString message = FString::Printf(TEXT("Pak file or matching sig file integrity compromised: %s\nTry verifying the game files and starting the game again"), *filename);
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(message));
FGenericPlatformMisc::RequestExit(true);
});
});