Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.

Commit

Permalink
Join 9.9TWN and 10.1K
Browse files Browse the repository at this point in the history
Now condition use `region` variable.
  • Loading branch information
d3m3vilurr committed Apr 30, 2016
1 parent b313192 commit b13742b
Showing 1 changed file with 36 additions and 19 deletions.
55 changes: 36 additions & 19 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ void bnInitParamsByFirmware() {
Result bnInitParamsByHomeMenu() {
u32 hProcess = 0, ret;
vu32 t = 0x11111111;

u8 region;

ret = svc_openProcess(&hProcess, ntrConfig->HomeMenuPid);
if (ret != 0) {
printf("openProcess failed:%08x\n", ret);
Expand All @@ -332,7 +333,23 @@ Result bnInitParamsByHomeMenu() {
svc_closeHandle(hProcess);
t = *(u32*)(tmpBuffer);
printf("0x00200000 in HomeMenu: %08x\n", t);


ret = cfguInit();
if (ret != 0) {
printf("cfg:u init failed:%08x\n", ret);
return ret;
}
ret = CFGU_SecureInfoGetRegion(&region);
if (ret != 0) {
printf("CFGU_SecureInfoGetRegion failed:%08x\n", ret);
return ret;
}
if (region >= 7) {
printf("Wrong region:%d\n", region);
return -9;
}
cfguExit();

if (t == 0xe3a08001 ) {
// old 3ds 10.6.0-27K
ntrConfig->HomeMenuVersion = SYSTEM_VERSION(10, 6, 0);
Expand Down Expand Up @@ -468,23 +485,23 @@ Result bnInitParamsByHomeMenu() {
}

if (t == 0xe12fff1e ) {
// TW 9.9.0
ntrConfig->HomeMenuVersion = SYSTEM_VERSION(9, 9, 0);
ntrConfig->HomeMenuInjectAddr = 0x13c0ac;
ntrConfig->HomeFSReadAddr = 0x118c04;
ntrConfig->HomeCardUpdateInitAddr = 0x134794;
ntrConfig->HomeFSUHandleAddr = 0x2250e4;
ntrConfig->HomeAptStartAppletAddr = 0x1288c8;
}

if (t == 0xe12fff1e && ntrConfig->isNew3DS) {
// new3ds 10.1.0-23K
ntrConfig->HomeMenuVersion = SYSTEM_VERSION(10, 1, 0);
ntrConfig->HomeMenuInjectAddr = 0x12ddc4;
ntrConfig->HomeFSReadAddr = 0x12c090;
ntrConfig->HomeCardUpdateInitAddr = 0x118cc0;
ntrConfig->HomeFSUHandleAddr = 0x32dfa4;
ntrConfig->HomeAptStartAppletAddr = 0x12e8fc;
if (region == 5) {
// KR 10.1.0-23
ntrConfig->HomeMenuVersion = SYSTEM_VERSION(10, 1, 0);
ntrConfig->HomeMenuInjectAddr = 0x12ddc4;
ntrConfig->HomeFSReadAddr = 0x12c090;
ntrConfig->HomeCardUpdateInitAddr = 0x118cc0;
ntrConfig->HomeFSUHandleAddr = 0x32dfa4;
ntrConfig->HomeAptStartAppletAddr = 0x12e8fc;
} else {
// TW 9.9.0
ntrConfig->HomeMenuVersion = SYSTEM_VERSION(9, 9, 0);
ntrConfig->HomeMenuInjectAddr = 0x13c0ac;
ntrConfig->HomeFSReadAddr = 0x118c04;
ntrConfig->HomeCardUpdateInitAddr = 0x134794;
ntrConfig->HomeFSUHandleAddr = 0x2250e4;
ntrConfig->HomeAptStartAppletAddr = 0x1288c8;
}
}

if (t == 0x0032dde8 ) {
Expand Down

0 comments on commit b13742b

Please sign in to comment.