From 6af658a98d97067cc04b1b1d8100dc6382961bcb Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Fri, 1 Jun 2012 12:17:17 +0200 Subject: [PATCH] Revert "simplify commit 90582812fccc509de5f796c31477790f747e7f23" This reverts commit 4622e2fa3a1f0bc029e7a455f5c70da5b288c0be. --- installer/source/getios.cpp | 32 ++++++++++++++++++++++++++++++++ installer/source/main.cpp | 16 +++++++++++----- installer/source/menu.cpp | 1 - 3 files changed, 43 insertions(+), 6 deletions(-) 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");