Added support for dev units sysupdater FIRM (untested but should work)
This commit is contained in:
parent
acd9c04ff6
commit
3474faa4a2
@ -545,7 +545,7 @@ void computePinHash(u8 *outbuf, const u8 *inbuf)
|
|||||||
cipherText[AES_BLOCK_SIZE];
|
cipherText[AES_BLOCK_SIZE];
|
||||||
|
|
||||||
sdmmc_get_cid(1, (u32 *)cid);
|
sdmmc_get_cid(1, (u32 *)cid);
|
||||||
aes_use_keyslot(4); //Console-unique keyslot whose keys are set by the ARM9 bootROM
|
aes_use_keyslot(0x04); //Console-unique keyslot whose keys are set by the ARM9 bootROM
|
||||||
aes(cipherText, inbuf, 1, cid, AES_CBC_ENCRYPT_MODE, AES_INPUT_BE | AES_INPUT_NORMAL);
|
aes(cipherText, inbuf, 1, cid, AES_CBC_ENCRYPT_MODE, AES_INPUT_BE | AES_INPUT_NORMAL);
|
||||||
sha(outbuf, cipherText, sizeof(cipherText), SHA_256_MODE);
|
sha(outbuf, cipherText, sizeof(cipherText), SHA_256_MODE);
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,8 @@ u32 firmRead(void *dest, u32 firmType)
|
|||||||
const char *firmFolders[][2] = {{ "00000002", "20000002" },
|
const char *firmFolders[][2] = {{ "00000002", "20000002" },
|
||||||
{ "00000102", "20000102" },
|
{ "00000102", "20000102" },
|
||||||
{ "00000202", "20000202" },
|
{ "00000202", "20000202" },
|
||||||
{ "00000003", "20000003" }};
|
{ "00000003", "20000003" },
|
||||||
|
{ "00000001", "20000001" }};
|
||||||
|
|
||||||
char path[48] = "1:/title/00040138/";
|
char path[48] = "1:/title/00040138/";
|
||||||
concatenateStrings(path, firmFolders[firmType][ISN3DS ? 1 : 0]);
|
concatenateStrings(path, firmFolders[firmType][ISN3DS ? 1 : 0]);
|
||||||
|
@ -62,8 +62,18 @@ void main(void)
|
|||||||
{
|
{
|
||||||
if(needConfig == CREATE_CONFIGURATION) mcuPowerOff();
|
if(needConfig == CREATE_CONFIGURATION) mcuPowerOff();
|
||||||
|
|
||||||
//'0' = NATIVE_FIRM, '1' = TWL_FIRM, '2' = AGB_FIRM
|
switch(launchedFirmTidLow[7])
|
||||||
firmType = launchedFirmTidLow[7] == u'3' ? SAFE_FIRM : (FirmwareType)(launchedFirmTidLow[5] - u'0');
|
{
|
||||||
|
case u'2':
|
||||||
|
firmType = (FirmwareType)(launchedFirmTidLow[5] - u'0');
|
||||||
|
break;
|
||||||
|
case u'3':
|
||||||
|
firmType = SAFE_FIRM;
|
||||||
|
break;
|
||||||
|
case u'1':
|
||||||
|
firmType = SYSUPDATER_FIRM;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
nandType = (FirmwareSource)BOOTCFG_NAND;
|
nandType = (FirmwareSource)BOOTCFG_NAND;
|
||||||
firmSource = (FirmwareSource)BOOTCFG_FIRM;
|
firmSource = (FirmwareSource)BOOTCFG_FIRM;
|
||||||
@ -238,16 +248,17 @@ void main(void)
|
|||||||
case NATIVE_FIRM:
|
case NATIVE_FIRM:
|
||||||
res = patchNativeFirm(firmVersion, nandType, emuHeader, isA9lhInstalled, isSafeMode, devMode);
|
res = patchNativeFirm(firmVersion, nandType, emuHeader, isA9lhInstalled, isSafeMode, devMode);
|
||||||
break;
|
break;
|
||||||
case SAFE_FIRM:
|
|
||||||
case NATIVE_FIRM1X2X:
|
|
||||||
res = isA9lhInstalled ? patch1x2xNativeAndSafeFirm(devMode) : 0;
|
|
||||||
break;
|
|
||||||
case TWL_FIRM:
|
case TWL_FIRM:
|
||||||
res = patchTwlFirm(firmVersion, devMode);
|
res = patchTwlFirm(firmVersion, devMode);
|
||||||
break;
|
break;
|
||||||
case AGB_FIRM:
|
case AGB_FIRM:
|
||||||
res = patchAgbFirm(devMode);
|
res = patchAgbFirm(devMode);
|
||||||
break;
|
break;
|
||||||
|
case SAFE_FIRM:
|
||||||
|
case SYSUPDATER_FIRM:
|
||||||
|
case NATIVE_FIRM1X2X:
|
||||||
|
res = isA9lhInstalled ? patch1x2xNativeAndSafeFirm(devMode) : 0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(res != 0)
|
if(res != 0)
|
||||||
|
@ -97,6 +97,7 @@ typedef enum FirmwareType
|
|||||||
TWL_FIRM,
|
TWL_FIRM,
|
||||||
AGB_FIRM,
|
AGB_FIRM,
|
||||||
SAFE_FIRM,
|
SAFE_FIRM,
|
||||||
|
SYSUPDATER_FIRM,
|
||||||
NATIVE_FIRM1X2X
|
NATIVE_FIRM1X2X
|
||||||
} FirmwareType;
|
} FirmwareType;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user