Added a check to prevent pre-2.0 stage1s from being installed

This commit is contained in:
Aurora 2016-06-09 17:27:10 +02:00
parent a7c43cd93f
commit f23ac51984

View File

@ -72,7 +72,7 @@ static inline void installer(u32 a9lhBoot)
path = "a9lh/otp.bin";
if(fileRead((void *)OTP_OFFSET, path) != 256)
{
u8 zeroes[256] = {0};
const u8 zeroes[256] = {0};
if(memcmp((void *)OTP_FROM_MEM, zeroes, 256) == 0)
shutdown(1, "Error: otp.bin doesn't exist and can't be dumped");
@ -149,6 +149,10 @@ static inline void installer(u32 a9lhBoot)
if(!size || size > MAX_STAGE1_SIZE)
shutdown(1, "Error: payload_stage1.bin doesn't exist or\nexceeds max size");
const u8 zeroes[688] = {0};
if(memcmp(zeroes, (void *)STAGE1_OFFSET, 688) == 0)
shutdown(1, "Error: the payload_stage1.bin you're attempting\nto install is not compatible");
//Read stage2
memset32((void *)STAGE2_OFFSET, 0, MAX_STAGE2_SIZE);
path = "a9lh/payload_stage2.bin";