Skip to content

Commit

Permalink
Fix patchSvcBreak11
Browse files Browse the repository at this point in the history
  • Loading branch information
TuxSH committed Apr 15, 2017
1 parent 2ff4fc3 commit 07bbff7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/firm.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ u32 patchNativeFirm(u32 firmVersion, FirmwareSource nandType, u32 emuHeader, boo
u32 codeSetOffset,
stackAddress = getInfoForArm11ExceptionHandlers(arm11Section1, firm->section[1].size, &codeSetOffset);
ret += installArm11Handlers(arm11ExceptionsPage, stackAddress, codeSetOffset, arm11DAbtHandler, baseK11VA + ((u8 *)arm11DAbtHandler - arm11Section1));
patchSvcBreak11(arm11Section1, arm11SvcTable);
patchSvcBreak11(arm11Section1, arm11SvcTable, baseK11VA);
ret += patchKernel11Panic(arm11Section1, firm->section[1].size);

//ARM9 exception handlers
Expand Down
4 changes: 2 additions & 2 deletions source/patches.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,10 @@ u32 patchSvcBreak9(u8 *pos, u32 size, u32 kernel9Address)
return 0;
}

void patchSvcBreak11(u8 *pos, u32 *arm11SvcTable)
void patchSvcBreak11(u8 *pos, u32 *arm11SvcTable, u32 baseK11VA)
{
//Same as above, for NATIVE_FIRM ARM11
u32 *addr = (u32 *)(pos + arm11SvcTable[0x3C] - 0xFFF00000);
u32 *addr = (u32 *)(pos + arm11SvcTable[0x3C] - baseK11VA);
*addr = 0xE12FFF7F;
}

Expand Down
2 changes: 1 addition & 1 deletion source/patches.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ u32 implementSvcGetCFWInfo(u8 *pos, u32 *arm11SvcTable, u32 baseK11VA, u8 **free
u32 patchArm9ExceptionHandlersInstall(u8 *pos, u32 size);
u32 getInfoForArm11ExceptionHandlers(u8 *pos, u32 size, u32 *codeSetOffset);
u32 patchSvcBreak9(u8 *pos, u32 size, u32 kernel9Address);
void patchSvcBreak11(u8 *pos, u32 *arm11SvcTable);
void patchSvcBreak11(u8 *pos, u32 *arm11SvcTable, u32 baseK11VA);
u32 patchKernel9Panic(u8 *pos, u32 size);
u32 patchKernel11Panic(u8 *pos, u32 size);
u32 patchP9AccessChecks(u8 *pos, u32 size);
Expand Down

0 comments on commit 07bbff7

Please sign in to comment.