Merge pull request #20 from Steveice10/master
Add developer UNITINFO patch.
This commit is contained in:
commit
49d49e637a
@ -26,7 +26,8 @@ void configureCFW(const char *configPath)
|
||||
"( ) Use second EmuNAND as default",
|
||||
"( ) Show current NAND in System Settings",
|
||||
"( ) Show GBA boot screen in patched AGB_FIRM",
|
||||
"( ) Enable splash screen with no screen-init" };
|
||||
"( ) Enable splash screen with no screen-init",
|
||||
"( ) Use developer UNITINFO" };
|
||||
|
||||
u32 optionsAmount = sizeof(optionsText) / sizeof(char *);
|
||||
|
||||
|
@ -271,6 +271,15 @@ static inline void patchNativeFirm(u32 nandType, u32 emuHeader, u32 a9lhInstalle
|
||||
*(u16 *)sigOffset2 = sigPatch[0];
|
||||
*((u16 *)sigOffset2 + 1) = sigPatch[1];
|
||||
|
||||
if(CONFIG(7, 1))
|
||||
{
|
||||
//Apply UNITINFO patch
|
||||
u32 unitInfoOffset;
|
||||
|
||||
getUnitInfoValueSet(arm9Section, section[2].size, &unitInfoOffset);
|
||||
*((u8*)unitInfoOffset + 3) = unitInfoPatch[0];
|
||||
}
|
||||
|
||||
//Replace the FIRM loader with the injector
|
||||
injectLoader();
|
||||
}
|
||||
|
@ -19,6 +19,8 @@ const u16 sigPatch[2] = {0x2000, 0x4770};
|
||||
|
||||
const u16 writeBlock[2] = {0x2000, 0x46C0};
|
||||
|
||||
const u8 unitInfoPatch[1] = {0xE3};
|
||||
|
||||
/**************************************************
|
||||
* Functions
|
||||
**************************************************/
|
||||
@ -74,3 +76,11 @@ void getLoader(u8 *pos, u32 size, u32 *loaderOffset, u32 *loaderSize)
|
||||
*loaderOffset = (u32)off - 0x200;
|
||||
*loaderSize = *(u32 *)(off - 0xFC) * 0x200;
|
||||
}
|
||||
|
||||
void getUnitInfoValueSet(u8 *pos, u32 size, u32 *off)
|
||||
{
|
||||
//Look for UNITINFO value being set
|
||||
const u8 pattern[] = {0x01, 0x10, 0xA0, 0x13};
|
||||
|
||||
*off = (u32)memsearch(pos, pattern, size, 4);
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ const u32 mpuPatch[3];
|
||||
const u16 nandRedir[2];
|
||||
const u16 sigPatch[2];
|
||||
const u16 writeBlock[2];
|
||||
const u8 unitInfoPatch[1];
|
||||
|
||||
/**************************************************
|
||||
* Functions
|
||||
@ -25,3 +26,4 @@ void *getReboot(u8 *pos, u32 size);
|
||||
u32 getfOpen(u8 *proc9Offset, void *rebootOffset);
|
||||
u16 *getFirmWrite(u8 *pos, u32 size);
|
||||
void getLoader(u8 *pos, u32 size, u32 *loaderOffset, u32 *loaderSize);
|
||||
void getUnitInfoValueSet(u8 *pos, u32 size, u32* off);
|
||||
|
Reference in New Issue
Block a user