Changed stage1 position to the proper one (0x808FB90 in ARM9 memory), changed NAND FIRM0 hash check to only check up to the start of section2 (as it is all it is needed)

This commit is contained in:
Aurora 2016-06-07 14:35:52 +02:00
parent 4ec05a33bc
commit fbef831d25
3 changed files with 16 additions and 16 deletions

View File

@ -5,7 +5,6 @@
#include "fs.h" #include "fs.h"
#include "memory.h" #include "memory.h"
#include "fatfs/ff.h" #include "fatfs/ff.h"
#include "utils.h"
static FATFS fs; static FATFS fs;

View File

@ -22,8 +22,8 @@ static const u8 firm0Hash[0x20] = {
}; };
static const u8 firm0A9lhHash[0x20] = { static const u8 firm0A9lhHash[0x20] = {
0x6A, 0x5A, 0x74, 0x5F, 0x3B, 0x83, 0x8C, 0xDA, 0x25, 0x1C, 0xA9, 0xDC, 0x59, 0x4E, 0x1B, 0x01, 0x79, 0x3D, 0x35, 0x7B, 0x8F, 0xF1, 0xFC, 0xF0, 0x8F, 0xB6, 0xDB, 0x51, 0x31, 0xD4, 0xA7, 0x74,
0x00, 0x93, 0x27, 0x81, 0x59, 0xAF, 0x2D, 0x3B, 0x76, 0x98, 0xB1, 0xAB, 0xB2, 0x5F, 0x2E, 0x3E 0x8E, 0xF0, 0x4A, 0xB1, 0xA6, 0x7F, 0xCD, 0xAB, 0x0C, 0x0A, 0xC0, 0x69, 0xA7, 0x9D, 0xC5, 0x04
}; };
static const u8 firm1Hash[0x20] = { static const u8 firm1Hash[0x20] = {
@ -126,7 +126,7 @@ static inline void installer(u32 a9lhBoot)
if(!verifyHash((void *)FIRM0_OFFSET, FIRM0_SIZE, firm0Hash)) if(!verifyHash((void *)FIRM0_OFFSET, FIRM0_SIZE, firm0Hash))
shutdown(1, "Error: firm0.bin is invalid or corrupted"); shutdown(1, "Error: firm0.bin is invalid or corrupted");
} }
else if(!verifyHash((void *)FIRM0_OFFSET, STAGE1_POSITION, firm0A9lhHash)) else if(!verifyHash((void *)FIRM0_OFFSET, SECTION2_POSITION, firm0A9lhHash))
shutdown(1, "Error: NAND FIRM0 is invalid"); shutdown(1, "Error: NAND FIRM0 is invalid");
if(!a9lhBoot) if(!a9lhBoot)

View File

@ -15,11 +15,12 @@
#define FIRM0_OFFSET 0x24200000 #define FIRM0_OFFSET 0x24200000
#define FIRM1_OFFSET 0x24300000 #define FIRM1_OFFSET 0x24300000
#define FIRM0_SIZE 0xF3000 #define FIRM0_SIZE 0xF3000
#define SECTION2_POSITION 0x66A00
#define FIRM1_SIZE 0xF2000 #define FIRM1_SIZE 0xF2000
#define STAGE1_POSITION 0xF0400 #define STAGE1_POSITION 0xF0590
#define STAGE1_OFFSET FIRM0_OFFSET + STAGE1_POSITION #define STAGE1_OFFSET FIRM0_OFFSET + STAGE1_POSITION
#define STAGE2_OFFSET 0x24400000 #define STAGE2_OFFSET 0x24400000
#define MAX_STAGE1_SIZE 0x2000 #define MAX_STAGE1_SIZE 0x1E70
#define MAX_STAGE2_SIZE 0x2800 #define MAX_STAGE2_SIZE 0x2800
static inline void installer(u32 a9lhBoot); static inline void installer(u32 a9lhBoot);