mirror of
https://github.com/modmii/SysCheck-ModMii-Edition.git
synced 2024-11-22 08:09:19 +01:00
Overall a very unimportant commit
-Improved gecko code and increased buffer size to 4K -Added some additional logfile commands -Got rid of a few commented out functions
This commit is contained in:
parent
a003f08986
commit
2f879e793e
@ -8,18 +8,17 @@ bool geckoinit = false;
|
|||||||
bool textVideoInit = false;
|
bool textVideoInit = false;
|
||||||
|
|
||||||
#ifndef NO_DEBUG
|
#ifndef NO_DEBUG
|
||||||
|
|
||||||
//using the gprintf from crediar because it is smaller than mine
|
|
||||||
void gprintf( const char *str, ... )
|
void gprintf( const char *str, ... )
|
||||||
{
|
{
|
||||||
if (!(geckoinit))return;
|
if (!(geckoinit))return;
|
||||||
char astr[1024];
|
char astr[4096];
|
||||||
|
int length;
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap,str);
|
va_start(ap,str);
|
||||||
|
|
||||||
vsnprintf(astr, sizeof(astr), str, ap);
|
length = vsnprintf(astr, sizeof(astr), str, ap);
|
||||||
usb_sendbuffer_safe(1, astr, strlen(astr));
|
if (length > 0) usb_sendbuffer_safe(1, astr, length);
|
||||||
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return;
|
return;
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include "runtimeiospatch.h"
|
#include "runtimeiospatch.h"
|
||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
|
#include "tools.h"
|
||||||
|
|
||||||
#define MEM_REG_BASE 0xd8b4000
|
#define MEM_REG_BASE 0xd8b4000
|
||||||
#define MEM_PROT (MEM_REG_BASE + 0x20a)
|
#define MEM_PROT (MEM_REG_BASE + 0x20a)
|
||||||
@ -101,8 +102,10 @@ static const u8 isfs_setattr_pt2_patch[] = { 0x2D, 0x00, 0xE0, 0x02, 0x20, 0x66
|
|||||||
static u8 apply_patch(const char *name, const u8 *old, u32 old_size, const u8 *patch, size_t patch_size, u32 patch_offset, bool verbose) {
|
static u8 apply_patch(const char *name, const u8 *old, u32 old_size, const u8 *patch, size_t patch_size, u32 patch_offset, bool verbose) {
|
||||||
u8 *ptr_start = (u8*)*((u32*)0x80003134), *ptr_end = (u8*)0x94000000;
|
u8 *ptr_start = (u8*)*((u32*)0x80003134), *ptr_end = (u8*)0x94000000;
|
||||||
u8 found = 0;
|
u8 found = 0;
|
||||||
if(verbose)
|
if(verbose) {
|
||||||
gprintf(" Patching %-30s", name);
|
gprintf(" Patching %-30s", name);
|
||||||
|
logfile(" Patching %-30s", name);
|
||||||
|
}
|
||||||
u8 *location = NULL;
|
u8 *location = NULL;
|
||||||
while (ptr_start < (ptr_end - patch_size)) {
|
while (ptr_start < (ptr_end - patch_size)) {
|
||||||
if (!memcmp(ptr_start, old, old_size)) {
|
if (!memcmp(ptr_start, old, old_size)) {
|
||||||
@ -119,10 +122,13 @@ static u8 apply_patch(const char *name, const u8 *old, u32 old_size, const u8 *p
|
|||||||
ptr_start++;
|
ptr_start++;
|
||||||
}
|
}
|
||||||
if(verbose){
|
if(verbose){
|
||||||
if (found)
|
if (found) {
|
||||||
gprintf(" patched\n");
|
gprintf(" patched\n");
|
||||||
else
|
logfile(" patched\r\n");
|
||||||
|
} else {
|
||||||
gprintf(" not patched\n");
|
gprintf(" not patched\n");
|
||||||
|
logfile(" not patched\r\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
@ -146,7 +152,10 @@ s32 IosPatch_RUNTIME(bool wii, bool sciifii, bool vwii, bool verbose) {
|
|||||||
disable_memory_protection();
|
disable_memory_protection();
|
||||||
if(wii)
|
if(wii)
|
||||||
{
|
{
|
||||||
if(verbose) gprintf(">> Applying standard Wii patches:\n");
|
if(verbose) {
|
||||||
|
gprintf(">> Applying standard Wii patches:\n");
|
||||||
|
logfile(">> Applying standard Wii patches:\r\n");
|
||||||
|
}
|
||||||
count += apply_patch("di_readlimit", di_readlimit_old, sizeof(di_readlimit_old), di_readlimit_patch, sizeof(di_readlimit_patch), 12, verbose);
|
count += apply_patch("di_readlimit", di_readlimit_old, sizeof(di_readlimit_old), di_readlimit_patch, sizeof(di_readlimit_patch), 12, verbose);
|
||||||
count += apply_patch("isfs_permissions", isfs_permissions_old, sizeof(isfs_permissions_old), isfs_permissions_patch, sizeof(isfs_permissions_patch), 0, verbose);
|
count += apply_patch("isfs_permissions", isfs_permissions_old, sizeof(isfs_permissions_old), isfs_permissions_patch, sizeof(isfs_permissions_patch), 0, verbose);
|
||||||
count += apply_patch("es_setuid", setuid_old, sizeof(setuid_old), setuid_patch, sizeof(setuid_patch), 0, verbose);
|
count += apply_patch("es_setuid", setuid_old, sizeof(setuid_old), setuid_patch, sizeof(setuid_patch), 0, verbose);
|
||||||
@ -162,7 +171,10 @@ s32 IosPatch_RUNTIME(bool wii, bool sciifii, bool vwii, bool verbose) {
|
|||||||
}
|
}
|
||||||
if(sciifii)
|
if(sciifii)
|
||||||
{
|
{
|
||||||
if(verbose) gprintf(">> Applying Sciifii patches:\n");
|
if(verbose) {
|
||||||
|
gprintf(">> Applying Sciifii patches:\n");
|
||||||
|
logfile(">> Applying Sciifii patches:\r\n");
|
||||||
|
}
|
||||||
count += apply_patch("MEM2_prot", MEM2_prot_old, sizeof(MEM2_prot_old), MEM2_prot_patch, sizeof(MEM2_prot_patch), 0, verbose);
|
count += apply_patch("MEM2_prot", MEM2_prot_old, sizeof(MEM2_prot_old), MEM2_prot_patch, sizeof(MEM2_prot_patch), 0, verbose);
|
||||||
count += apply_patch("ES_OpenTitleContent1", ES_OpenTitleContent1_old, sizeof(ES_OpenTitleContent1_old), ES_OpenTitleContent1_patch, sizeof(ES_OpenTitleContent1_patch), 0, verbose);
|
count += apply_patch("ES_OpenTitleContent1", ES_OpenTitleContent1_old, sizeof(ES_OpenTitleContent1_old), ES_OpenTitleContent1_patch, sizeof(ES_OpenTitleContent1_patch), 0, verbose);
|
||||||
count += apply_patch("ES_OpenTitleContent2", ES_OpenTitleContent2_old, sizeof(ES_OpenTitleContent2_old), ES_OpenTitleContent2_patch, sizeof(ES_OpenTitleContent2_patch), 0, verbose);
|
count += apply_patch("ES_OpenTitleContent2", ES_OpenTitleContent2_old, sizeof(ES_OpenTitleContent2_old), ES_OpenTitleContent2_patch, sizeof(ES_OpenTitleContent2_patch), 0, verbose);
|
||||||
@ -173,7 +185,10 @@ s32 IosPatch_RUNTIME(bool wii, bool sciifii, bool vwii, bool verbose) {
|
|||||||
}
|
}
|
||||||
if(vwii)
|
if(vwii)
|
||||||
{
|
{
|
||||||
if(verbose) gprintf(">> Applying vWii patches:\n");
|
if(verbose) {
|
||||||
|
gprintf(">> Applying vWii patches:\n");
|
||||||
|
logfile(">> Applying vWii patches:\r\n");
|
||||||
|
}
|
||||||
count += apply_patch("Kill_AntiSysTitleInstallv3_pt1", Kill_AntiSysTitleInstallv3_pt1_old, sizeof(Kill_AntiSysTitleInstallv3_pt1_old), Kill_AntiSysTitleInstallv3_pt1_patch, sizeof(Kill_AntiSysTitleInstallv3_pt1_patch), 0, verbose);
|
count += apply_patch("Kill_AntiSysTitleInstallv3_pt1", Kill_AntiSysTitleInstallv3_pt1_old, sizeof(Kill_AntiSysTitleInstallv3_pt1_old), Kill_AntiSysTitleInstallv3_pt1_patch, sizeof(Kill_AntiSysTitleInstallv3_pt1_patch), 0, verbose);
|
||||||
count += apply_patch("Kill_AntiSysTitleInstallv3_pt2", Kill_AntiSysTitleInstallv3_pt2_old, sizeof(Kill_AntiSysTitleInstallv3_pt2_old), Kill_AntiSysTitleInstallv3_pt2_patch, sizeof(Kill_AntiSysTitleInstallv3_pt2_patch), 0, verbose);
|
count += apply_patch("Kill_AntiSysTitleInstallv3_pt2", Kill_AntiSysTitleInstallv3_pt2_old, sizeof(Kill_AntiSysTitleInstallv3_pt2_old), Kill_AntiSysTitleInstallv3_pt2_patch, sizeof(Kill_AntiSysTitleInstallv3_pt2_patch), 0, verbose);
|
||||||
count += apply_patch("Kill_AntiSysTitleInstallv3_pt3", Kill_AntiSysTitleInstallv3_pt3_old, sizeof(Kill_AntiSysTitleInstallv3_pt3_old), Kill_AntiSysTitleInstallv3_pt3_patch, sizeof(Kill_AntiSysTitleInstallv3_pt3_patch), 0, verbose);
|
count += apply_patch("Kill_AntiSysTitleInstallv3_pt3", Kill_AntiSysTitleInstallv3_pt3_old, sizeof(Kill_AntiSysTitleInstallv3_pt3_old), Kill_AntiSysTitleInstallv3_pt3_patch, sizeof(Kill_AntiSysTitleInstallv3_pt3_patch), 0, verbose);
|
||||||
|
13
source/sys.c
13
source/sys.c
@ -12,12 +12,6 @@
|
|||||||
#include <ogc/conf.h>
|
#include <ogc/conf.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "sys.h"
|
|
||||||
#include "SysMenuInfo.h"
|
|
||||||
|
|
||||||
#include "ticket_dat.h"
|
|
||||||
#include "tmd_dat.h"
|
|
||||||
|
|
||||||
#include "fatMounter.h"
|
#include "fatMounter.h"
|
||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
@ -25,10 +19,16 @@
|
|||||||
#include "languages.h"
|
#include "languages.h"
|
||||||
#include "mload.h"
|
#include "mload.h"
|
||||||
#include "sha1.h"
|
#include "sha1.h"
|
||||||
|
#include "sys.h"
|
||||||
|
#include "SysMenuInfo.h"
|
||||||
#include "title.h"
|
#include "title.h"
|
||||||
#include "tmdIdentification.h"
|
#include "tmdIdentification.h"
|
||||||
#include "wiibasics.h"
|
#include "wiibasics.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include "ticket_dat.h"
|
||||||
|
#include "tmd_dat.h"
|
||||||
|
|
||||||
#define DM_INSTALLED ((*(vu32*)(appfile+i)) == 0x44494F53 && (*(vu32*)(appfile+i+5)) == 0x4D494F53) // true = DM or DML installed
|
#define DM_INSTALLED ((*(vu32*)(appfile+i)) == 0x44494F53 && (*(vu32*)(appfile+i+5)) == 0x4D494F53) // true = DM or DML installed
|
||||||
#define DML_OR_DM (*(vu32*)(appfile+i+10) == 0x4C697465) // true = DML
|
#define DML_OR_DM (*(vu32*)(appfile+i+10) == 0x4C697465) // true = DML
|
||||||
#define CMP_TIME(X) (difftime(unixTime, (X)) >= 0)
|
#define CMP_TIME(X) (difftime(unixTime, (X)) >= 0)
|
||||||
@ -408,7 +408,6 @@ inline bool CheckBeerTicket(u32 titleID) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline bool CheckIOSType(void) {
|
inline bool CheckIOSType(void) {
|
||||||
//if (AHB_ACCESS == false) return false;
|
|
||||||
u32 start_address = IOS_TOP;
|
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"
|
const char WL_String[] = {0x57, 0x4C, 0x3A, 0x20, 0x30, 0x32, 0x2F, 0x30, 0x32, 0x2F, 0x31, 0x32}; // "WL: 02/02/12"
|
||||||
u32 i;
|
u32 i;
|
||||||
|
@ -14,9 +14,8 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <di/di.h>
|
#include <di/di.h>
|
||||||
#include <CheckRegion.h>
|
#include <CheckRegion.h>
|
||||||
//#include <runtimeiospatch/runtimeiospatch.h>
|
|
||||||
#include "runtimeiospatch.h"
|
|
||||||
|
|
||||||
|
#include "runtimeiospatch.h"
|
||||||
#include "SysMenuInfo.h"
|
#include "SysMenuInfo.h"
|
||||||
#include "fatMounter.h"
|
#include "fatMounter.h"
|
||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
@ -631,8 +630,8 @@ int main(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Reload IOS
|
// Reload IOS
|
||||||
gprintf("// IOS_ReloadIOS(%d)\n", ios[i].titleID);
|
gprintf("IOS_ReloadIOS(%d)\n", ios[i].titleID);
|
||||||
logfile("// IOS_ReloadIOS(%d)\r\n", ios[i].titleID);
|
logfile("IOS_ReloadIOS(%d)\r\n", ios[i].titleID);
|
||||||
|
|
||||||
if (SystemInfo.deviceType == CONSOLE_WII_U)
|
if (SystemInfo.deviceType == CONSOLE_WII_U)
|
||||||
IosPatch_FULL(false, false, false, false, ios[i].titleID);
|
IosPatch_FULL(false, false, false, false, ios[i].titleID);
|
||||||
|
Loading…
Reference in New Issue
Block a user