-Grouped HBC and HBF info into structures

-Fixed Console Type check
-A little more code cleanup
This commit is contained in:
Joostinonline 2014-02-13 09:16:23 +00:00
parent d53b83fcac
commit a9f4ebcb88
7 changed files with 153 additions and 130 deletions

View File

@ -36,6 +36,7 @@
typedef struct { typedef struct {
u32 deviceID; u32 deviceID;
bool deviceType;
u32 boot2version; u32 boot2version;
u32 sysMenuVer; u32 sysMenuVer;
u32 dvdSupport; u32 dvdSupport;
@ -43,6 +44,7 @@ typedef struct {
float sysNinVersion; float sysNinVersion;
char sysMenuRegion; char sysMenuRegion;
s32 systemRegion; s32 systemRegion;
bool validregion;
char country[44]; char country[44];
char miosInfo[128]; char miosInfo[128];
u32 countTitles; u32 countTitles;
@ -59,6 +61,14 @@ typedef struct {
int type; int type;
} dirent_t; } dirent_t;
typedef struct {
u32 hbcversion;
u32 hbfversion;
s32 hbc;
s32 hbf;
u32 hbcIOS;
} homebrew_t;
char getSystemMenuRegionFromContent(); char getSystemMenuRegionFromContent();
#endif #endif

View File

@ -8,7 +8,6 @@
#define CopyBuf() GRRLIB_Screen2Texture(0, 0, tex_ScreenBuf, GX_FALSE) #define CopyBuf() GRRLIB_Screen2Texture(0, 0, tex_ScreenBuf, GX_FALSE)
#define DrawBuf() GRRLIB_DrawImg(0, 0, tex_ScreenBuf, 0, 1, 1, HEX_WHITE) #define DrawBuf() GRRLIB_DrawImg(0, 0, tex_ScreenBuf, 0, 1, 1, HEX_WHITE)
#define CheckTime(X,Y) (ticks_to_millisecs(diff_ticks((X), gettick())) > (Y))
extern GRRLIB_ttfFont *myFont; extern GRRLIB_ttfFont *myFont;
extern GRRLIB_texImg *tex_background_png; extern GRRLIB_texImg *tex_background_png;
@ -24,7 +23,6 @@ extern GRRLIB_texImg *tex_WiiDpadRight_png;
extern GRRLIB_texImg *tex_loadingbargrey_png; extern GRRLIB_texImg *tex_loadingbargrey_png;
extern GRRLIB_texImg *tex_loadingbarblue_png; extern GRRLIB_texImg *tex_loadingbarblue_png;
extern GRRLIB_texImg *tex_window_png; extern GRRLIB_texImg *tex_window_png;
extern GRRLIB_texImg *tex_Cogs_png[5];
extern GRRLIB_texImg *tex_ScreenBuf; extern GRRLIB_texImg *tex_ScreenBuf;
int initGUI(void); int initGUI(void);

View File

@ -37,6 +37,7 @@ const char* TXT_HBC_112;
const char* TXT_HBC_STUB; const char* TXT_HBC_STUB;
const char* TXT_Hollywood; const char* TXT_Hollywood;
const char* TXT_ConsoleID; const char* TXT_ConsoleID;
const char* TXT_ConsoleType;
const char* TXT_vBoot2; const char* TXT_vBoot2;
const char* TXT_NrOfTitles; const char* TXT_NrOfTitles;
const char* TXT_NrOfIOS; const char* TXT_NrOfIOS;

View File

@ -6,7 +6,7 @@
#define MEM_PROT (MEM_REG_BASE + 0x20a) #define MEM_PROT (MEM_REG_BASE + 0x20a)
#define HOLLYWOOD_VERSION (vu32*)0x80003138 #define HOLLYWOOD_VERSION (vu32*)0x80003138
#define LOADER_STUB (vu32*)0x80001800 #define LOADER_STUB (vu32*)0x80001800
#define IS_WII_U ((*(vu32*)(0xCd8005A0) >> 16 ) == 0xCAFE); #define IS_WII_U ((*(vu32*)(0xCd8005A0) >> 16 ) == 0xCAFE)
// Turn upper and lower into a full title ID // Turn upper and lower into a full title ID
#define TITLE_ID(x,y) (((u64)(x) << 32) | (y)) #define TITLE_ID(x,y) (((u64)(x) << 32) | (y))
@ -30,6 +30,7 @@ enum {
HBF, HBF,
HOLLYWOOD, HOLLYWOOD,
CONSOLE_ID, CONSOLE_ID,
CONSOLE_TYPE,
COUNTRY, COUNTRY,
BOOT2_VERSION, BOOT2_VERSION,
NR_OF_TITLES, NR_OF_TITLES,
@ -38,6 +39,20 @@ enum {
LAST LAST
}; };
enum {
HBC_NONE = 0,
HBC_HAXX,
HBC_JODI,
HBC_1_0_7,
HBC_LULZ
};
enum {
HBF_NONE = 0,
HBF_HBF0,
HBF_THBF
};
typedef struct { typedef struct {
s32 revision; s32 revision;
bool isStub; bool isStub;
@ -108,19 +123,15 @@ bool CheckFlashAccess(void);
bool CheckNANDAccess(void); bool CheckNANDAccess(void);
bool CheckBoot2Access(void); bool CheckBoot2Access(void);
bool CheckMload(void); bool CheckMload(void);
bool CheckUSB2(u32); bool CheckUSB2(u32 titleID);
bool IsKnownStub(u32, s32); bool IsKnownStub(u32 noIOS, s32 noRevision);
s32 GetTMD(u64 TicketID, signed_blob **Output, u32 *Length); s32 GetTMD(u64 TicketID, signed_blob **Output, u32 *Length);
char GetBootFilename(u64 titleId);
s32 read_file_from_nand(char *filepath, u8 **buffer, u32 *filesize); s32 read_file_from_nand(char *filepath, u8 **buffer, u32 *filesize);
int NandStartup(void); int NandStartup(void);
void NandShutdown(void); void NandShutdown(void);
int checkSysLoader(void); int checkSysLoader(void);
void transmitSyscheck(char ReportBuffer[200][100], int *lines); void transmitSyscheck(char ReportBuffer[200][100], int *lines);
u32 IOSPATCH_Apply(void);
s32 brute_tmd(tmd *p_tmd); s32 brute_tmd(tmd *p_tmd);
bool checkISFSinRAM(void);
u32 es_set_ahbprot(void);
void *allocate_memory(u32 size); void *allocate_memory(u32 size);
void logfile(const char *format, ...); void logfile(const char *format, ...);
s32 get_miosinfo(char *str); s32 get_miosinfo(char *str);

View File

@ -106,10 +106,7 @@ bool loadSystemFont(bool korean)
free(fontArchive); free(fontArchive);
free(contentMap); free(contentMap);
MountSD(); MountSD();
static char buf[128]; FILE *fp = fopen("sd:/test.ttf", "wb");
snprintf(buf, 128, "sd:/test.ttf");
FILE *fp = NULL;
fp = fopen(buf, "wb");
if (fp) if (fp)
{ {
fwrite(systemFont, 1, systemFontSize, fp); fwrite(systemFont, 1, systemFontSize, fp);
@ -181,7 +178,6 @@ int printError(const char* msg) {
DrawBuf(); DrawBuf();
GRRLIB_Render(); GRRLIB_Render();
} }
return 0; return 0;
} }
@ -200,11 +196,12 @@ int printSuccess(const char* msg) {
int printLoading(const char* msg) { int printLoading(const char* msg) {
int i; int i;
for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug
GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, HEX_WHITE); GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, HEX_WHITE);
GRRLIB_DrawImg(256, 112, tex_Refreshicon_png, 0, 1, 1, HEX_WHITE); GRRLIB_DrawImg(256, 112, tex_Refreshicon_png, 0, 1, 1, HEX_WHITE);
GRRLIB_PrintfTTF((640-strlen(msg)*9)/2, 256, myFont, msg, 20, HEX_WHITE); GRRLIB_PrintfTTF((640-strlen(msg)*9)/2, 256, myFont, msg, 20, HEX_WHITE);
CopyBuf();
for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug
DrawBuf();
GRRLIB_Render(); GRRLIB_Render();
} }
return 0; return 0;
@ -276,7 +273,6 @@ int printEndSuccess(const char* msg) {
DrawBuf(); DrawBuf();
GRRLIB_Render(); GRRLIB_Render();
} }
return 0; return 0;
} }
@ -302,13 +298,11 @@ int printEndError(const char* msg) {
DrawBuf(); DrawBuf();
GRRLIB_Render(); GRRLIB_Render();
} }
return 0; return 0;
} }
int printReport(char report[200][100], int firstLine, bool completeReport) { int printReport(char report[200][100], int firstLine, bool completeReport) {
int i, j; int i, j;
for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug
GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, HEX_WHITE); GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, HEX_WHITE);
GRRLIB_DrawImg(36, 40, tex_window_png, 0, 1, 1, HEX_WHITE); GRRLIB_DrawImg(36, 40, tex_window_png, 0, 1, 1, HEX_WHITE);
@ -337,10 +331,11 @@ int printReport(char report[200][100], int firstLine, bool completeReport) {
GRRLIB_DrawImg(464, 388, tex_WiiButtonPlus_png, 0, 1, 1, HEX_WHITE); GRRLIB_DrawImg(464, 388, tex_WiiButtonPlus_png, 0, 1, 1, HEX_WHITE);
GRRLIB_PrintfTTF(480-(strlen(BUT_SysMenu)*7.8)/2, 425, myFont, BUT_SysMenu, 14, HEX_WHITE); GRRLIB_PrintfTTF(480-(strlen(BUT_SysMenu)*7.8)/2, 425, myFont, BUT_SysMenu, 14, HEX_WHITE);
} }
CopyBuf();
for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug
DrawBuf();
GRRLIB_Render(); GRRLIB_Render();
} }
return 0; return 0;
} }
@ -355,7 +350,7 @@ int printUploadSuccess(const char* msg) {
GRRLIB_DrawImg(302, 300, tex_WiiButtonA_png, 0, 1, 1, HEX_WHITE); GRRLIB_DrawImg(302, 300, tex_WiiButtonA_png, 0, 1, 1, HEX_WHITE);
GRRLIB_PrintfTTF(319-(strlen(BUT_OK)*7.8)/2, 342, myFont, BUT_OK, 14, HEX_WHITE); GRRLIB_PrintfTTF(319-(strlen(BUT_OK)*7.8)/2, 342, myFont, BUT_OK, 14, HEX_WHITE);
//GRRLIB_DrawImg(52, 340, tex_loadingbarblue_png, 0, 1, 1, HEX_WHITE); GRRLIB_DrawImg(52, 340, tex_loadingbarblue_png, 0, 1, 1, HEX_WHITE);
CopyBuf(); CopyBuf();
for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug
DrawBuf(); DrawBuf();

View File

@ -23,7 +23,7 @@
int initLanguages(struct tm today) int initLanguages(struct tm today)
{ {
TXT_AppVersion = "v2.1.0 HD Edition"; TXT_AppVersion = "v2.2.0 HD Edition";
switch (CONF_GetLanguage()) switch (CONF_GetLanguage())
{ {
case CONF_LANG_GERMAN: case CONF_LANG_GERMAN:
@ -59,10 +59,11 @@ int initLanguages(struct tm today)
TXT_HBF = "Homebrew Filter rev%d benutzt IOS58"; TXT_HBF = "Homebrew Filter rev%d benutzt IOS58";
TXT_Hollywood = "Hollywood v0x%x"; TXT_Hollywood = "Hollywood v0x%x";
TXT_ConsoleID = "Konsolen-ID: %d"; TXT_ConsoleID = "Konsolen-ID: %d";
TXT_ConsoleType = "Konsolentyp: %s";
TXT_vBoot2 = "Boot2 v%u"; TXT_vBoot2 = "Boot2 v%u";
TXT_NrOfTitles = "Es wurden %d Titel gefunden."; TXT_NrOfTitles = "Es wurden %d Titel gefunden.";
TXT_NrOfIOS = "Es wurden %d IOS gefunden, von denen %d funktionslos (Stub) sind."; 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 Double_A und R2-D2199, JoostinOnline, Nano";
TXT_AppIOS = "...laeuft auf dem IOS%d (rev %d)."; TXT_AppIOS = "...laeuft auf dem IOS%d (rev %d).";
ERR_AllocateMemory = "Speicher fuer %d Titel konnte nicht zugewiesen werden."; ERR_AllocateMemory = "Speicher fuer %d Titel konnte nicht zugewiesen werden.";
ERR_OpenFile = "Zugriff auf die Speicherdatei des Berichts fehlgeschlagen!"; ERR_OpenFile = "Zugriff auf die Speicherdatei des Berichts fehlgeschlagen!";
@ -80,6 +81,7 @@ int initLanguages(struct tm today)
TXT_NAND = " NAND Zugriff,"; TXT_NAND = " NAND Zugriff,";
TXT_Boot2 = " Boot2 Zugriff,"; TXT_Boot2 = " Boot2 Zugriff,";
TXT_USB = " USB 2.0,"; TXT_USB = " USB 2.0,";
TXT_VersionP = " ES_Version,";
TXT_NoPatch = " Keine Patches,"; TXT_NoPatch = " Keine Patches,";
sprintf(TXT_ReportDate, "Bericht wurde am %2.2d.%2.2d.%4.4d generiert.", today.tm_mday, today.tm_mon + 1, today.tm_year + 1900); sprintf(TXT_ReportDate, "Bericht wurde am %2.2d.%2.2d.%4.4d generiert.", today.tm_mday, today.tm_mon + 1, today.tm_year + 1900);
BUT_HBC = "Homebrew Channel"; BUT_HBC = "Homebrew Channel";
@ -88,7 +90,6 @@ int initLanguages(struct tm today)
BUT_Update = "Aktualisieren"; BUT_Update = "Aktualisieren";
TXT_Priiloader = "Priiloader installiert"; TXT_Priiloader = "Priiloader installiert";
TXT_PreFiix = "PreFiix installiert"; TXT_PreFiix = "PreFiix installiert";
TXT_VersionP = " ES_Version,";
MSG_Update = "Aktualisiere SysCheck..."; MSG_Update = "Aktualisiere SysCheck...";
MSG_NoUpdate = "Diese Version ist bereits auf dem neuesten Stand!"; MSG_NoUpdate = "Diese Version ist bereits auf dem neuesten Stand!";
MSG_UpdateSuccess = "Die Aktualisierung wurde erfolgreich geladen!"; MSG_UpdateSuccess = "Die Aktualisierung wurde erfolgreich geladen!";
@ -132,10 +133,11 @@ int initLanguages(struct tm today)
TXT_HBF = "Homebrew Filter rev%d utilise IOS58"; TXT_HBF = "Homebrew Filter rev%d utilise IOS58";
TXT_Hollywood = "Hollywood v0x%x"; TXT_Hollywood = "Hollywood v0x%x";
TXT_ConsoleID = "Identifiant de la console: %d"; TXT_ConsoleID = "Identifiant de la console: %d";
TXT_ConsoleType = "Type de Console: %s";
TXT_vBoot2 = "Boot2 v%u"; TXT_vBoot2 = "Boot2 v%u";
TXT_NrOfTitles = "%d titres trouves."; TXT_NrOfTitles = "%d titres trouves.";
TXT_NrOfIOS = "%d IOS trouves sur cette console. %d sont des stubs."; 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 Double_A et R2-D2199, JoostinOnline, Nano";
TXT_AppIOS = "...tourne sous l'IOS%d (rev %d)."; TXT_AppIOS = "...tourne sous l'IOS%d (rev %d).";
ERR_AllocateMemory = "Imposible d'allouer la memoire pour %d titres."; ERR_AllocateMemory = "Imposible d'allouer la memoire pour %d titres.";
ERR_OpenFile = "Impossible d'ouvrir le fichier."; ERR_OpenFile = "Impossible d'ouvrir le fichier.";
@ -153,6 +155,7 @@ int initLanguages(struct tm today)
TXT_NAND = " Acces NAND,"; TXT_NAND = " Acces NAND,";
TXT_Boot2 = " Acces Boot2,"; TXT_Boot2 = " Acces Boot2,";
TXT_USB = " USB 2.0,"; TXT_USB = " USB 2.0,";
TXT_VersionP = " ES_Version,";
TXT_NoPatch = " Pas de patches,"; TXT_NoPatch = " Pas de patches,";
sprintf(TXT_ReportDate, "Rapport genere le %4.4d/%2.2d/%2.2d.", today.tm_year + 1900, today.tm_mon + 1, today.tm_mday); sprintf(TXT_ReportDate, "Rapport genere le %4.4d/%2.2d/%2.2d.", today.tm_year + 1900, today.tm_mon + 1, today.tm_mday);
BUT_HBC = "Homebrew Channel"; BUT_HBC = "Homebrew Channel";
@ -204,10 +207,11 @@ int initLanguages(struct tm today)
TXT_HBF = "Homebrew Filter rev%d appoggiato all'IOS58"; TXT_HBF = "Homebrew Filter rev%d appoggiato all'IOS58";
TXT_Hollywood = "Hollywood v0x%x"; TXT_Hollywood = "Hollywood v0x%x";
TXT_ConsoleID = "ID console: %d"; TXT_ConsoleID = "ID console: %d";
TXT_ConsoleType = "Tipo Console: %s";
TXT_vBoot2 = "Boot2 v%u"; TXT_vBoot2 = "Boot2 v%u";
TXT_NrOfTitles = "Trovati %d giochi."; TXT_NrOfTitles = "Trovati %d giochi.";
TXT_NrOfIOS = "Trovati %d IOS in questa console. %d di questi sono stub."; 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 Double_A and R2-D2199, JoostinOnline, Nano";
TXT_AppIOS = "...appoggiato all'IOS%d (v. %d)."; TXT_AppIOS = "...appoggiato all'IOS%d (v. %d).";
ERR_AllocateMemory = "Impossibile allocare la memoria per %d giochi."; ERR_AllocateMemory = "Impossibile allocare la memoria per %d giochi.";
ERR_OpenFile = "Impossibile aprire il file!"; ERR_OpenFile = "Impossibile aprire il file!";
@ -225,6 +229,7 @@ int initLanguages(struct tm today)
TXT_NAND = " Accesso NAND,"; TXT_NAND = " Accesso NAND,";
TXT_Boot2 = " Accesso Boot2,"; TXT_Boot2 = " Accesso Boot2,";
TXT_USB = " USB 2.0,"; TXT_USB = " USB 2.0,";
TXT_VersionP = " ES_Version,";
TXT_NoPatch = " Non patchato,"; TXT_NoPatch = " Non patchato,";
sprintf(TXT_ReportDate, "Rapporto generato il %2.2d.%2.2d.%4.4d.", today.tm_mday, today.tm_mon + 1, today.tm_year + 1900); sprintf(TXT_ReportDate, "Rapporto generato il %2.2d.%2.2d.%4.4d.", today.tm_mday, today.tm_mon + 1, today.tm_year + 1900);
BUT_HBC = "Canale Homebrew"; BUT_HBC = "Canale Homebrew";
@ -276,10 +281,11 @@ int initLanguages(struct tm today)
TXT_HBF = "Homebrew Filter rev%d corriendo en IOS58"; TXT_HBF = "Homebrew Filter rev%d corriendo en IOS58";
TXT_Hollywood = "Hollywood v0x%x"; TXT_Hollywood = "Hollywood v0x%x";
TXT_ConsoleID = "ID de consola: %d"; TXT_ConsoleID = "ID de consola: %d";
TXT_ConsoleType = "Tipo Consola: %s";
TXT_vBoot2 = "Boot2 v%u"; TXT_vBoot2 = "Boot2 v%u";
TXT_NrOfTitles = "Encontrados %d titulos."; TXT_NrOfTitles = "Encontrados %d titulos.";
TXT_NrOfIOS = "Se encontraron %d IOS en esta consola. %d de ellos son stubs."; 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 Double_A y R2-D2199, JoostinOnline, Nano";
TXT_AppIOS = "...corre en IOS%d (rev %d)."; TXT_AppIOS = "...corre en IOS%d (rev %d).";
ERR_AllocateMemory = "Imposible asignar memoria para %d titulos."; ERR_AllocateMemory = "Imposible asignar memoria para %d titulos.";
ERR_OpenFile = "Imposible abrir el archivo!"; ERR_OpenFile = "Imposible abrir el archivo!";
@ -297,6 +303,7 @@ int initLanguages(struct tm today)
TXT_NAND = " Acceso NAND,"; TXT_NAND = " Acceso NAND,";
TXT_Boot2 = " Acceso Boot2,"; TXT_Boot2 = " Acceso Boot2,";
TXT_USB = " USB 2.0,"; TXT_USB = " USB 2.0,";
TXT_VersionP = " ES_Version,";
TXT_NoPatch = " Sin Parches,"; TXT_NoPatch = " Sin Parches,";
sprintf(TXT_ReportDate, "Reporte generado el %2.2d/%2.2d/%4.4d.", today.tm_mday, today.tm_mon + 1, today.tm_year + 1900); sprintf(TXT_ReportDate, "Reporte generado el %2.2d/%2.2d/%4.4d.", today.tm_mday, today.tm_mon + 1, today.tm_year + 1900);
BUT_HBC = "Canal Homebrew"; BUT_HBC = "Canal Homebrew";
@ -348,10 +355,11 @@ int initLanguages(struct tm today)
TXT_HBF = "Homebrew Filter rev%d running on IOS58"; TXT_HBF = "Homebrew Filter rev%d running on IOS58";
TXT_Hollywood = "Hollywood v0x%x"; TXT_Hollywood = "Hollywood v0x%x";
TXT_ConsoleID = "Console ID: %d"; TXT_ConsoleID = "Console ID: %d";
TXT_ConsoleType = "Console Type: %s";
TXT_vBoot2 = "Boot2 v%u"; TXT_vBoot2 = "Boot2 v%u";
TXT_NrOfTitles = "Found %d titles."; TXT_NrOfTitles = "Found %d titles.";
TXT_NrOfIOS = "Found %d IOS on this console. %d of them are stub."; 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 Double_A and R2-D2199, JoostinOnline, Nano";
TXT_AppIOS = "...runs on IOS%d (rev %d)."; TXT_AppIOS = "...runs on IOS%d (rev %d).";
ERR_AllocateMemory = "Unable to allocate the memory for %d titles."; ERR_AllocateMemory = "Unable to allocate the memory for %d titles.";
ERR_OpenFile = "Unable to open the file!"; ERR_OpenFile = "Unable to open the file!";
@ -369,6 +377,7 @@ int initLanguages(struct tm today)
TXT_NAND = " NAND Access,"; TXT_NAND = " NAND Access,";
TXT_Boot2 = " Boot2 Access,"; TXT_Boot2 = " Boot2 Access,";
TXT_USB = " USB 2.0,"; TXT_USB = " USB 2.0,";
TXT_VersionP = " ES_Version,";
TXT_NoPatch = " No Patches,"; TXT_NoPatch = " No Patches,";
sprintf(TXT_ReportDate, "Report generated on %2.2d/%2.2d/%4.4d.", today.tm_mon + 1, today.tm_mday, today.tm_year + 1900); sprintf(TXT_ReportDate, "Report generated on %2.2d/%2.2d/%4.4d.", today.tm_mon + 1, today.tm_mday, today.tm_year + 1900);
BUT_HBC = "Homebrew Channel"; BUT_HBC = "Homebrew Channel";

View File

@ -228,6 +228,7 @@ int main(int argc, char **argv)
} }
} }
SYSSETTINGS SystemInfo; SYSSETTINGS SystemInfo;
SystemInfo.deviceType = IS_WII_U;
if (AHB_ACCESS && !forceNoAHBPROT) IosPatch_RUNTIME(true, false, false, false); if (AHB_ACCESS && !forceNoAHBPROT) IosPatch_RUNTIME(true, false, false, false);
SystemInfo.nandAccess = CheckNANDAccess(); SystemInfo.nandAccess = CheckNANDAccess();
@ -261,11 +262,12 @@ int main(int argc, char **argv)
printLoading(MSG_GetHBCVer); printLoading(MSG_GetHBCVer);
usleep(200000); usleep(200000);
u32 hbcversion = 0; homebrew_t homebrew;
u32 hbfversion = 0; homebrew.hbcversion = 0;
s32 hbc = 0; homebrew.hbfversion = 0;
s32 hbf = 0; homebrew.hbc = HBC_NONE;
u32 hbcIOS = 0; homebrew.hbf = HBF_NONE;
homebrew.hbcIOS = 0;
SystemInfo.dvdSupport = 0; SystemInfo.dvdSupport = 0;
s32 ret = Title_GetVersionNObuf(0x000100014C554C5All); s32 ret = Title_GetVersionNObuf(0x000100014C554C5All);
if (ret<0) { if (ret<0) {
@ -273,50 +275,50 @@ int main(int argc, char **argv)
if (ret<0) { if (ret<0) {
ret = Title_GetVersionNObuf(0x000100014A4F4449ll); ret = Title_GetVersionNObuf(0x000100014A4F4449ll);
if (ret<0) { if (ret<0) {
hbc = 1; homebrew.hbc = HBC_HAXX;
ret = Title_GetVersionNObuf(0x0001000148415858ll); ret = Title_GetVersionNObuf(0x0001000148415858ll);
if (ret<0) { if (ret<0) {
hbc = 0; homebrew.hbc = HBC_NONE;
} else { } else {
hbc = 1; homebrew.hbc = HBC_HAXX;
hbcversion = ret; homebrew.hbcversion = ret;
} }
} else { } else {
hbc = 2; homebrew.hbc = HBC_JODI;
hbcversion = ret; homebrew.hbcversion = ret;
} }
} else { } else {
hbc = 3; homebrew.hbc = HBC_1_0_7;
hbcversion = ret; homebrew.hbcversion = ret;
if (hbcversion == 0) if (homebrew.hbcversion == 0)
hbcversion = VERSION_1_1_0; homebrew.hbcversion = VERSION_1_1_0;
} }
} else { } else {
hbc = 4; homebrew.hbc = HBC_LULZ;
hbcversion = (ret != 257) +1; homebrew.hbcversion = (ret != 257) + 1;
} }
if (hbc == 4) { if (homebrew.hbc == HBC_LULZ) {
hbcIOS = get_title_ios(TITLE_ID(0x10001, 0x4C554C5A)); homebrew.hbcIOS = get_title_ios(TITLE_ID(0x10001, 0x4C554C5A)); // LULZ
} else if (hbc == 3) { } else if (homebrew.hbc == HBC_1_0_7) {
hbcIOS = get_title_ios(TITLE_ID(0x10001, 0xAF1BF516)); homebrew.hbcIOS = get_title_ios(TITLE_ID(0x10001, 0xAF1BF516)); // ????
} else if (hbc == 2) { } else if (homebrew.hbc == HBC_JODI) {
hbcIOS = get_title_ios(TITLE_ID(0x10001, 0x4A4F4449)); homebrew.hbcIOS = get_title_ios(TITLE_ID(0x10001, 0x4A4F4449)); // JODI
} else if (hbc == 1) { } else if (homebrew.hbc == HBC_HAXX) {
hbcIOS = get_title_ios(TITLE_ID(0x10001, 0x48415858)); homebrew.hbcIOS = get_title_ios(TITLE_ID(0x10001, 0x48415858)); // HAXX
} }
ret = Title_GetVersionNObuf(0x0001000148424630LL); //HBF0 ret = Title_GetVersionNObuf(0x0001000148424630LL); //HBF0
if (ret<0) { if (ret<0) {
ret = Title_GetVersionNObuf(0x0001000154484246LL); //THBF ret = Title_GetVersionNObuf(0x0001000154484246LL); //THBF
if (ret<0) { if (ret<0) {
hbf = 0; homebrew.hbf = HBF_NONE;
} else { } else {
hbf = 1; homebrew.hbf = HBF_HBF0;
hbfversion = ret; homebrew.hbfversion = ret;
} }
} else { } else {
hbf = 2; homebrew.hbf = HBF_THBF;
hbfversion = ret; homebrew.hbfversion = ret;
} }
if (AHB_ACCESS && !forceNoAHBPROT) { if (AHB_ACCESS && !forceNoAHBPROT) {
@ -755,36 +757,33 @@ int main(int argc, char **argv)
// Test fake signature // Test fake signature
gprintf("// Test fake signature\n"); gprintf("// Test fake signature\n");
logfile("// Test fake signature\r\n"); logfile("// Test fake signature\r\n");
ios[i].infoFakeSignature = (CheckFakeSignature()); ios[i].infoFakeSignature = CheckFakeSignature();
// Test ES Identify // Test ES Identify
gprintf("// Test ES Identify\n"); gprintf("// Test ES Identify\n");
logfile("// Test ES Identify\r\n"); logfile("// Test ES Identify\r\n");
ios[i].infoESIdentify = (CheckESIdentify()); ios[i].infoESIdentify = CheckESIdentify();
// Test Flash Access // Test Flash Access
gprintf("// Test Flash Access\n"); gprintf("// Test Flash Access\n");
logfile("// Test Flash Access\r\n"); logfile("// Test Flash Access\r\n");
ios[i].infoFlashAccess = (CheckFlashAccess()); ios[i].infoFlashAccess = CheckFlashAccess();
// Test NAND Access // Test NAND Access
gprintf("// Test NAND Access\n"); gprintf("// Test NAND Access\n");
logfile("// Test NAND Access\r\n"); logfile("// Test NAND Access\r\n");
ios[i].infoNANDAccess = (CheckNANDAccess()); ios[i].infoNANDAccess = CheckNANDAccess();
// Test Boot2 Access // Test Boot2 Access
gprintf("// Test Boot2 Access\n"); gprintf("// Test Boot2 Access\n");
logfile("// Test Boot2 Access\r\n"); logfile("// Test Boot2 Access\r\n");
ios[i].infoBoot2Access = (CheckBoot2Access()); ios[i].infoBoot2Access = CheckBoot2Access();
// Test USB 2.0 // Test USB 2.0
gprintf("// Test USB 2.0\n"); gprintf("// Test USB 2.0\n");
logfile("// Test USB 2.0\r\n"); logfile("// Test USB 2.0\r\n");
ios[i].infoUSB2 = (CheckUSB2(ios[i].titleID)); ios[i].infoUSB2 = CheckUSB2(ios[i].titleID);
if (ios[i].infoFakeSignature) {
//ios[i].infoVersionPatch = (CheckVersionPatch());
}
// Check Priiloader // Check Priiloader
if (!SystemInfo.nandAccess && SystemInfo.priiloader == -2 && ios[i].infoNANDAccess) { if (!SystemInfo.nandAccess && SystemInfo.priiloader == -2 && ios[i].infoNANDAccess) {
@ -835,12 +834,12 @@ int main(int argc, char **argv)
// Display Title // Display Title
sprintf(ReportBuffer[APP_TITLE], TXT_AppTitle, TXT_AppVersion); sprintf(ReportBuffer[APP_TITLE], TXT_AppTitle, TXT_AppVersion);
sprintf(ReportBuffer[APP_IOS], TXT_AppIOS, runningIOS, IOS_GetRevision()); sprintf(ReportBuffer[APP_IOS], TXT_AppIOS, runningIOS, IOS_GetRevision());
bool validregion = SystemInfo.systemRegion >= CONF_REGION_JP && SystemInfo.systemRegion <= CONF_REGION_CN; SystemInfo.validregion = SystemInfo.systemRegion >= CONF_REGION_JP && SystemInfo.systemRegion <= CONF_REGION_CN;
// Display the console region // Display the console region
if (SystemInfo.sysNinVersion != 0.0f) { if (SystemInfo.sysNinVersion != 0.0f) {
sprintf(ReportBuffer[TEXT_REGION], "%s: %s", TXT_Region, validregion ? Regions[SystemInfo.systemRegion] : ""); sprintf(ReportBuffer[TEXT_REGION], "%s: %s", TXT_Region, SystemInfo.validregion ? Regions[SystemInfo.systemRegion] : "");
if (validregion) if (SystemInfo.validregion)
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu, SystemInfo.sysNinVersion, SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer); sprintf(ReportBuffer[SYSMENU], TXT_SysMenu, SystemInfo.sysNinVersion, SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer);
else else
strcat(ReportBuffer[SYSMENU], TXT_Unknown); strcat(ReportBuffer[SYSMENU], TXT_Unknown);
@ -849,8 +848,8 @@ int main(int argc, char **argv)
u32 realSysVersion = systemmenu.realRevision; u32 realSysVersion = systemmenu.realRevision;
SystemInfo.sysNinVersion = GetSysMenuNintendoVersion(realSysVersion); SystemInfo.sysNinVersion = GetSysMenuNintendoVersion(realSysVersion);
SystemInfo.sysMenuRegion = GetSysMenuRegion(SystemInfo.sysMenuVer); SystemInfo.sysMenuRegion = GetSysMenuRegion(SystemInfo.sysMenuVer);
sprintf(ReportBuffer[TEXT_REGION], "%s: %s", TXT_Region, validregion ? Regions[SystemInfo.systemRegion] : ""); sprintf(ReportBuffer[TEXT_REGION], "%s: %s", TXT_Region, SystemInfo.validregion ? Regions[SystemInfo.systemRegion] : "");
if (validregion) if (SystemInfo.validregion)
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu3, SystemInfo.sysNinVersion, SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer, realSysVersion, systemmenu.info); sprintf(ReportBuffer[SYSMENU], TXT_SysMenu3, SystemInfo.sysNinVersion, SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer, realSysVersion, systemmenu.info);
else else
strcat(ReportBuffer[SYSMENU], TXT_Unknown); strcat(ReportBuffer[SYSMENU], TXT_Unknown);
@ -880,8 +879,6 @@ int main(int argc, char **argv)
} else { } else {
SystemInfo.sysMenuIOS = get_title_ios(TITLE_ID(0x00000001, 0x00000002)); SystemInfo.sysMenuIOS = get_title_ios(TITLE_ID(0x00000001, 0x00000002));
char Region[100];
switch (SystemInfo.systemRegion) switch (SystemInfo.systemRegion)
{ {
case CONF_REGION_US: case CONF_REGION_US:
@ -904,39 +901,38 @@ int main(int argc, char **argv)
sprintf(ReportBuffer[TEXT_REGION], "%s: ", TXT_Region); sprintf(ReportBuffer[TEXT_REGION], "%s: ", TXT_Region);
strcat(ReportBuffer[TEXT_REGION], TXT_Unknown); strcat(ReportBuffer[TEXT_REGION], TXT_Unknown);
} }
sprintf(Region, "%c", SystemInfo.sysMenuRegion);
switch (SystemInfo.sysMenuIOS) switch (SystemInfo.sysMenuIOS)
{ {
case 9: case 9:
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "1.0", Region, SystemInfo.sysMenuVer); sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "1.0", SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer);
break; break;
case 11: case 11:
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "2.0/2.1", Region, SystemInfo.sysMenuVer); sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "2.0/2.1", SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer);
break; break;
case 20: case 20:
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "2.2", Region); sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "2.2", SystemInfo.sysMenuRegion);
break; break;
case 30: case 30:
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "3.0/3.1/3.2/3.3", Region, SystemInfo.sysMenuVer); sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "3.0/3.1/3.2/3.3", SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer);
break; break;
case 40: case 40:
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "3.3", Region, SystemInfo.sysMenuVer); sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "3.3", SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer);
break; break;
case 50: case 50:
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "3.4", Region, SystemInfo.sysMenuVer); sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "3.4", SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer);
break; break;
case 60: case 60:
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "4.0/4.1", Region, SystemInfo.sysMenuVer); sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "4.0/4.1", SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer);
break; break;
case 70: case 70:
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "4.2", Region, SystemInfo.sysMenuVer); sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "4.2", SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer);
break; break;
case 80: case 80:
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "4.3", Region, SystemInfo.sysMenuVer); sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "4.3", SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer);
break; break;
default: default:
sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "0.0", Region, SystemInfo.sysMenuVer); sprintf(ReportBuffer[SYSMENU], TXT_SysMenu2, "0.0", SystemInfo.sysMenuRegion, SystemInfo.sysMenuVer);
break; break;
} }
} }
@ -1004,24 +1000,25 @@ int main(int argc, char **argv)
else if (SystemInfo.priiloader == 2) else if (SystemInfo.priiloader == 2)
sprintf(ReportBuffer[PRIILOADER], TXT_PreFiix); sprintf(ReportBuffer[PRIILOADER], TXT_PreFiix);
if (hbc == 0 || hbcversion == 0) if (homebrew.hbc == HBC_NONE || homebrew.hbcversion == 0)
sprintf(ReportBuffer[HBC], "Homebrew Channel is not installed"); sprintf(ReportBuffer[HBC], "Homebrew Channel is not installed");
else if (hbcIOS == 0) else if (homebrew.hbcIOS == 0)
sprintf(ReportBuffer[HBC], TXT_HBC_STUB); sprintf(ReportBuffer[HBC], TXT_HBC_STUB);
else if (hbc == 4) else if (homebrew.hbc == HBC_LULZ)
sprintf(ReportBuffer[HBC], TXT_HBC_112, hbcversion, hbcIOS); sprintf(ReportBuffer[HBC], TXT_HBC_112, homebrew.hbcversion, homebrew.hbcIOS);
else if (hbcversion == VERSION_1_1_0) else if (homebrew.hbcversion == VERSION_1_1_0)
sprintf(ReportBuffer[HBC], TXT_HBC_NEW, hbcIOS); sprintf(ReportBuffer[HBC], TXT_HBC_NEW, homebrew.hbcIOS);
else if (hbcversion > 0) else if (homebrew.hbcversion > 0)
sprintf(ReportBuffer[HBC], TXT_HBC, hbcversion, hbcIOS); sprintf(ReportBuffer[HBC], TXT_HBC, homebrew.hbcversion, homebrew.hbcIOS);
if (hbf > 0) if (homebrew.hbf > HBF_NONE)
sprintf(ReportBuffer[HBF], TXT_HBF, hbfversion); sprintf(ReportBuffer[HBF], TXT_HBF, homebrew.hbfversion);
sprintf(ReportBuffer[HOLLYWOOD], TXT_Hollywood, *HOLLYWOOD_VERSION); sprintf(ReportBuffer[HOLLYWOOD], TXT_Hollywood, *HOLLYWOOD_VERSION);
sprintf(ReportBuffer[CONSOLE_ID], TXT_ConsoleID, SystemInfo.deviceID); sprintf(ReportBuffer[CONSOLE_ID], TXT_ConsoleID, SystemInfo.deviceID);
sprintf(ReportBuffer[BOOT2_VERSION], TXT_vBoot2, SystemInfo.boot2version); sprintf(ReportBuffer[CONSOLE_TYPE], TXT_ConsoleType, SystemInfo.deviceType ? "vWii" : "Wii");
sprintf(ReportBuffer[COUNTRY], "Shop Channel Country: %s (%u)", (strlen(SystemInfo.country)) ? SystemInfo.country : TXT_Unknown, SystemInfo.shopcode); sprintf(ReportBuffer[COUNTRY], "Shop Channel Country: %s (%u)", (strlen(SystemInfo.country)) ? SystemInfo.country : TXT_Unknown, SystemInfo.shopcode);
sprintf(ReportBuffer[BOOT2_VERSION], TXT_vBoot2, SystemInfo.boot2version);
sprintf(ReportBuffer[NR_OF_TITLES], TXT_NrOfTitles, SystemInfo.countTitles); sprintf(ReportBuffer[NR_OF_TITLES], TXT_NrOfTitles, SystemInfo.countTitles);
sprintf(ReportBuffer[NR_OF_IOS], TXT_NrOfIOS, (SystemInfo.countIOS - SystemInfo.countBCMIOS), SystemInfo.countStubs); sprintf(ReportBuffer[NR_OF_IOS], TXT_NrOfIOS, (SystemInfo.countIOS - SystemInfo.countBCMIOS), SystemInfo.countStubs);
@ -1107,6 +1104,7 @@ int main(int argc, char **argv)
sleep(2); sleep(2);
printEndError(MSG_ReportError); printEndError(MSG_ReportError);
} else { } else {
//chdir("/");
// Create the report // Create the report
FILE *file = fopen(REPORT, "w"); FILE *file = fopen(REPORT, "w");
@ -1139,6 +1137,7 @@ int main(int argc, char **argv)
for (i = 0; i <= lines; i++) { for (i = 0; i <= lines; i++) {
fprintf(file, HashLogBuffer[i]); fprintf(file, HashLogBuffer[i]);
fprintf(file, "\r\n"); fprintf(file, "\r\n");
fflush(file);
} }
// Close the report // Close the report
fclose(file); fclose(file);
@ -1160,7 +1159,7 @@ int main(int argc, char **argv)
// Unmount the SD Card // Unmount the SD Card
UnmountSD(); UnmountSD();
deinitGUI(); deinitGUI();
if(*LOADER_STUB) exit(0);; if(*LOADER_STUB) exit(0);
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
} }