From 18b8eaabae44eba994bf9361d86ef12366a25dc3 Mon Sep 17 00:00:00 2001 From: Aurora Wright Date: Mon, 8 May 2017 21:35:46 +0200 Subject: [PATCH] Attempt to fix false positives when looking for update RomFSes --- injector/source/patcher.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/injector/source/patcher.c b/injector/source/patcher.c index a8c901b..b399311 100644 --- a/injector/source/patcher.c +++ b/injector/source/patcher.c @@ -572,7 +572,13 @@ static inline bool patchLayeredFs(u64 progId, u8 *code, u32 size, u32 textSize, //Locate update RomFSes for(updateRomFsIndex = 0; updateRomFsIndex < sizeof(updateRomFsMounts) / sizeof(char *) - 1; updateRomFsIndex++) - if(memsearch(code, updateRomFsMounts[updateRomFsIndex], size, strnlen(updateRomFsMounts[updateRomFsIndex], 255)) != NULL) break; + { + u32 patternSize = strnlen(updateRomFsMounts[updateRomFsIndex], 255); + u8 temp[7]; + temp[0] = 0; + memcpy(temp + 1, updateRomFsMounts[updateRomFsIndex], patternSize); + if(memsearch(code, temp, size, patternSize + 1) != NULL) break; + } //Setup the payload u8 *payload = code + payloadOffset;