Merge pull request #14801 from unknownbrackets/reporting

Reporting: Calculate CRC for PSN games
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2021-09-07 09:14:55 +02:00
commit bc45634ed3
2 files changed
+8 -6

No files matched your search

+7 -4
View File
@@ -44,10 +44,13 @@ BlockDevice *constructBlockDevice(FileLoader *fileLoader) {
size_t size = fileLoader->ReadAt(0, 1, 4, buffer);
if (size == 4 && !memcmp(buffer, "CISO", 4))
return new CISOFileBlockDevice(fileLoader);
else if (size == 4 && !memcmp(buffer, "\x00PBP", 4))
return new NPDRMDemoBlockDevice(fileLoader);
else
return new FileBlockDevice(fileLoader);
if (size == 4 && !memcmp(buffer, "\x00PBP", 4)) {
uint32_t psarOffset = 0;
size = fileLoader->ReadAt(0x24, 1, 4, &psarOffset);
if (size == 4 && psarOffset < fileLoader->FileSize())
return new NPDRMDemoBlockDevice(fileLoader);
}
return new FileBlockDevice(fileLoader);
}
u32 BlockDevice::CalculateCRC(volatile bool *cancel) {
+1 -2
View File
@@ -107,8 +107,7 @@ namespace Reporting
static int CalculateCRCThread() {
SetCurrentThreadName("ReportCRC");
// TODO: Use the blockDevice from pspFileSystem?
FileLoader *fileLoader = ConstructFileLoader(crcFilename);
FileLoader *fileLoader = ResolveFileLoaderTarget(ConstructFileLoader(crcFilename));
BlockDevice *blockDevice = constructBlockDevice(fileLoader);
u32 crc = 0;