fix layeredfs regression

This commit is contained in:
TuxSH 2019-04-21 12:15:50 +02:00
parent 3e724e88a8
commit 4285736286
2 changed files with 3 additions and 3 deletions

View File

@ -530,7 +530,7 @@ static inline bool patchLayeredFs(u64 progId, u8 *code, u32 size, u32 textSize,
romfsRedirPatchSubstituted1 = *(u32 *)(code + fsOpenFileDirectly); romfsRedirPatchSubstituted1 = *(u32 *)(code + fsOpenFileDirectly);
romfsRedirPatchHook1 = MAKE_BRANCH(payloadOffset + (u32)&romfsRedirPatchHook1 - (u32)romfsRedirPatch, fsOpenFileDirectly + 4); romfsRedirPatchHook1 = MAKE_BRANCH(payloadOffset + (u32)&romfsRedirPatchHook1 - (u32)romfsRedirPatch, fsOpenFileDirectly + 4);
romfsRedirPatchSubstituted1 = *(u32 *)(code + fsTryOpenFile); romfsRedirPatchSubstituted2 = *(u32 *)(code + fsTryOpenFile);
romfsRedirPatchHook2 = MAKE_BRANCH(payloadOffset + (u32)&romfsRedirPatchHook2 - (u32)romfsRedirPatch, fsTryOpenFile + 4); romfsRedirPatchHook2 = MAKE_BRANCH(payloadOffset + (u32)&romfsRedirPatchHook2 - (u32)romfsRedirPatch, fsTryOpenFile + 4);
romfsRedirPatchCustomPath = pathAddress; romfsRedirPatchCustomPath = pathAddress;
romfsRedirPatchFsMountArchive = 0x100000 + fsMountArchive; romfsRedirPatchFsMountArchive = 0x100000 + fsMountArchive;

View File

@ -23,7 +23,7 @@ romfsRedirPatch:
.word 0xdead0002 @ Substituted opcode .word 0xdead0002 @ Substituted opcode
.global romfsRedirPatchHook2 .global romfsRedirPatchHook2
romfsRedirPatchHook2: romfsRedirPatchHook2:
.word 0xdead0002 @ Branch to hooked function .word 0xdead0003 @ Branch to hooked function
@ Mounts the archive and registers it as 'lf:' @ Mounts the archive and registers it as 'lf:'
mountArchive: mountArchive:
@ -31,7 +31,7 @@ romfsRedirPatch:
bne romfsRedirPatchSubstituted1 bne romfsRedirPatchSubstituted1
stmfd sp!, {r0-r4, lr} stmfd sp!, {r0-r4, lr}
sub sp, sp, #4 sub sp, sp, #4
adr r1, romfsRedirPatchArchiveId ldr r1, romfsRedirPatchArchiveId
mov r0, sp mov r0, sp
ldr r4, romfsRedirPatchFsMountArchive ldr r4, romfsRedirPatchFsMountArchive
blx r4 blx r4