Attempt to fix NSMB2 by changing archive name

This commit is contained in:
Aurora Wright 2017-04-23 03:11:02 +02:00
parent 6d82649c3c
commit 48c23f2a43
2 changed files with 11 additions and 13 deletions

View File

@ -31,14 +31,14 @@ _start:
bne _mountSd+4 bne _mountSd+4
stmfd sp!, {r0-r4, lr} stmfd sp!, {r0-r4, lr}
sub sp, sp, #4 sub sp, sp, #4
load r1, archive load r1, archiveId
mov r0, sp mov r0, sp
load r4, fsMountArchive load r4, fsMountArchive
blx r4 blx r4
mov r3, #0 mov r3, #0
mov r2, #0 mov r2, #0
ldr r1, [sp] ldr r1, [sp]
addr r0, sdmcArchiveName addr r0, archiveName
load r4, fsRegisterArchive load r4, fsRegisterArchive
blx r4 blx r4
add sp, sp, #4 add sp, sp, #4
@ -60,7 +60,7 @@ _start:
pathRedir: pathRedir:
stmfd sp!, {r0-r3} stmfd sp!, {r0-r3}
add r0, sp, #0x10 add r0, sp, #0x10
addr r3, sdmcCustomPath addr r3, customPath
pathRedir_1: pathRedir_1:
ldrb r2, [r3], #1 ldrb r2, [r3], #1
strh r2, [r0], #2 strh r2, [r0], #2
@ -90,12 +90,10 @@ _start:
.pool .pool
.align 4 .align 4
sdmcArchiveName : .word 0xdead0007 archiveName : .word 0xdead0007
.dcb ":", 0
.align 4
fsMountArchive : .word 0xdead0005 fsMountArchive : .word 0xdead0005
fsRegisterArchive : .word 0xdead0006 fsRegisterArchive : .word 0xdead0006
archive : .word 0xdead0008 archiveId : .word 0xdead0008
sdmcCustomPath : .word 0xdead0004 customPath : .word 0xdead0004
.close .close

View File

@ -520,7 +520,7 @@ static inline bool patchLayeredFs(u64 progId, u8* code, u32 size)
if(!archive) return true; if(!archive) return true;
const char *mount = archive == ARCHIVE_SDMC ? "sdmc:" : "nand:"; const char *mount = archive == ARCHIVE_SDMC ? "sdc:" : "nnd:";
u32 fsMountArchive = 0xFFFFFFFF, u32 fsMountArchive = 0xFFFFFFFF,
fsRegisterArchive = 0xFFFFFFFF, fsRegisterArchive = 0xFFFFFFFF,
@ -554,8 +554,8 @@ static inline bool patchLayeredFs(u64 progId, u8* code, u32 size)
payload32[i] = MAKE_BRANCH(payloadOffset + i * 4, fsTryOpenFile + 4); payload32[i] = MAKE_BRANCH(payloadOffset + i * 4, fsTryOpenFile + 4);
break; break;
case 0xdead0004: case 0xdead0004:
memcpy(payload32 + i, mount, 5); memcpy(payload32 + i, mount, 4);
memcpy((u8 *)(payload32 + i) + 5, path, sizeof(path)); memcpy((u8 *)(payload32 + i) + 4, path, sizeof(path));
break; break;
case 0xdead0005: case 0xdead0005:
payload32[i] = 0x100000 + fsMountArchive; payload32[i] = 0x100000 + fsMountArchive;