Skip to content

Commit

Permalink
Core: Use FileBlockDevice for PBPs without an ISO.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Sep 7, 2021
1 parent 567c7f2 commit 694e92d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Core/FileSystems/BlockDevices.cpp
Expand Up @@ -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) {
Expand Down

0 comments on commit 694e92d

Please sign in to comment.