Skip to content

Commit

Permalink
Apply the eShop update skipping patch only if the updated NAND was no…
Browse files Browse the repository at this point in the history
…t booted (depends on the "Use SysNAND FIRM as default" option)
  • Loading branch information
AuroraWright committed Apr 26, 2016
1 parent c9781ab commit d40722a
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions injector/source/patcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,6 @@ void patchCode(u64 progId, u8 *code, u32 size)
static const u8 blockAutoUpdatesPatch[] = {
0xE3, 0xA0
};
static const u8 skipEshopUpdateCheckPattern[] = {
0x30, 0xB5, 0xF1, 0xB0
};
static const u8 skipEshopUpdateCheckPatch[] = {
0x00, 0x20, 0x08, 0x60, 0x70, 0x47
};

//Block silent auto-updates
patchMemory(code, size,
Expand All @@ -351,13 +345,24 @@ void patchCode(u64 progId, u8 *code, u32 size)
sizeof(blockAutoUpdatesPatch), 1
);

//Skip update checks to access the EShop
patchMemory(code, size,
skipEshopUpdateCheckPattern,
sizeof(skipEshopUpdateCheckPattern), 0,
skipEshopUpdateCheckPatch,
sizeof(skipEshopUpdateCheckPatch), 1
);
//Apply only if the updated NAND hasn't been booted
if((BOOTCONFIG(0, 3) != 0) == (BOOTCONFIG(3, 1) && CONFIG(1)))
{
static const u8 skipEshopUpdateCheckPattern[] = {
0x30, 0xB5, 0xF1, 0xB0
};
static const u8 skipEshopUpdateCheckPatch[] = {
0x00, 0x20, 0x08, 0x60, 0x70, 0x47
};

//Skip update checks to access the EShop
patchMemory(code, size,
skipEshopUpdateCheckPattern,
sizeof(skipEshopUpdateCheckPattern), 0,
skipEshopUpdateCheckPatch,
sizeof(skipEshopUpdateCheckPatch), 1
);
}

break;
}
Expand Down

0 comments on commit d40722a

Please sign in to comment.