mirror of
https://github.com/modmii/SysCheck-ModMii-Edition.git
synced 2024-11-22 08:09:19 +01:00
-Improved code for "Beer Ticket" check
-Fixed runtime IOS type check TODO: -Update function definitely isn't working, need to fix it -Integrate vIOS check by version number
This commit is contained in:
parent
2899777e11
commit
b541f5dc53
@ -55,6 +55,7 @@ typedef struct {
|
||||
u8 priiloader;
|
||||
bool nandAccess;
|
||||
u32 runningIOS;
|
||||
bool runningIOSType;
|
||||
u32 runningIOSRevision;
|
||||
} SysSettings_t;
|
||||
|
||||
|
19
source/sys.c
19
source/sys.c
@ -389,31 +389,22 @@ inline s32 RemoveBogusTMD(void)
|
||||
return ES_DeleteTitle(0x100000000LL);
|
||||
}
|
||||
|
||||
/* Probably doesn't work */
|
||||
inline bool CheckBeerTicket(u32 titleID) {
|
||||
char filepath[ISFS_MAXPATH] ATTRIBUTE_ALIGN(0x20);
|
||||
u8 *buffer = NULL;
|
||||
u32 tik_size = 0;
|
||||
//tik *ticket;
|
||||
s32 ret = 0;
|
||||
|
||||
sprintf(filepath, "/ticket/00000001/%08x.tik", titleID);
|
||||
if (read_isfs(filepath, &buffer, &tik_size)) {
|
||||
gprintf("Failed to read IOS%u ticket\n", titleID);
|
||||
return false;
|
||||
}
|
||||
//ticket = (tik*)(buffer);
|
||||
//gprintf("Key in IOS%08x ticket is %s.\n", titleID, ticket->cipher_title_key);
|
||||
int i;
|
||||
for (i = 0; i < tik_size - sizeof("GottaGetSomeBeer")-1; i++)
|
||||
{
|
||||
if (!strncmp((char*)buffer + i, "GottaGetSomeBeer", sizeof("GottaGetSomeBeer")-1)) {
|
||||
|
||||
if (tik_size != 676) return false;
|
||||
ret = !strcmp((char*)buffer + 0x01BF, "GottaGetSomeBeer");
|
||||
free(buffer);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
free(buffer);
|
||||
return false;
|
||||
//return !strcmp((char*)ticket->cipher_title_key, "GottaGetSomeBeer");
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline bool CheckIOSType(void) {
|
||||
|
@ -50,6 +50,7 @@ int main(int argc, char **argv)
|
||||
arguments.USB = strlen(argv[0]) && (argv[0][0] == 'U' || argv[0][0] == 'u');
|
||||
|
||||
InitGecko();
|
||||
gprintf("==============================================================================");
|
||||
if(argc>=1){
|
||||
int i;
|
||||
for(i=0; i<argc; i++){
|
||||
@ -336,7 +337,7 @@ int main(int argc, char **argv)
|
||||
if (SystemInfo.nandAccess) get_miosinfo(SystemInfo.miosInfo);
|
||||
|
||||
// Check running IOS type so we don't have to reload it later
|
||||
if(SystemInfo.deviceType == CONSOLE_WII_U) ios[SystemInfo.runningIOS].infovIOS = CheckIOSType();
|
||||
SystemInfo.runningIOSType = (SystemInfo.deviceType == CONSOLE_WII_U) && CheckIOSType();
|
||||
|
||||
// For each titles found
|
||||
for (i = SystemInfo.countIOS; i--;)
|
||||
@ -707,7 +708,7 @@ int main(int argc, char **argv)
|
||||
|
||||
// Display Title
|
||||
sprintf(ReportBuffer[APP_TITLE], TXT_AppTitle, TXT_AppVersion);
|
||||
sprintf(ReportBuffer[APP_IOS], TXT_AppIOS, ios[SystemInfo.runningIOS].infovIOS ? "v" : "", SystemInfo.runningIOS, SystemInfo.runningIOSRevision);
|
||||
sprintf(ReportBuffer[APP_IOS], TXT_AppIOS, SystemInfo.runningIOSType ? "v" : "", SystemInfo.runningIOS, SystemInfo.runningIOSRevision);
|
||||
SystemInfo.validregion = SystemInfo.systemRegion >= CONF_REGION_JP && SystemInfo.systemRegion <= CONF_REGION_CN;
|
||||
|
||||
// Display the console region
|
||||
|
Loading…
Reference in New Issue
Block a user