-Corrected the times between messages. It's amazing what accidentally adding several extra 0's can do.

-Fixed a translation for "Unknown".
-Moved a few functions around.
-Made the "Sorting IOS titles" part faster by removing unnecessary SD mount/unmount
This commit is contained in:
Joostinonline 2014-07-25 18:42:07 +00:00
parent f5a0e4381d
commit 599d578ecf
8 changed files with 86 additions and 88 deletions

View File

@ -9,22 +9,6 @@
#define CopyBuf() GRRLIB_Screen2Texture(0, 0, tex_ScreenBuf, GX_FALSE)
#define DrawBuf() GRRLIB_DrawImg(0, 0, tex_ScreenBuf, 0, 1, 1, HEX_WHITE)
extern GRRLIB_ttfFont *myFont;
extern GRRLIB_texImg *tex_background_png;
extern GRRLIB_texImg *tex_Checkicon_png;
extern GRRLIB_texImg *tex_Deleteicon_png;
extern GRRLIB_texImg *tex_Refreshicon_png;
extern GRRLIB_texImg *tex_WiiButtonA_png;
extern GRRLIB_texImg *tex_WiiButtonHome_png;
extern GRRLIB_texImg *tex_WiiButtonMinus_png;
extern GRRLIB_texImg *tex_WiiButtonPlus_png;
extern GRRLIB_texImg *tex_WiiDpadLeft_png;
extern GRRLIB_texImg *tex_WiiDpadRight_png;
extern GRRLIB_texImg *tex_loadingbargrey_png;
extern GRRLIB_texImg *tex_loadingbarblue_png;
extern GRRLIB_texImg *tex_window_png;
extern GRRLIB_texImg *tex_ScreenBuf;
int initGUI(void);
void deinitGUI(void);
int printError(const char* msg);

View File

@ -1,7 +1,8 @@
#ifndef _TOOLS_H_
#define _TOOLS_H_
#ifndef __SYS_H__
#define __SYS_H__
#include <ogc\lwp_watchdog.h>
#include "tools.h"
#define AHB_ACCESS (*(vu32*)0xcd800064 == 0xFFFFFFFF)
#define MEM_REG_BASE 0xd8b4000
@ -11,6 +12,7 @@
#define IS_WII_U ((*(vu32*)(0xCd8005A0) >> 16 ) == 0xCAFE)
#define MAX_ELEMENTS(x) ((sizeof((x))) / (sizeof((x)[0])))
#define CheckTime(X,Y) while(!(ticks_to_millisecs(diff_ticks((X), gettick())) > (Y)))
#define UpdateTime() current_time = gettick();
// Turn upper and lower into a full title ID
#define TITLE_ID(x,y) (((u64)(x) << 32) | (y))
@ -22,10 +24,6 @@
#define FULL_TITLE_ID(titleId) ((u32)(titleId))
#define TITLE_ID2(titleId) ((u32)((titleId) >> 32))
// Values for DetectInput
#define DI_BUTTONS_HELD 0
#define DI_BUTTONS_DOWN 1
enum {
APP_TITLE = 0,
APP_IOS,
@ -87,6 +85,7 @@ typedef struct {
u8 infoContent;
u32 titleID;
u8 num_contents;
u32 titleSize;
} IOS;
typedef struct {
@ -129,7 +128,7 @@ extern "C"
#endif
// Prototypes
u32 DetectInput(u8 DownOrHeld);
char GetSysMenuRegion(u32 sysVersion);
bool GetCertificates(void);
u32 GetSysMenuVersion(void);
@ -146,13 +145,9 @@ bool CheckUSB2(u32 titleID);
bool IsKnownStub(u32 noIOS, s32 noRevision);
s32 GetTMD(u64 TicketID, signed_blob **Output, u32 *Length);
s32 read_file_from_nand(char *filepath, u8 **buffer, u32 *filesize);
int NandStartup(void);
void NandShutdown(void);
int checkSysLoader(void);
void transmitSyscheck(char ReportBuffer[200][100], int *lines);
s32 brute_tmd(tmd *p_tmd);
void *allocate_memory(u32 size);
void logfile(const char *format, ...);
s32 get_miosinfo(char *str);
int get_title_ios(u64 title);
bool getInfoFromContent(IOS *ios);

23
include/tools.h Normal file
View File

@ -0,0 +1,23 @@
#ifndef __TOOLS_H__
#define __TOOLS_H__
#ifdef __cplusplus
extern "C"
{
#endif
// Values for DetectInput
#define DI_BUTTONS_HELD 0
#define DI_BUTTONS_DOWN 1
void logfile(const char *format, ...);
void *allocate_memory(u32 size);
int NandStartup(void);
void NandShutdown(void);
u32 DetectInput(u8 DownOrHeld);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -43,9 +43,6 @@ int initGUI(void) {
// Initialise the Graphics & Video subsystem
GRRLIB_Init();
// Initialise the Wiimotes
WPAD_Init();
//Load Images
myFont = GRRLIB_LoadTTF(tahoma_ttf, tahoma_ttf_size);
tex_background_png = GRRLIB_LoadTexturePNG(background_png);

View File

@ -59,7 +59,7 @@ int initLanguages(struct tm today)
TXT_vBoot2 = "Boot2 v%u";
TXT_NrOfTitles = "Es wurden %d Titel gefunden.";
TXT_NrOfIOS = "Es wurden %d IOS gefunden, von denen %d funktionslos (Stub) sind.";
TXT_AppTitle = "SysCheck %s von Double_A und R2-D2199, JoostinOnline, Nano";
TXT_AppTitle = "SysCheck %s von JoostinOnline, Double_A, R2-D2199, und Nano";
TXT_AppIOS = "...laeuft auf dem IOS%d (rev %d).";
ERR_AllocateMemory = "Speicher fuer %d Titel konnte nicht zugewiesen werden.";
ERR_OpenFile = "Zugriff auf die Speicherdatei des Berichts fehlgeschlagen!";
@ -106,7 +106,7 @@ int initLanguages(struct tm today)
MSG_GetConsoleID = "Obtention de l'identifiant de la console...";
MSG_GetBoot2 = "Obtention de la version du boot2...";
TXT_Region = "Region";
TXT_Unknown = "inconnue";
TXT_Unknown = "Inconnue";
MSG_GetNrOfTitles = "Obtention du nombre de titres...";
ERR_GetNrOfTitles = "Impossible d'obtenir le nombre de titres.";
MSG_GetTitleList = "Obtention de la liste des titres...";
@ -135,7 +135,7 @@ int initLanguages(struct tm today)
TXT_vBoot2 = "Boot2 v%u";
TXT_NrOfTitles = "%d titres trouves.";
TXT_NrOfIOS = "%d IOS trouves sur cette console. %d sont des stubs.";
TXT_AppTitle = "SysCheck %s par Double_A et R2-D2199, JoostinOnline, Nano";
TXT_AppTitle = "SysCheck %s par JoostinOnline, Double_A, R2-D2199, et Nano";
TXT_AppIOS = "...tourne sous l'IOS%d (rev %d).";
ERR_AllocateMemory = "Imposible d'allouer la memoire pour %d titres.";
ERR_OpenFile = "Impossible d'ouvrir le fichier.";
@ -182,7 +182,7 @@ int initLanguages(struct tm today)
MSG_GetConsoleID = "Controllo ID della console...";
MSG_GetBoot2 = "Controllo versione Boot2...";
TXT_Region = "Regione";
TXT_Unknown = "sconosciuto";
TXT_Unknown = "Sconosciuto";
MSG_GetNrOfTitles = "Controllo numero giochi...";
ERR_GetNrOfTitles = "Errore nel controllo numero giochi.";
MSG_GetTitleList = "Controllo elenco giochi...";
@ -211,7 +211,7 @@ int initLanguages(struct tm today)
TXT_vBoot2 = "Boot2 v%u";
TXT_NrOfTitles = "Trovati %d giochi.";
TXT_NrOfIOS = "Trovati %d IOS in questa console. %d di questi sono stub.";
TXT_AppTitle = "SysCheck %s by Double_A and R2-D2199, JoostinOnline, Nano";
TXT_AppTitle = "SysCheck %s by JoostinOnline, Double_A, R2-D2199, and Nano";
TXT_AppIOS = "...appoggiato all'IOS%d (v. %d).";
ERR_AllocateMemory = "Impossibile allocare la memoria per %d giochi.";
ERR_OpenFile = "Impossibile aprire il file!";
@ -258,7 +258,7 @@ int initLanguages(struct tm today)
MSG_GetConsoleID = "Obteniendo ID de la consola...";
MSG_GetBoot2 = "Obteniendo la version de boot2...";
TXT_Region = "Region";
TXT_Unknown = "desconocido";
TXT_Unknown = "Desconocido";
MSG_GetNrOfTitles = "Obteniendo numero de titulos...";
ERR_GetNrOfTitles = "No se pudo obtener numero de titulos.";
MSG_GetTitleList = "Obteniendo lista de titulos...";
@ -287,7 +287,7 @@ int initLanguages(struct tm today)
TXT_vBoot2 = "Boot2 v%u";
TXT_NrOfTitles = "Encontrados %d titulos.";
TXT_NrOfIOS = "Se encontraron %d IOS en esta consola. %d de ellos son stubs.";
TXT_AppTitle = "SysCheck %s por Double_A y R2-D2199, JoostinOnline, Nano";
TXT_AppTitle = "SysCheck %s por JoostinOnline, Double_A, R2-D2199, y Nano";
TXT_AppIOS = "...corre en IOS%d (rev %d).";
ERR_AllocateMemory = "Imposible asignar memoria para %d titulos.";
ERR_OpenFile = "Imposible abrir el archivo!";
@ -334,7 +334,7 @@ int initLanguages(struct tm today)
MSG_GetConsoleID = "Getting the console ID...";
MSG_GetBoot2 = "Getting the boot2 version...";
TXT_Region = "Region";
TXT_Unknown = "unknown";
TXT_Unknown = "Unknown";
MSG_GetNrOfTitles = "Getting number of titles...";
ERR_GetNrOfTitles = "Failed getting number of titles.";
MSG_GetTitleList = "Getting list of titles...";
@ -363,7 +363,7 @@ int initLanguages(struct tm today)
TXT_vBoot2 = "Boot2 v%u";
TXT_NrOfTitles = "Found %d titles.";
TXT_NrOfIOS = "Found %d IOS on this console. %d of them are stub.";
TXT_AppTitle = "SysCheck %s by Double_A and R2-D2199, JoostinOnline, Nano";
TXT_AppTitle = "SysCheck %s by JoostinOnline, Double_A, R2-D2199, and Nano";
TXT_AppIOS = "...runs on IOS%d (rev %d).";
ERR_AllocateMemory = "Unable to allocate the memory for %d titles.";
ERR_OpenFile = "Unable to open the file!";

View File

@ -702,6 +702,7 @@ s32 get_miosinfo(char *str)
else if(CMP_TIME(dm_2_2_time)) strcat(str, " 2.2");
else if(CMP_TIME(dm_2_1_time)) strcat(str, " 2.1");
else if(CMP_TIME(dm_2_0_time)) strcat(str, " 2.0");
else strcat(str, " 1.0");
strcat(str, ")");
return 2;

View File

@ -31,9 +31,9 @@
#include "wiibasics.h"
// Filename
#define REPORT "sd:/sysCheck.csv"
#define HASHLOG "sd:/IOSsyscheck.log"
#define VERSION_1_1_0 65536
#define REPORT "sd:/sysCheck.csv"
#define HASHLOG "sd:/IOSsyscheck.log"
#define VERSION_1_1_0 65536
extern bool geckoinit;
@ -127,27 +127,27 @@ int main(int argc, char **argv)
// Get the console region
printLoading(MSG_GetConsoleRegion);
current_time = gettick();
UpdateTime();
SystemInfo.systemRegion = CONF_GetRegion();
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
SystemInfo.shopcode = 0;
if (!CONF_GetShopCode(&SystemInfo.shopcode)) {
strcpy(SystemInfo.country, CONF_CountryCodes[SystemInfo.shopcode]);
} else {
strcpy(SystemInfo.country, "Unknown");
strcpy(SystemInfo.country, TXT_Unknown);
}
// Get the system menu version
printLoading(MSG_GetSysMenuVer);
current_time = gettick();
UpdateTime();
SystemInfo.sysMenuVer = GetSysMenuVersion();
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
sysMenu systemmenu;
printLoading(MSG_GetHBCVer);
current_time = gettick();
UpdateTime();
homebrew_t homebrew;
homebrew.hbcversion = 0;
@ -220,31 +220,31 @@ int main(int argc, char **argv)
SystemInfo.sysNinVersion = GetSysMenuNintendoVersion(SystemInfo.sysMenuVer);
SystemInfo.sysMenuRegion = GetSysMenuRegion(SystemInfo.sysMenuVer);
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
// Get the running IOS version and revision
printLoading(MSG_GetRunningIOS);
current_time = gettick();
UpdateTime();
u32 runningIOS = IOS_GetVersion();
u32 runningIOSRevision = IOS_GetRevision();
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
// Get the console ID
printLoading(MSG_GetConsoleID);
current_time = gettick();
UpdateTime();
SystemInfo.deviceID = GetDeviceID();
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
// Get the boot2 version
printLoading(MSG_GetBoot2);
current_time = gettick();
UpdateTime();
SystemInfo.boot2version = GetBoot2Version();
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
// Get number of titles
printLoading(MSG_GetNrOfTitles);
current_time = gettick();
UpdateTime();
u32 tempTitles;
if (ES_GetNumTitles(&tempTitles) < 0) {
@ -266,11 +266,11 @@ int main(int argc, char **argv)
deinitGUI();
exit(1);
}
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
// Get list of titles
printLoading(MSG_GetTitleList);
current_time = gettick();
UpdateTime();
if (ES_GetTitles(titles, nbTitles) < 0) {
printError(ERR_GetTitleList);
sleep(5);
@ -313,11 +313,11 @@ int main(int argc, char **argv)
}
SystemInfo.countIOS++;
}
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
// Sort IOS titles
printLoading(MSG_SortTitles);
current_time = gettick();
UpdateTime();
u64 *newTitles = memalign(32, SystemInfo.countIOS*sizeof(u64));
u32 cnt = 0;
@ -332,8 +332,8 @@ int main(int argc, char **argv)
free(titles);
IOS ios[SystemInfo.countIOS];
// ios Liste initialisieren
for (i = SystemInfo.countIOS; i--;) { // Should be slightly faster
// IOS List Initialization
for (i = SystemInfo.countIOS; i--;) {
ios[i].infoContent = 0;
ios[i].titleID = 0;
ios[i].mloadVersion = 0;
@ -350,7 +350,7 @@ int main(int argc, char **argv)
ios[i].infoVersionPatch = false;
}
MountSD();
//MountSD();
NandStartup();
// Check Priiloader
@ -360,8 +360,7 @@ int main(int argc, char **argv)
if (SystemInfo.nandAccess) get_miosinfo(SystemInfo.miosInfo);
// For each titles found
//for (i = 0; i < countIOS; i++)
for (i = SystemInfo.countIOS; i--;) // Should be slightly faster
for (i = SystemInfo.countIOS; i--;)
{
ios[i].titleID = newTitles[i] & 0xFFFFFFFF;
@ -398,20 +397,20 @@ int main(int argc, char **argv)
iosTMD = (tmd*)SIGNATURE_PAYLOAD(iosTMDBuffer);
// Get the title version
u32 titleSize = Title_GetSize_FromTMD(iosTMD);
ios[i].titleSize = Title_GetSize_FromTMD(iosTMD);
ios[i].revision = iosTMD->title_version;
ios[i].isStub = false;
ios[i].infoContent = *(u8 *)((u32)iosTMDBuffer+0x1E7);
ios[i].num_contents = iosTMD->num_contents;
gprintf("ios%d rev%d iosTMD->num_contents = %d size=%d\n", ios[i].titleID, ios[i].revision, iosTMD->num_contents, titleSize);
logfile("ios%d rev%d iosTMD->num_contents = %d size=%d\r\n", ios[i].titleID, ios[i].revision, iosTMD->num_contents, titleSize);
gprintf("ios%d rev%d iosTMD->num_contents = %d size=%d\n", ios[i].titleID, ios[i].revision, iosTMD->num_contents, ios[i].titleSize);
logfile("ios%d rev%d iosTMD->num_contents = %d size=%d\r\n", ios[i].titleID, ios[i].revision, iosTMD->num_contents, ios[i].titleSize);
// Check if this is an IOS stub (according to WiiBrew.org)
if (IsKnownStub(ios[i].titleID, ios[i].revision))
ios[i].isStub = true;
else
{
ios[i].isStub = (ios[i].titleID != TID_BC && ios[i].titleID != TID_MIOS && ios[i].titleID != TID_NAND && ios[i].titleID != TID_WFS && titleSize < 0x100000);
ios[i].isStub = (ios[i].titleID != TID_BC && ios[i].titleID != TID_MIOS && ios[i].titleID != TID_NAND && ios[i].titleID != TID_WFS && ios[i].titleSize < 0x100000);
if (ios[i].isStub) {
gprintf("is stub\n");
logfile("is stub\r\n");
@ -426,7 +425,8 @@ int main(int argc, char **argv)
sha1 hash;
SHA1((u8 *)iosTMDBuffer, tmdSize, hash);
sprintf(HashLogBuffer[lines], "IOS%d base hash: \r\n%x %x %x %x, %x %x %x %x, %x %x %x %x, %x %x %x %x, %x %x %x %x\r\n", ios[i].titleID, hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7], hash[8], hash[9], hash[10], hash[11], hash[12], hash[13], hash[14], hash[15], hash[16], hash[17], hash[18], hash[19]);
sprintf(HashLogBuffer[lines], "IOS%d base hash: \r\n%x %x %x %x, %x %x %x %x, %x %x %x %x, %x %x %x %x, %x %x %x %x\r\n", \
ios[i].titleID, hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7], hash[8], hash[9], hash[10], hash[11], hash[12], hash[13], hash[14], hash[15], hash[16], hash[17], hash[18], hash[19]);
lines++;
for (j = 0;j < base_number;j++)
@ -501,29 +501,28 @@ int main(int argc, char **argv)
}
NandShutdown();
UnmountSD();
//UnmountSD();
SystemInfo.countTitles = nbTitles;
nbTitles = SystemInfo.countIOS;
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
// Get the certificates from the NAND
UpdateTime();
printLoading(MSG_GetCertificates);
CheckTime(current_time, 200000);
if (!GetCertificates()) {
printError(ERR_GetCertificates);
sleep(5);
deinitGUI();
exit(1);
}
CheckTime(current_time, 600);
//Select an IOS to test
WPAD_Init();
PAD_Init();
int selectedIOS = -1;
u32 wpressed;
time_t starttime;
starttime = time(NULL);
time_t starttime = time(NULL);
printSelectIOS(MSG_SelectIOS, MSG_All);
@ -705,10 +704,10 @@ int main(int argc, char **argv)
IOS_ReloadIOS(runningIOS);
sprintf(MSG_Buffer, MSG_ReloadIOS, runningIOS, runningIOSRevision);
printLoading(MSG_Buffer);
usleep(200000);
usleep(1000);
//--Generate Report--
current_time=gettick();
UpdateTime();
printLoading(MSG_GenerateReport);
@ -975,16 +974,16 @@ int main(int argc, char **argv)
int NumLines = lineOffset+1;
sprintf(ReportBuffer[NumLines], TXT_ReportDate);
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
// Mount the SD Card
current_time=gettick();
UpdateTime();
printLoading(MSG_MountSD);
MountSD();
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
// Initialise the FAT file system
current_time=gettick();
UpdateTime();
printLoading(MSG_InitFAT);
if (!fatInitDefault())
{
@ -995,7 +994,7 @@ int main(int argc, char **argv)
} else {
//chdir("/");
// Create the report
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
FILE *file = fopen(REPORT, "w");
if(!file)
@ -1013,7 +1012,7 @@ int main(int argc, char **argv)
fclose(file);
printEndSuccess(MSG_ReportSuccess);
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
}
// Create hash log
@ -1032,9 +1031,9 @@ int main(int argc, char **argv)
}
// Close the report
fclose(file);
current_time=gettick();
UpdateTime();
printEndSuccess(MSG_ReportSuccess);
CheckTime(current_time, 200000);
CheckTime(current_time, 600);
}
}
@ -1114,4 +1113,3 @@ int main(int argc, char **argv)
}
}
}

View File

@ -1 +1 @@
<Project name="sysCheck"><MagicFolder excludeFiles="*.pnproj;*.pnps;*.bak;*.tmp" excludeFolders="CVS;.svn" filter="*.c;*.cpp;*.h" name="source" path="source\"><File path="fatMounter.c"></File><File path="gecko.c"></File><File path="gui.c"></File><File path="http.c"></File><File path="languages.c"></File><File path="mload.c"></File><File path="sha1.c"></File><File path="sys.c"></File><File path="sysCheck.c"></File><File path="SysMenuInfo.c"></File><File path="title.c"></File><File path="tmdIdentification.c"></File><File path="tools.c"></File><File path="update.c"></File><File path="upload.c"></File><File path="wiibasics.c"></File></MagicFolder><MagicFolder excludeFiles="*.pnproj;*.pnps;*.bak;*.tmp" excludeFolders="CVS;.svn" filter="*.h" name="include" path="include\"><File path="fatMounter.h"></File><File path="gecko.h"></File><File path="gui.h"></File><File path="http.h"></File><File path="languages.h"></File><File path="mload.h"></File><File path="sha1.h"></File><File path="sys.h"></File><File path="SysMenuInfo.h"></File><File path="title.h"></File><File path="tmdIdentification.h"></File><File path="update.h"></File><File path="wiibasics.h"></File></MagicFolder><File path="Makefile"></File></Project>
<Project name="sysCheck"><MagicFolder excludeFiles="*.pnproj;*.pnps;*.bak;*.tmp" excludeFolders="CVS;.svn" filter="*.c;*.cpp;*.h" name="source" path="source\"><File path="fatMounter.c"></File><File path="gecko.c"></File><File path="gui.c"></File><File path="http.c"></File><File path="languages.c"></File><File path="mload.c"></File><File path="sha1.c"></File><File path="sys.c"></File><File path="sysCheck.c"></File><File path="SysMenuInfo.c"></File><File path="title.c"></File><File path="tmdIdentification.c"></File><File path="tools.c"></File><File path="update.c"></File><File path="upload.c"></File><File path="wiibasics.c"></File></MagicFolder><MagicFolder excludeFiles="*.pnproj;*.pnps;*.bak;*.tmp" excludeFolders="CVS;.svn" filter="*.h" name="include" path="include\"><File path="fatMounter.h"></File><File path="gecko.h"></File><File path="gui.h"></File><File path="http.h"></File><File path="languages.h"></File><File path="mload.h"></File><File path="sha1.h"></File><File path="sys.h"></File><File path="SysMenuInfo.h"></File><File path="title.h"></File><File path="tmdIdentification.h"></File><File path="tools.h"></File><File path="update.h"></File><File path="wiibasics.h"></File></MagicFolder><File path="Makefile"></File></Project>