diff --git a/Core/FileSystems/BlockDevices.cpp b/Core/FileSystems/BlockDevices.cpp index 0cbd59bb9a..abe6a042dc 100644 --- a/Core/FileSystems/BlockDevices.cpp +++ b/Core/FileSystems/BlockDevices.cpp @@ -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) { diff --git a/Core/Reporting.cpp b/Core/Reporting.cpp index 9f4d7317b6..fc02b27f31 100644 --- a/Core/Reporting.cpp +++ b/Core/Reporting.cpp @@ -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;