diff --git a/include/SysMenuInfo.h b/include/SysMenuInfo.h index a2fb243..b5b3b62 100644 --- a/include/SysMenuInfo.h +++ b/include/SysMenuInfo.h @@ -56,7 +56,7 @@ typedef struct { bool nandAccess; u32 runningIOS; u32 runningIOSRevision; -} SYSSETTINGS; +} SysSettings_t; typedef struct { char name[ISFS_MAXPATH + 1]; diff --git a/include/sys.h b/include/sys.h index faf51a8..5a6c96e 100644 --- a/include/sys.h +++ b/include/sys.h @@ -9,8 +9,10 @@ #define MEM_PROT (MEM_REG_BASE + 0x20a) #define HOLLYWOOD_VERSION (*(vu32*)0x80003138) #define LOADER_STUB (vu32*)0x80001800 -#define IOS_TOP (*((vu32*)0x80003134)) -#define IS_WII_U ((*(vu32*)(0xCd8005A0) >> 16 ) == 0xCAFE) +#define IOS_START (*((vu32*)0x80003130)) +#define IOS_END (*((vu32*)0x80003134)) +//#define IS_WII_U ((*(vu32*)(0xCd8005A0) >> 16 ) == 0xCAFE) +#define IS_WII_U ((*(vu16*)(0xCd8005A2)) == 0xCAFE) #define MAX_ELEMENTS(x) ((sizeof((x))) / (sizeof((x)[0]))) // Turn upper and lower into a full title ID @@ -20,9 +22,6 @@ // Turn upper and lower into a full title ID #define TITLE_LOWER(x) ((u32)(x)) -#define FULL_TITLE_ID(titleId) ((u32)(titleId)) -#define TITLE_ID2(titleId) ((u32)((titleId) >> 32)) - enum { APP_TITLE = 0, APP_IOS, @@ -91,13 +90,13 @@ typedef struct { u32 titleID; u8 num_contents; u32 titleSize; -} IOS; +} IOS_t; typedef struct { bool hasInfo; u32 realRevision; char info[0x10]; -} sysMenu; +} sysMenu_t; typedef struct _U8Header { @@ -155,7 +154,7 @@ void transmitSyscheck(char ReportBuffer[200][100], int *lines); s32 brute_tmd(tmd *p_tmd); s32 get_miosinfo(char *str); int get_title_ios(u64 title); -bool getInfoFromContent(IOS *ios); +bool getInfoFromContent(IOS_t *ios); #ifdef __cplusplus } diff --git a/include/tools.h b/include/tools.h index 14f9154..36bc038 100644 --- a/include/tools.h +++ b/include/tools.h @@ -13,7 +13,7 @@ extern "C" #define CHECK_ARG(X) (!strncmp((X), argv[i], sizeof((X))-1)) #define CHECK_ARG_VAL(X) (argv[i] + sizeof((X))-1) -#define CheckTime() while(!(ticks_to_millisecs(diff_ticks(current_time, gettime())) > 750000)) +#define CheckTime() while(!(ticks_to_millisecs(diff_ticks(current_time, gettime())) > 450)) #define UpdateTime() current_time = gettime(); typedef struct { diff --git a/source/gecko.c b/source/gecko.c index 6340445..27f5cff 100644 --- a/source/gecko.c +++ b/source/gecko.c @@ -55,14 +55,14 @@ char ascii(char s) { bool InitGecko() { - u32 geckoattached = usb_isgeckoalive(EXI_CHANNEL_1); - if (geckoattached) + if(usb_isgeckoalive(EXI_CHANNEL_1)) { usb_flush(EXI_CHANNEL_1); - return true; + geckoinit = true; + } else { + geckoinit = false; } - else return false; + return geckoinit; } - #endif /* NO_DEBUG */ diff --git a/source/languages.c b/source/languages.c index fc9141b..6c82722 100644 --- a/source/languages.c +++ b/source/languages.c @@ -17,7 +17,7 @@ int initLanguages(struct tm today) { - TXT_AppVersion = "v2.3.2 HacksDen Edition"; + TXT_AppVersion = "v2.3.3 HacksDen Edition"; switch (CONF_GetLanguage()) { case CONF_LANG_GERMAN: diff --git a/source/sys.c b/source/sys.c index 68435f8..8b00cbc 100644 --- a/source/sys.c +++ b/source/sys.c @@ -84,7 +84,7 @@ int get_title_ios(u64 title) { return 0; } -bool getInfoFromContent(IOS *ios) { +bool getInfoFromContent(IOS_t *ios) { bool retValue = false; iosinfo_t *iosinfo = NULL; char filepath[ISFS_MAXPATH] ATTRIBUTE_ALIGN(0x20); @@ -327,11 +327,14 @@ inline s32 RemoveBogusTMD(void) inline bool CheckIOSType(void) { if (AHB_ACCESS == false) return false; - u32 start_address = IOS_TOP; - const char WL_String[] = {0x57, 0x4C, 0x3A, 0x20, 0x30, 0x32, 0x2F, 0x30, 0x32, 0x2F, 0x31, 0x32}; // "WL: 02/02/12" + //u32 start_address = IOS_START; + //u32 end_address = IOS_END; + const u32 start_address = 0x90000000; + const u32 end_address = 0x94000000; + const u8 WL_String[] = {0x57, 0x4C, 0x3A, 0x20, 0x30, 0x32, 0x2F, 0x30, 0x32, 0x2F, 0x31, 0x32}; // "WL: 02/02/12" u32 i; - for(i = start_address; i < 0x94000000 - sizeof(WL_String); i++) { - if (memcmp((char*)i, WL_String, sizeof(WL_String)) == 0) return true; + for(i = start_address; i < end_address - sizeof(WL_String); i++) { + if (memcmp((u8*)i, WL_String, sizeof(WL_String)) == 0) return true; } return false; } diff --git a/source/sysCheck.c b/source/sysCheck.c index 9767857..61476d7 100644 --- a/source/sysCheck.c +++ b/source/sysCheck.c @@ -36,9 +36,8 @@ #define VERSION_1_1_0 65536 -extern bool geckoinit; extern void __exception_setreload(int t); -static u32 current_time = 0; +static u64 current_time = 0; // Main int main(int argc, char **argv) @@ -49,7 +48,7 @@ int main(int argc, char **argv) arguments.skipIOScnt = 0; arguments.debug = false; - geckoinit = InitGecko(); + InitGecko(); if(argc>=1){ int i; for(i=0; ititle_id = ((u64)(1) << 32) | 249; brute_tmd(iosTMD); @@ -687,25 +689,12 @@ int main(int argc, char **argv) } } - - // Reload the running IOS - /*sprintf(MSG_Buffer, MSG_ReloadIOS, SystemInfo.runningIOS, SystemInfo.runningIOSRevision); - printLoading(MSG_Buffer); - IosPatch_FULL(false, false, false, false, SystemInfo.runningIOS); - if (SystemInfo.deviceType == CONSOLE_WII_U) { - IosPatch_FULL(false, false, false, false, SystemInfo.runningIOS); - ios[SystemInfo.runningIOS].infovIOS = CheckIOSType(); - } else { - IOS_ReloadIOS(ios[i].titleID); - } - CheckTime(500);*/ - //--Generate Report-- UpdateTime(); printLoading(MSG_GenerateReport); - char ReportBuffer[200][100] = {{0}}; + char ReportBuffer[200][100] = {{0}}; // The maximum display length is actually 73 if (SystemInfo.dvdSupport > 0) formatDate(SystemInfo.dvdSupport, ReportBuffer); @@ -930,13 +919,13 @@ int main(int argc, char **argv) } sprintf(ReportBuffer[lineOffset], "%sIOS%d[%d] (rev %d, Info: hermes-v%d.%d):", ios[i].infovIOS ? "v" : "", ios[i].titleID, ios[i].baseIOS, ios[i].revision, v, s); } else if(ios[i].baseIOS > 0) { - sprintf(ReportBuffer[lineOffset], "%sIOS%d[%d] (rev %d, Info: %s):", ios[i].infovIOS ? "v" : "", ios[i].titleID, ios[i].baseIOS, ios[i].revision, ios[i].info); + snprintf(ReportBuffer[lineOffset], MAX_ELEMENTS(ReportBuffer[0]), "%sIOS%d[%d] (rev %d, Info: %s):", ios[i].infovIOS ? "v" : "", ios[i].titleID, ios[i].baseIOS, ios[i].revision, ios[i].info); } else if (strcmp(ios[i].info, "NULL") != 0 && !ios[i].isStub) { - sprintf(ReportBuffer[lineOffset], "%sIOS%d (rev %d, Info: %s):", ios[i].infovIOS ? "v" : "", ios[i].titleID, ios[i].revision, ios[i].info); + snprintf(ReportBuffer[lineOffset], MAX_ELEMENTS(ReportBuffer[0]), "%sIOS%d (rev %d, Info: %s):", ios[i].infovIOS ? "v" : "", ios[i].titleID, ios[i].revision, ios[i].info); } else if (ios[i].titleID == 249 && ios[i].revision > 11 && ios[i].revision < 18) { sprintf(ReportBuffer[lineOffset], "%sIOS%d[38] (rev %d):", ios[i].infovIOS ? "v" : "", ios[i].titleID, ios[i].revision); } else { - sprintf(ReportBuffer[lineOffset], "%sIOS%d (rev %d):", ios[i].infovIOS ? "v" : "", ios[i].titleID, ios[i].revision); + snprintf(ReportBuffer[lineOffset], MAX_ELEMENTS(ReportBuffer[0]), "%sIOS%d (rev %d):", ios[i].infovIOS ? "v" : "", ios[i].titleID, ios[i].revision); } } @@ -1089,22 +1078,26 @@ int main(int argc, char **argv) if (wpressed & WPAD_BUTTON_UP) { if (LineNr > 0) LineNr--; printReport(ReportBuffer, LineNr, completeReport); + usleep(50000); } if (wpressed & WPAD_BUTTON_DOWN) { if (LineNr < NumLines-14) LineNr++; printReport(ReportBuffer, LineNr, completeReport); + usleep(50000); } if (wpressed & WPAD_BUTTON_LEFT) { if (LineNr > 0) LineNr = LineNr - 15; if (LineNr < 0) LineNr = 0; printReport(ReportBuffer, LineNr, completeReport); + usleep(100000); } if (wpressed & WPAD_BUTTON_RIGHT) { if (LineNr < NumLines-14) LineNr = LineNr + 15; if (LineNr + 14 > NumLines) LineNr = NumLines-14; printReport(ReportBuffer, LineNr, completeReport); + usleep(100000); } } }