Skip to content

Commit

Permalink
Fix: Mii Maker opening HBL when creating an account
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicUsername12 committed Nov 7, 2021
1 parent cdb59b2 commit c58ee47
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion title_patcher/source/entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ int _main(uint32_t ret_addr) {
*/


LoadWiiUSymbols();

uint64_t titleId = OSGetTitleID();
Expand All @@ -63,6 +62,34 @@ int _main(uint32_t ret_addr) {

Debugger_Start();

if(titleId == 0x000500101004a000
|| titleId == 0x000500101004a100
|| titleId == 0x000500101004a200)
{
int (*_SYSGetMiiStudioArgs)(int* r3);
uint32_t __rpl_sysapp;
OSDynLoad_Acquire("sysapp", &__rpl_sysapp);
OSDynLoad_FindExport(__rpl_sysapp, false, "_SYSGetMiiStudioArgs", (void**)&_SYSGetMiiStudioArgs);

int args[10];
memset(args, 0, sizeof(args));
_SYSGetMiiStudioArgs(args);

/* We're in Mii Maker to choose/create a Mii, do not start sd_loader, do the coreinit entry by ourselves */
if(args[4] == 2) {

uint32_t rpxEntry = *(uint32_t*)0x1005E040;
int rpxArgc = *(int*)0x10013C30;
char **rpxArgv = *(char***)0x10013C34;

int (*realGameEntry)(int argc, char **argv) = (int (*)(int argc, char **argv))rpxEntry;
void (*CafeOS_Exit)(int exitCode) = (void (*)(int))0x0101cdc4;

CafeOS_Exit(realGameEntry(rpxArgc, rpxArgv));

}
}

printf("\ntitle_patcher: 0x%016llx\n", titleId);

/* Somehow, kern_write and kern_read aren't written in Internet Browser syscall table when using CBHC */
Expand Down

0 comments on commit c58ee47

Please sign in to comment.