SCE Decryption: Detect illegal RAP files

This commit is contained in:
Eladash 2021-03-13 08:21:18 +02:00 committed by Megamouse
parent 7a7b168af3
commit aff63028d4
3 changed files with 9 additions and 4 deletions

View file

@ -1335,7 +1335,12 @@ bool SELFDecrypter::GetKeyFromRap(u8* content_id, u8* npdrm_key)
}
self_log.notice("Loading RAP file %s.rap", ci_str);
rap_file.read(rap_key, 0x10);
if (rap_file.read(rap_key, 0x10) != 0x10)
{
self_log.fatal("Failed to load %s: RAP file exists but is invalid. Try reinstalling it.", rap_path);
return false;
}
// Convert the RAP key.
rap_to_rif(rap_key, npdrm_key);