Reduced pattern size, fixed N3DS NAND0 FIRM size
It's actually a little smaller
This commit is contained in:
parent
899a6853a9
commit
e34ca44715
@ -23,8 +23,8 @@ void getEmunandSect(u32 *off, u32 *head){
|
|||||||
|
|
||||||
void getSDMMC(void *pos, u32 *off, u32 size){
|
void getSDMMC(void *pos, u32 *off, u32 size){
|
||||||
//Look for struct code
|
//Look for struct code
|
||||||
unsigned char pattern[] = {0x01, 0x21, 0x20, 0x18, 0x20, 0x30};
|
unsigned char pattern[] = {0x01, 0x21, 0x20, 0x18, 0x20};
|
||||||
*off = (u32)memsearch(pos, pattern, size, 6);
|
*off = (u32)memsearch(pos, pattern, size, 5);
|
||||||
|
|
||||||
//Get DCD values
|
//Get DCD values
|
||||||
unsigned char buf[4];
|
unsigned char buf[4];
|
||||||
@ -50,9 +50,9 @@ void getEmuRW(void *pos, u32 size, u32 *readOff, u32 *writeOff){
|
|||||||
|
|
||||||
void getMPU(void *pos, u32 *off, u32 size){
|
void getMPU(void *pos, u32 *off, u32 size){
|
||||||
//Look for MPU pattern
|
//Look for MPU pattern
|
||||||
unsigned char pattern[] = {0x03, 0x00, 0x24, 0x00, 0x00, 0x00, 0x10};
|
unsigned char pattern[] = {0x03, 0x00, 0x24, 0x00, 0x00};
|
||||||
|
|
||||||
*off = (u32)memsearch(pos, pattern, size, 7);
|
*off = (u32)memsearch(pos, pattern, size, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void getEmuCode(void *pos, u32 *off, u32 size){
|
void getEmuCode(void *pos, u32 *off, u32 size){
|
||||||
|
@ -29,7 +29,7 @@ u8 loadFirm(void){
|
|||||||
if((pressed & BUTTON_L1R1) == BUTTON_L1R1){
|
if((pressed & BUTTON_L1R1) == BUTTON_L1R1){
|
||||||
mode = 0;
|
mode = 0;
|
||||||
//Read FIRM from NAND and write to FCRAM
|
//Read FIRM from NAND and write to FCRAM
|
||||||
firmSize = console ? 0xF2C00 : 0xE9000;
|
firmSize = console ? 0xF2000 : 0xE9000;
|
||||||
nandFirm0((u8*)firmLocation, firmSize, console);
|
nandFirm0((u8*)firmLocation, firmSize, console);
|
||||||
if(memcmp((u8*)firmLocation, "FIRM", 4) != 0) return 1;
|
if(memcmp((u8*)firmLocation, "FIRM", 4) != 0) return 1;
|
||||||
}
|
}
|
||||||
|
@ -34,18 +34,18 @@ u8 sigPat2[4] = {0x00, 0x20, 0x70, 0x47};
|
|||||||
|
|
||||||
void getSignatures(void *pos, u32 size, u32 *off, u32 *off2){
|
void getSignatures(void *pos, u32 size, u32 *off, u32 *off2){
|
||||||
//Look for signature checks
|
//Look for signature checks
|
||||||
unsigned char pattern[] = {0xC0, 0x1C, 0x76, 0xE7, 0x20};
|
unsigned char pattern[] = {0xC0, 0x1C, 0x76, 0xE7};
|
||||||
unsigned char pattern2[] = {0x70, 0xB5, 0x22, 0x4D, 0x0C};
|
unsigned char pattern2[] = {0x70, 0xB5, 0x22, 0x4D, 0x0C};
|
||||||
|
|
||||||
*off = (u32)memsearch(pos, pattern, size, 5);
|
*off = (u32)memsearch(pos, pattern, size, 4);
|
||||||
*off2 = (u32)memsearch(pos, pattern2, size, 5);
|
*off2 = (u32)memsearch(pos, pattern2, size, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void getReboot(void *pos, u32 size, u32 *off, u32 *off2){
|
void getReboot(void *pos, u32 size, u32 *off, u32 *off2){
|
||||||
//Look for FIRM reboot code
|
//Look for FIRM reboot code
|
||||||
unsigned char pattern[] = {0x8D, 0xE5, 0x00, 0xC0, 0x91, 0xE5};
|
unsigned char pattern[] = {0x8D, 0xE5, 0x00, 0xC0, 0x91};
|
||||||
unsigned char pattern2[] = {0xF0, 0x4F, 0x2D, 0xE9, 0x3C};
|
unsigned char pattern2[] = {0xF0, 0x4F, 0x2D, 0xE9, 0x3C};
|
||||||
|
|
||||||
*off = (u32)memsearch(pos, pattern, size, 6) + 2;
|
*off = (u32)memsearch(pos, pattern, size, 5) + 2;
|
||||||
*off2 = (u32)memsearch(pos, pattern2, size, 5);
|
*off2 = (u32)memsearch(pos, pattern2, size, 5);
|
||||||
}
|
}
|
Reference in New Issue
Block a user