mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-09 09:39:44 +00:00
Debug SPRX check
This commit is contained in:
parent
f48c535802
commit
6f9adbd162
1 changed files with 22 additions and 1 deletions
|
@ -1343,6 +1343,27 @@ static bool IsSelfElf32(const fs::file& f)
|
||||||
return (elf_class[4] == 1);
|
return (elf_class[4] == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool IsDebugSelf(const fs::file& f)
|
||||||
|
{
|
||||||
|
if (f.size() < 0x18)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the key version.
|
||||||
|
f.seek(0x08);
|
||||||
|
|
||||||
|
const u16 key_version = f.read<le_t<u16>>();
|
||||||
|
|
||||||
|
// Check for DEBUG version.
|
||||||
|
if (key_version == 0x80 || key_version == 0xc0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static bool CheckDebugSelf(fs::file& s)
|
static bool CheckDebugSelf(fs::file& s)
|
||||||
{
|
{
|
||||||
if (s.size() < 0x18)
|
if (s.size() < 0x18)
|
||||||
|
@ -1442,7 +1463,7 @@ bool verify_npdrm_self_headers(const fs::file& self, u8* klic_key)
|
||||||
|
|
||||||
self.seek(0);
|
self.seek(0);
|
||||||
|
|
||||||
if (self.size() >= 4 && self.read<u32>() == "SCE\0"_u32)
|
if (self.size() >= 4 && self.read<u32>() == "SCE\0"_u32 && !IsDebugSelf(self))
|
||||||
{
|
{
|
||||||
// Check the ELF file class (32 or 64 bit).
|
// Check the ELF file class (32 or 64 bit).
|
||||||
const bool isElf32 = IsSelfElf32(self);
|
const bool isElf32 = IsSelfElf32(self);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue