diff --git a/src/kprx/main.c b/src/kprx/main.c index 2e01e9c..e8327dd 100644 --- a/src/kprx/main.c +++ b/src/kprx/main.c @@ -494,26 +494,49 @@ int pspGetModel() { return sceKernelGetModel(); } + int GetHardwareRevision() { u32 tachyon = pspGetTachyonVersion(); u32 baryon = pspGetBaryonVersion(); - if((tachyon == 0x00140000 && baryon == 0x00030600)) return 0x010100; // TA-079 - else if((tachyon == 0x00200000 && baryon == 0x00030600)) return 0x010101; // TA-079v2 - else if((tachyon == 0x00200000 && baryon == 0x00040600)) return 0x010102; // TA-079v3 - else if((tachyon == 0x00300000 && baryon == 0x00040600)) return 0x010200; // TA-081 + // 01g + if((tachyon == 0x00140000 && baryon == 0x00010600)) return 0x010100; // TA-079v1 + else if((tachyon == 0x00140000 && baryon == 0x00020600)) return 0x010101; // TA-079v2 + else if((tachyon == 0x00140000 && baryon == 0x00020600)) return 0x010102; // TA-079v3 + else if((tachyon == 0x00140000 && baryon == 0x00030600)) return 0x010102; // TA-079v3 + else if((tachyon == 0x00200000 && baryon == 0x00030600)) return 0x010103; // TA-079v4 + else if((tachyon == 0x00200000 && baryon == 0x00040600)) return 0x010104; // TA-079v4 + else if((tachyon == 0x00300000 && baryon == 0x00040600)) return 0x010200; // TA-081v1 + else if((tachyon == 0x00300000 && baryon == 0x00040600) && pspGetPommelVersion() == 0x00000104) return 0x010200; // TA-081v2 else if((tachyon == 0x00400000 && baryon == 0x00114000)) return 0x010300; // TA-082 else if((tachyon == 0x00400000 && baryon == 0x00121000)) return 0x010400; // TA-086 - else if((tachyon == 0x00500000 && baryon == 0x0022B200)) return 0x020100; // TA-085 + // 02g + else if((tachyon == 0x00500000 && baryon == 0x0022B200)) return 0x020100; // TA-085v1 else if((tachyon == 0x00500000 && baryon == 0x00234000)) return 0x020101; // TA-085v2 - else if((tachyon == 0x00500000 && baryon == 0x00243000)) return 0x020200; // TA-088 + else if((tachyon == 0x00500000 && baryon == 0x00243000)) return 0x020200; // TA-088v1/v2 else if((tachyon == 0x00600000 && baryon == 0x00243000)) return 0x020202; // TA-088v3 - else if((tachyon == 0x00500000 && baryon == 0x00263100)) return 0x020300; // TA-090 - - else if((tachyon == 0x00600000 && baryon == 0x00263100)) return 0x030100; // TA-090v2 + else if((tachyon == 0x00500000 && baryon == 0x00243000)) return 0x020300; // TA-090v1 (?) + + // 03g/04g/07g/09g + else if((tachyon == 0x00600000 && baryon == 0x00263100 && pspGetPommelVersion() == 0x00000132)) return 0x030101; // TA-090v2 + else if((tachyon == 0x00600000 && baryon == 0x00263100 && pspGetPommelVersion() == 0x00000133)) return 0x030102; // TA-090v3 + else if((tachyon == 0x00600000 && baryon == 0x00285000)) return 0x030200; // TA-092v1 + else if((tachyon == 0x00810000 && baryon == 0x002C4000 && pspGetPommelVersion() == 0x00000143)) return 0x030301; // TA-093v2 + else if((tachyon == 0x00810000 && baryon == 0x002E4000)) return 0x090100; // TA-095v1 + else if((tachyon == 0x00820000 && baryon == 0x002E4000)) return 0x090101; // TA-095v2 + else if((tachyon == 0x00810000 && baryon == 0x012E4000)) return 0x070102; // TA-095v3 + else if((tachyon == 0x00820000 && baryon == 0x012E4000)) return 0x070103; // TA-095v4 + + // 05g/06g + else if((tachyon == 0x00720000 && baryon == 0x00304000)) return 0x050100; // TA-091v1 + else if((tachyon == 0x00810000 && baryon == 0x00323000)) return 0x060100; // TA-094v1 + else if((tachyon == 0x00810000 && baryon == 0x00324000)) return 0x060101; // TA-094v2 + // 11g + else if((tachyon == 0x00900000 && baryon == 0x00403000)) return 0x060101; // TA-096v1/v2 + return 0xffffff; } int GetModel() @@ -584,28 +607,56 @@ char *GetMotherboard(char *buf) u32 tachyon = pspGetTachyonVersion(); u32 baryon = pspGetBaryonVersion(); - if((tachyon == 0x00140000 && baryon == 0x00030600)) sprintf(buf, "TA-079"); // get the motherboard version - else if((tachyon == 0x00200000 && baryon == 0x00030600)) sprintf(buf, "TA-079v2"); - else if((tachyon == 0x00200000 && baryon == 0x00040600)) sprintf(buf, "TA-079v3"); - else if((tachyon == 0x00300000 && baryon == 0x00040600)) sprintf(buf, "TA-081"); + + if((tachyon == 0x00140000 && baryon == 0x00010601)) sprintf(buf, "?TMU0--1?"); // get the motherboard version + else if((tachyon == 0x00140000 && baryon == 0x00020601)) sprintf(buf, "TMU-001"); + else if((tachyon == 0x00140000 && baryon == 0x00030601)) sprintf(buf, "TMU-002"); + else if((tachyon == 0x00140000 && baryon == 0x00010600)) sprintf(buf, "TA-079v1"); + else if((tachyon == 0x00140000 && baryon == 0x00020600)) sprintf(buf, "TA-079v2"); + else if((tachyon == 0x00140000 && baryon == 0x00030600)) sprintf(buf, "TA-079v3"); + else if((tachyon == 0x00200000 && baryon == 0x00030600)) sprintf(buf, "TA-079v4"); + else if((tachyon == 0x00200000 && baryon == 0x00040600)) sprintf(buf, "TA-079v5"); + else if((tachyon == 0x00300000 && baryon == 0x00040600)) sprintf(buf, "TA-081v1"); + else if((tachyon == 0x00300000 && baryon == 0x00040600 && pspGetPommelVersion() == 0x00000104)) sprintf(buf, "TA-081v2"); else if((tachyon == 0x00400000 && baryon == 0x00114000)) sprintf(buf, "TA-082"); else if((tachyon == 0x00400000 && baryon == 0x00121000)) sprintf(buf, "TA-086"); - else if((tachyon == 0x00500000 && baryon == 0x0022B200)) sprintf(buf, "TA-085"); + else if((tachyon == 0x00500000 && baryon == 0x0022B200)) sprintf(buf, "TA-085v1"); else if((tachyon == 0x00500000 && baryon == 0x00234000)) sprintf(buf, "TA-085v2"); - else if((tachyon == 0x00500000 && baryon == 0x00243000)) sprintf(buf, "TA-088"); + else if((tachyon == 0x00500000 && baryon == 0x00243000)) sprintf(buf, "TA-088v1"); + else if((tachyon == 0x00500000 && baryon == 0x00243000 && pspGetPommelVersion() == 0x00000123)) sprintf(buf, "TA-088v2"); else if((tachyon == 0x00600000 && baryon == 0x00243000)) sprintf(buf, "TA-088v3"); - else if((tachyon == 0x00500000 && baryon == 0x00263100)) sprintf(buf, "TA-090"); + else if((tachyon == 0x00500000 && baryon == 0x00263000)) sprintf(buf, "TA-090v1"); + + else if((tachyon == 0x00600000 && baryon == 0x00263100 && pspGetPommelVersion() == 0x00000132)) sprintf(buf, "TA-090v2"); + else if((tachyon == 0x00600000 && baryon == 0x00263100 && pspGetPommelVersion() == 0x00000133)) sprintf(buf, "TA-090v3"); + else if((tachyon == 0x00600000 && baryon == 0x00285000)) sprintf(buf, "TA-092"); + else if((tachyon == 0x00810000 && baryon == 0x002C4000 && pspGetPommelVersion() == 0x00000141)) sprintf(buf, "TA-093v1"); + else if((tachyon == 0x00810000 && baryon == 0x002C4000 && pspGetPommelVersion() == 0x00000143)) sprintf(buf, "TA-093v2"); + else if((tachyon == 0x00810000 && baryon == 0x002E4000)) sprintf(buf, "TA-095v1"); + else if((tachyon == 0x00820000 && baryon == 0x002E4000)) sprintf(buf, "TA-095v2"); + else if((tachyon == 0x00810000 && baryon == 0x012E4000)) sprintf(buf, "TA-095v3"); + else if((tachyon == 0x00820000 && baryon == 0x012E4000)) sprintf(buf, "TA-095v4"); + - else if((tachyon == 0x00600000 && baryon == 0x00263100)) sprintf(buf, "TA-090v2"); - else sprintf(buf, "Unknown"); + else if((tachyon == 0x00720000 && baryon == 0x00304000)) sprintf(buf, "TA-091"); + else if((tachyon == 0x00810000 && baryon == 0x00323000)) sprintf(buf, "TA-094v1"); + else if((tachyon == 0x00810000 && baryon == 0x00324000)) sprintf(buf, "TA-094v2"); + + + else if((tachyon == 0x00900000 && baryon == 0x00403000)) sprintf(buf, "TA-096/TA-097"); + + else sprintf(buf, "Unk: tachyon: %08X baryon: %08X", tachyon, baryon); return buf; } char *GetFWVersion(char *buf) { u32 ver = sceKernelDevkitVersion(); - sprintf(buf, "%i.%02i", (ver >> 24) & 0xff, (ver >> 8) & 0xffff); + int maj = (ver >> 24) & 0xFF; + int min = (ver >> 16) & 0xFF; + int pat = (ver >> 8) & 0xFF; + sprintf(buf, "%d.%d%d", maj, min, pat); return buf; } @@ -686,4 +737,4 @@ int module_start(SceSize args, void *argp) int module_stop() { return 0; -} \ No newline at end of file +} diff --git a/src/main.c b/src/main.c index 32cc579..682e891 100644 --- a/src/main.c +++ b/src/main.c @@ -36,6 +36,8 @@ char ebootpath[256]; MSStruct MSInfo; int tmmode, selitem, bguseflash = 0, wavespeed = 1, showback_prev = 0, showenter_prev = 0; +static int go = -1; + /* Callbacks */ @@ -955,7 +957,7 @@ int DumpPSAR(int extractmode, char *filepath, char *outdir, char *requiredver, u if(!memcmp(ver, "3.8", 3) || !memcmp(ver, "3.9", 3)){table_mode = 1;} else if(!memcmp(ver, "4.0", 3)){table_mode = 2;} else if(!memcmp(ver, "5.0", 3)){table_mode = 3;} - else if(!memcmp(ver, "6.", 2) && (psarVersion == 5)){table_mode = 5; version = 661;} + //else if(!memcmp(ver, "6.", 2) && (psarVersion == 5)){table_mode = 5; version = 661;} else if(!memcmp(ver, "6.", 2)){table_mode = 4; version = 661;} else{table_mode = 0;} @@ -990,7 +992,8 @@ int DumpPSAR(int extractmode, char *filepath, char *outdir, char *requiredver, u if(is5Dnum(name)){ //if(strcmp(name, "00001") != 0 && strcmp(name, "00002") != 0 && strcmp(name, "00003") != 0){ - if (atoi(name) >= 100 || (atoi(name) >= 10 && version < 661)) { + if (atoi(name) >= 100 || (atoi(name) >= 10)) { + //if (atoi(name) >= 1 && atoi(name) <= 11) { int found = 0; if(_1gtable_size > 0){found = FindTablePath(_1g_table, _1gtable_size, name, name);} @@ -1006,7 +1009,7 @@ int DumpPSAR(int extractmode, char *filepath, char *outdir, char *requiredver, u if(!found && _11gtable_size > 0){found = FindTablePath(_11g_table, _11gtable_size, name, name);} if(!found && _12gtable_size > 0){found = FindTablePath(_12g_table, _12gtable_size, name, name);} if(!found){ - SetStatus(0, 0, 240, 120, VLF_ALIGNMENT_CENTER, "Warning: cannot find path of %s", name); + SetStatus(0, 0, 240, 120, VLF_ALIGNMENT_CENTER, "Warning: cannot find table path of %s", name); error = 0; continue; } @@ -1014,7 +1017,7 @@ int DumpPSAR(int extractmode, char *filepath, char *outdir, char *requiredver, u } else if(!strncmp(name, "com:", 4) && comtable_size > 0){ if(!FindTablePath(com_table, comtable_size, name+4, name)){ - SetStatus(0, 0, 240, 120, VLF_ALIGNMENT_CENTER, "Warning: cannot find path of %s", name); + SetStatus(0, 0, 240, 120, VLF_ALIGNMENT_CENTER, "Warning: cannot find com path of %s", name); error = 0; continue; } @@ -1118,11 +1121,10 @@ int DumpPSAR(int extractmode, char *filepath, char *outdir, char *requiredver, u continue; } else if(!strcmp(name, "00005")){ - if(model == NULL || model == 0x000 || model == 0x003 || model == 0x103 || model == 0x023 || model == 0x123){ + if(model == 0x1337){ _5gtable_size = pspDecryptTable(sm_buffer2, sm_buffer1, cbExpanded, table_mode); if(_5gtable_size <= 0){ - // We don't have yet the keys for table of 3000, they are only in mesg_led05g.prx SetStatus(0, 0, 240, 120, VLF_ALIGNMENT_CENTER, "Cannot decrypt 5g table"); error = 0; continue; @@ -1509,7 +1511,7 @@ void CreateMMS(char *mmsver) vlfGuiMessageDialog("Magic Memory Stick Information\n\nCreator: Dark_AleX\nRelease Date: 19th of August 2008\nFirmware: 4.01 M33-2 (4.01 OFW)\nCompatibility: TA-088v2 and older", VLF_MD_TYPE_NORMAL|VLF_MD_BUTTONS_NONE); if(!FileExists("ms0:/401.PBP")){ErrorReturn("Please ensure 401.PBP exists at the root of the Memory Stick.");return;} - if(GetHardwareRevision() > 0x020201 && GetHardwareRevision != 0x020300){ + if(GetHardwareRevision() > 0x020201 && GetHardwareRevision() != 0x020300){ cont = vlfGuiMessageDialog("This Magic Memory Stick software can not be installed on your PSP unit.\n\nDo you want to continue?", VLF_MD_TYPE_NORMAL|VLF_MD_BUTTONS_YESNO|VLF_MD_INITIAL_CURSOR_NO); if(cont != 1){OnBackToMainMenu(0);return;} } @@ -1535,7 +1537,7 @@ void CreateMMS(char *mmsver) vlfGuiMessageDialog("Magic Memory Stick Information\n\nCreator: Dark_AleX\nRelease Date: 18th of December 2008\nFirmware: 5.00 M33-4 (5.00 OFW)\nCompatibility: TA-088v2 and older", VLF_MD_TYPE_NORMAL|VLF_MD_BUTTONS_NONE); if(!FileExists("ms0:/500.PBP")){ErrorReturn("Please ensure 500.PBP exists at the root of the Memory Stick.");return;} - if(GetHardwareRevision() > 0x020201 && GetHardwareRevision != 0x020300){ + if(GetHardwareRevision() > 0x020201 && GetHardwareRevision() != 0x020300){ cont = vlfGuiMessageDialog("This Magic Memory Stick software can not be installed on your PSP unit.\n\nDo you want to continue?", VLF_MD_TYPE_NORMAL|VLF_MD_BUTTONS_YESNO|VLF_MD_INITIAL_CURSOR_NO); if(cont != 1){OnBackToMainMenu(0);return;} } @@ -1562,7 +1564,7 @@ void CreateMMS(char *mmsver) vlfGuiMessageDialog("Magic Memory Stick Information\n\nCreator: Balika011\nRelease Date: 18th of November 2021\nFirmware: 5.02 M33-5\n5.02 TestingTool M33\n5.02 OFW\nCompatibility: TA-092 and older", VLF_MD_TYPE_NORMAL|VLF_MD_BUTTONS_NONE); if(!FileExists("ms0:/502.PBP")){ErrorReturn("Please ensure 502.PBP exists at the root of the Memory Stick.");return;} - if(GetHardwareRevision() > 0x020201 && GetHardwareRevision != 0x020300){ + if(GetHardwareRevision() > 0x030101){ cont = vlfGuiMessageDialog("This Magic Memory Stick software can not be installed on your PSP unit.\n\nDo you want to continue?", VLF_MD_TYPE_NORMAL|VLF_MD_BUTTONS_YESNO|VLF_MD_INITIAL_CURSOR_NO); if(cont != 1){OnBackToMainMenu(0);return;} } @@ -1586,15 +1588,22 @@ void CreateMMS(char *mmsver) } else if(strcmp(mmsver, "DC10") == 0){ vlfGuiMessageDialog("Magic Memory Stick Information\n\nCreator: ARK-4 Team\nRelease Date: 20th of April 2024\nFirmware: 6.61 ARK-4\n6.61 OFW\nCompatibility: All", VLF_MD_TYPE_NORMAL|VLF_MD_BUTTONS_NONE); - if(!FileExists("ms0:/661.PBP")){ErrorReturn("Please ensure 661.PBP exists at the root of the Memory Stick.");return;} + if(FileExists("ms0:/661GO.PBP")){go = 1;} + if(!FileExists("ms0:/661.PBP") && !FileExists("ms0:/661GO.PBP")){ErrorReturn("Please ensure 661.PBP or 661GO.PBP exists at the root of the Memory Stick.");return;} if(DirExists("ms0:/TM/DCARK")){ cont = vlfGuiMessageDialog("A Magic Memory Stick Software already exists at ms0:/TM/DCARK and will be overwritten by this installation.\n\nDo you want to continue?", VLF_MD_TYPE_NORMAL|VLF_MD_BUTTONS_YESNO|VLF_MD_INITIAL_CURSOR_NO); if(cont != 1){OnBackToMainMenu(0);return;} } - err = DumpPSAR(MODE_ENCRYPT, "ms0:/661.PBP", "ms0:/TM/DCARK", "6.61", NULL, NULL); - if(err == 0){err = ExtractUpdaterPRXs(1, "ms0:/661.PBP", "ms0:/TM/DCARK/kd");}else{return;} + if(go > 0) { + err = DumpPSAR(MODE_ENCRYPT, "ms0:/661GO.PBP", "ms0:/TM/DCARK", "6.61", 0x1337, NULL); + if(err == 0){err = ExtractUpdaterPRXs(1, "ms0:/661GO.PBP", "ms0:/TM/DCARK/kd");}else{return;} + } + else { + err = DumpPSAR(MODE_ENCRYPT, "ms0:/661.PBP", "ms0:/TM/DCARK", "6.61", NULL, NULL); + if(err == 0){err = ExtractUpdaterPRXs(1, "ms0:/661.PBP", "ms0:/TM/DCARK/kd");}else{return;} + } if(err == 0){BackupSettings("ms0:/TM/DCARK/registry");}else{return;} for(i = 0; i < sizeof(DC10files) / sizeof(DC10files[0]); i++){