mirror of
https://github.com/LumaTeam/Luma3DS.git
synced 2026-06-25 13:25:52 +00:00
LayeredFS: Allow patchLayeredFs if fsUnMountArchive symbol doesn't exist
This commit is contained in:
parent
b3282131c4
commit
a0bbd93c1f
@ -196,7 +196,7 @@ static inline bool findLayeredFsSymbols(u8 *code, u32 size, u32 *fsMountArchive,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return found == 5;
|
return (found == 5 || (found == 4 && *fsUnMountArchive == 0xFFFFFFFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool findLayeredFsPayloadOffset(u8 *code, u32 size, u32 roSize, u32 dataSize, u32 roAddress, u32 dataAddress, u32 *payloadOffset, u32 *pathOffset, u32 *pathAddress)
|
static inline bool findLayeredFsPayloadOffset(u8 *code, u32 size, u32 roSize, u32 dataSize, u32 roAddress, u32 dataAddress, u32 *payloadOffset, u32 *pathOffset, u32 *pathAddress)
|
||||||
@ -632,7 +632,9 @@ static inline bool patchLayeredFs(u64 progId, u8 *code, u32 size, u32 textSize,
|
|||||||
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 = MAKE_BRANCH_LINK(payloadOffset + (u32)&romfsRedirPatchFsMountArchive - (u32)romfsRedirPatch, fsMountArchive);
|
romfsRedirPatchFsMountArchive = MAKE_BRANCH_LINK(payloadOffset + (u32)&romfsRedirPatchFsMountArchive - (u32)romfsRedirPatch, fsMountArchive);
|
||||||
romfsRedirPatchFsUnMountArchive = MAKE_BRANCH_LINK(payloadOffset + (u32)&romfsRedirPatchFsUnMountArchive - (u32)romfsRedirPatch, fsUnMountArchive);
|
romfsRedirPatchFsUnMountArchive = (fsUnMountArchive != 0xFFFFFFFF) ?
|
||||||
|
MAKE_BRANCH_LINK(payloadOffset + (u32)&romfsRedirPatchFsUnMountArchive - (u32)romfsRedirPatch, fsUnMountArchive) :
|
||||||
|
0xE320F000; // NOP if fsUnMountArchive doesn't exist
|
||||||
romfsRedirPatchFsRegisterArchive = MAKE_BRANCH_LINK(payloadOffset + (u32)&romfsRedirPatchFsRegisterArchive - (u32)romfsRedirPatch, fsRegisterArchive);
|
romfsRedirPatchFsRegisterArchive = MAKE_BRANCH_LINK(payloadOffset + (u32)&romfsRedirPatchFsRegisterArchive - (u32)romfsRedirPatch, fsRegisterArchive);
|
||||||
romfsRedirPatchArchiveId = archiveId;
|
romfsRedirPatchArchiveId = archiveId;
|
||||||
memcpy(&romfsRedirPatchUpdateRomFsMount, updateRomFsMount, 4);
|
memcpy(&romfsRedirPatchUpdateRomFsMount, updateRomFsMount, 4);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user