-Renamed some variables and types

-Fixed timing
-Possibly messed up the vIOS check, haven't had a chance to test it out

This is just preparation for transfer to SourceForge
This commit is contained in:
Joostinonline 2015-03-13 08:16:55 +00:00
parent 7bdf74daa6
commit 1e4ec18746
7 changed files with 40 additions and 45 deletions

View File

@ -56,7 +56,7 @@ typedef struct {
bool nandAccess;
u32 runningIOS;
u32 runningIOSRevision;
} SYSSETTINGS;
} SysSettings_t;
typedef struct {
char name[ISFS_MAXPATH + 1];

View File

@ -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
}

View File

@ -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 {

View File

@ -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 */

View File

@ -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:

View File

@ -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;
}

View File

@ -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; i<argc; i++){
@ -69,7 +68,7 @@ int main(int argc, char **argv)
}
}
}
SYSSETTINGS SystemInfo;
SysSettings_t SystemInfo;
SystemInfo.deviceType = IS_WII_U;
memset(SystemInfo.miosInfo, 0, sizeof(SystemInfo.miosInfo));
@ -104,7 +103,7 @@ int main(int argc, char **argv)
SystemInfo.sysMenuVer = GetSysMenuVersion();
CheckTime();
sysMenu systemmenu;
sysMenu_t systemmenu;
printLoading(MSG_GetHBCVer);
UpdateTime();
@ -305,7 +304,7 @@ int main(int argc, char **argv)
sort(newTitles, SystemInfo.countIOS);
free(titles);
IOS ios[SystemInfo.countIOS];
IOS_t ios[SystemInfo.countIOS];
// IOS List Initialization
for (i = SystemInfo.countIOS; i--;) {
ios[i].infoContent = 0;
@ -333,6 +332,9 @@ int main(int argc, char **argv)
// Check MIOS
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();
// For each titles found
for (i = SystemInfo.countIOS; i--;)
@ -393,7 +395,7 @@ int main(int argc, char **argv)
}
if ((!ios[i].isStub || ios[i].titleID == TID_CBOOT2) && (SystemInfo.nandAccess) && (!getInfoFromContent(&ios[i]))) {
// Hash des TMDs abrufen
// Get the TMD hash
iosTMD->title_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);
}
}
}