Created
January 28, 2022 18:23
-
-
Save hax0kartik/bdd51eefd801378cd199121a46a50b33 to your computer and use it in GitHub Desktop.
Patch to disable ZL/ZR/Cnub via luma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Disable CNUB */ | |
case 0x150080: | |
{ | |
SessionInfo *info = SessionInfo_Lookup(clientSession->parentSession); | |
if(info != NULL && strcmp(info->name, "i2c::IR") == 0){ | |
skip = true; | |
res = SendSyncRequest(handle); | |
if(res == 0) | |
{ | |
u32 *staticbuf = (u32 *)((u8 *)currentCoreContext->objectContext.currentThread->threadLocalStorage + 0x180); | |
u32 *bufaddr = (u32 *)staticbuf[1]; | |
*bufaddr = 0x80800081 | (*bufaddr & 0x600); | |
} | |
} | |
break; | |
} | |
/* Disable ZR */ | |
case 0x150080: | |
{ | |
SessionInfo *info = SessionInfo_Lookup(clientSession->parentSession); | |
if(info != NULL && strcmp(info->name, "i2c::IR") == 0){ | |
skip = true; | |
res = SendSyncRequest(handle); | |
if(res == 0) | |
{ | |
u32 *staticbuf = (u32 *)((u8 *)currentCoreContext->objectContext.currentThread->threadLocalStorage + 0x180); | |
u32 *bufaddr = (u32 *)staticbuf[1]; | |
*bufaddr &= ~0x200; | |
} | |
} | |
break; | |
} | |
/* Disable ZL */ | |
case 0x150080: | |
{ | |
SessionInfo *info = SessionInfo_Lookup(clientSession->parentSession); | |
if(info != NULL && strcmp(info->name, "i2c::IR") == 0){ | |
skip = true; | |
res = SendSyncRequest(handle); | |
if(res == 0) | |
{ | |
u32 *staticbuf = (u32 *)((u8 *)currentCoreContext->objectContext.currentThread->threadLocalStorage + 0x180); | |
u32 *bufaddr = (u32 *)staticbuf[1]; | |
*bufaddr &= ~0x400; | |
} | |
} | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment