diff --git a/installer/source/getios.cpp b/installer/source/getios.cpp index 1262a25..ffab8a5 100644 --- a/installer/source/getios.cpp +++ b/installer/source/getios.cpp @@ -141,3 +141,35 @@ bool getIOS(int ios) return false; } + +s32 GetTMD(u64 TicketID, signed_blob **Output, u32 *Length) +{ + signed_blob* TMD = NULL; + + u32 TMD_Length; + s32 ret; + + /* Retrieve TMD length */ + ret = ES_GetStoredTMDSize(TicketID, &TMD_Length); + if (ret < 0) + return ret; + + /* Allocate memory */ + TMD = (signed_blob*)memalign(32, (TMD_Length+31)&(~31)); + if (!TMD) + return IPC_ENOMEM; + + /* Retrieve TMD */ + ret = ES_GetStoredTMD(TicketID, TMD, TMD_Length); + if (ret < 0) + { + free(TMD); + return ret; + } + + /* Set values */ + *Output = TMD; + *Length = TMD_Length; + + return 0; +} \ No newline at end of file diff --git a/installer/source/main.cpp b/installer/source/main.cpp index 4e62d47..37c1316 100644 --- a/installer/source/main.cpp +++ b/installer/source/main.cpp @@ -26,17 +26,23 @@ int main(int argc, char **argv) { menu(); - if(CheckAppFound(GetTitleID())) - { - WII_LaunchTitle(0x0001000154484246); + signed_blob *p_tmd = NULL; + u32 len; + s32 ret; - } - else + ret = GetTMD(0x0001000154484246LL, &p_tmd, &len); + + if(ret < 0) { *(vu32*)0x8132FFFB = 0x50756E65; DCFlushRange((void*)0x8132FFFB, 4); SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); } + else + { + WII_LaunchTitle(0x0001000154484246); + + } return 0; } diff --git a/installer/source/menu.cpp b/installer/source/menu.cpp index dff1f0a..3b5f5c0 100644 --- a/installer/source/menu.cpp +++ b/installer/source/menu.cpp @@ -62,7 +62,6 @@ void fill_menu_main() else { text1.push_back(""); - text1.push_back(""); } text1.push_back(""); text1.push_back("Copyright");