aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2019-06-19 18:55:48 +0200
committerArisotura <thetotalworm@gmail.com>2019-06-19 18:55:48 +0200
commitf4c7f5c96b5de3df75b9cb95d5e89b13b53a9d39 (patch)
tree1761bd0c60336817f203c31863e5cad65c024189
parent734c9024d5961c33aa61f8cd8352d716d281e19c (diff)
support loading extra RSA keys from dsikeys.bin file (to dump from haxed DSi)
-rw-r--r--src/DSi.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/DSi.cpp b/src/DSi.cpp
index a450666..ab76a76 100644
--- a/src/DSi.cpp
+++ b/src/DSi.cpp
@@ -68,6 +68,8 @@ DSi_SDHost* SDIO;
u64 ConsoleID;
u8 eMMC_CID[16];
+u8 ITCMInit[0x8000];
+
bool Init()
{
@@ -112,6 +114,8 @@ void Reset()
NDMACnt[0] = 0; NDMACnt[1] = 0;
for (int i = 0; i < 8; i++) NDMAs[i]->Reset();
+ memcpy(NDS::ARM9->ITCM, ITCMInit, 0x8000);
+
DSi_I2C::Reset();
DSi_AES::Reset();
@@ -303,6 +307,22 @@ bool LoadNAND()
fclose(f);
}
+ memset(ITCMInit, 0, 0x8000);
+
+ f = fopen("dsikeys.bin", "rb");
+ if (f)
+ {
+ // first 0x2524 bytes are loaded to 0x01FFC400
+
+ u32 dstaddr = 0x01FFC400;
+ fread(&ITCMInit[dstaddr & 0x7FFF], 0x2524, 1, f);
+ fclose(f);
+ }
+ else
+ {
+ printf("DSi keys not found\n");
+ }
+
return true;
}