Merge pull request #19 from TuxSH/master

"Friends" and "ErrDisp" patches (and Makefile fix)
This commit is contained in:
Aurora 2016-04-11 16:46:12 +02:00
commit 68bf134017
2 changed files with 53 additions and 0 deletions

View File

@ -1,5 +1,11 @@
rwildcard = $(foreach d, $(wildcard $1*), $(filter $(subst *, %, $2), $d) $(call rwildcard, $d/, $2))
ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif
include $(DEVKITARM)/3ds_rules
CC := arm-none-eabi-gcc
AS := arm-none-eabi-as
LD := arm-none-eabi-ld

View File

@ -180,6 +180,53 @@ void patchCode(u64 progId, u8 *code, u32 size)
break;
}
case 0x0004013000003202LL: // FRIENDS
{
static const u8 fpdverPattern[] = {
0xE0, 0x1E, 0xFF, 0x2F, 0xE1, 0x01, 0x01, 0x01, 0x01
};
u8 *fdpver = memsearch(code, fpdverPattern, size, sizeof(fpdverPattern));
if(fdpver == NULL) break;
else fdpver += sizeof(fpdverPattern);
if(*fdpver < 5) *fdpver = 5;
break;
}
case 0x0004003000008A02LL: // ErrDisp
{
static const u8 unitinfoCheckPattern1[] = {
0x14, 0x00, 0xD0, 0xE5, 0xDB, 0x9A, 0x9F, 0xED
};
static const u8 unitinfoCheckPattern2[] = {
0x14, 0x00, 0xD0, 0xE5, 0x01, 0x00, 0x10, 0xE3
} ;
static const u8 unitinfoCheckPatch[] = {
0x00, 0x00, 0xA0, 0xE3
} ;
patchMemory(code, size,
unitinfoCheckPattern1,
sizeof(unitinfoCheckPattern1), 0,
unitinfoCheckPatch,
sizeof(unitinfoCheckPatch), 1
);
patchMemory(code, size,
unitinfoCheckPattern2,
sizeof(unitinfoCheckPattern2), 0,
unitinfoCheckPatch,
sizeof(unitinfoCheckPatch), 3
);
break;
}
case 0x0004001000021000LL: // USA MSET
case 0x0004001000020000LL: // JPN MSET
case 0x0004001000022000LL: // EUR MSET