Stub isTitleAllowed
This commit is contained in:
parent
f67d333457
commit
f46773ba64
@ -9,6 +9,14 @@ void memcpy(void *dest, const void *src, u32 size)
|
||||
destc[i] = srcc[i];
|
||||
}
|
||||
|
||||
void memset32(void *dest, u32 filler, u32 size)
|
||||
{
|
||||
u32 *dest32 = (u32 *)dest;
|
||||
|
||||
for(u32 i = 0; i < size / 4; i++)
|
||||
dest32[i] = filler;
|
||||
}
|
||||
|
||||
int memcmp(const void *buf1, const void *buf2, u32 size)
|
||||
{
|
||||
const u8 *buf1c = (const u8 *)buf1,
|
||||
|
@ -3,5 +3,6 @@
|
||||
#include <3ds/types.h>
|
||||
|
||||
void memcpy(void *dest, const void *src, u32 size);
|
||||
void memset32(void *dest, u32 filler, u32 size);
|
||||
int memcmp(const void *buf1, const void *buf2, u32 size);
|
||||
u8 *memsearch(u8 *startPos, const void *pattern, u32 size, u32 patternSize);
|
@ -761,6 +761,25 @@ void patchCode(u64 progId, u16 progVer, u8 *code, u32 size, u32 textSize, u32 ro
|
||||
}
|
||||
}
|
||||
|
||||
if(progVer > 0x12)
|
||||
{
|
||||
static const u8 pattern[] = {
|
||||
0x00, 0xB1, 0x15, 0x00
|
||||
};
|
||||
|
||||
u8 *roStart = code + ((textSize + 4095) & 0xFFFFF000),
|
||||
*start = memsearch(roStart, pattern, roSize, sizeof(pattern));
|
||||
|
||||
if(start == NULL) goto error;
|
||||
|
||||
start++;
|
||||
u8 *end;
|
||||
for(end = start + 8; *(u32 *)end != 0xCC010000; end += 8)
|
||||
if(end >= roStart + roSize - 12) goto error;
|
||||
|
||||
memset32(start, 0, end - start);
|
||||
}
|
||||
|
||||
s64 nbSection0Modules;
|
||||
svcGetSystemInfo(&nbSection0Modules, 26, 0);
|
||||
|
||||
|
Reference in New Issue
Block a user