diff --git a/source/firm.c b/source/firm.c index 65f1e83..d23d854 100755 --- a/source/firm.c +++ b/source/firm.c @@ -273,8 +273,8 @@ static inline u32 loadFirm(FirmwareType firmType) if(!fileRead(firm, "/luma/firmware.bin") || (((u32)section[2].address >> 8) & 0xFF) != 0x68) error("An old unsupported FIRM has been detected.\nCopy firmware.bin in /luma to boot"); - //9.6 O3DS FIRM - firmVersion = 0x49; + //No assumption regarding FIRM version + firmVersion = 0xffffffff; } else decryptExeFs((u8 *)firm); diff --git a/source/patches.c b/source/patches.c index 9ad3f45..f95a739 100644 --- a/source/patches.c +++ b/source/patches.c @@ -119,12 +119,15 @@ void reimplementSvcBackdoor(u8 *pos, u32 size) u32 *svcTable = (u32 *)(pos + *(u32 *)(pos + 0xFFFF0008 - svcOffset - 0xFFF00000 + 8) - 0xFFF00000); //SVC handler address while(*svcTable) svcTable++; //Look for SVC0 (NULL) - u32 *freeSpace; - for(freeSpace = exceptionsPage; *freeSpace != 0xFFFFFFFF; freeSpace++); + if(svcTable[0x7B] == 0) + { + u32 *freeSpace; + for(freeSpace = exceptionsPage; *freeSpace != 0xFFFFFFFF; freeSpace++); - memcpy(freeSpace, svcBackdoor, 40); + memcpy(freeSpace, svcBackdoor, 40); - svcTable[0x7B] = 0xFFFF0000 + ((u8 *)freeSpace - (u8 *)exceptionsPage); + svcTable[0x7B] = 0xFFFF0000 + ((u8 *)freeSpace - (u8 *)exceptionsPage); + } } void patchTitleInstallMinVersionCheck(u8 *pos, u32 size) @@ -133,7 +136,7 @@ void patchTitleInstallMinVersionCheck(u8 *pos, u32 size) u8 *off = memsearch(pos, pattern, size, 4); - off[4] = 0xE0; + if(off != NULL) off[4] = 0xE0; } void applyLegacyFirmPatches(u8 *pos, FirmwareType firmType)