mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-06-02 01:06:50 +02:00
Improved handling of module params and locating of unused libsyscall space to support rom hacks that repack roms in unusual ways. Fixes #129
This commit is contained in:
@@ -78,8 +78,7 @@ const u16* SecureSysCallsUnusedSpaceLocator::FindPattern(const u16* data, u32 le
|
||||
|
||||
void SecureSysCallsUnusedSpaceLocator::FindUnusedSpace(const nds_header_ntr_t* romHeader, PatchHeap& patchHeap) const
|
||||
{
|
||||
if (romHeader->arm9RomOffset != 0x4000)
|
||||
return;
|
||||
// NOTE: We can not check if arm9RomOffset == 0x4000, because some rom hacks repack the rom in unusual ways.
|
||||
|
||||
u32 secureStart = romHeader->arm9LoadAddress;
|
||||
|
||||
@@ -91,6 +90,12 @@ void SecureSysCallsUnusedSpaceLocator::FindUnusedSpace(const nds_header_ntr_t* r
|
||||
return;
|
||||
}
|
||||
|
||||
if (((u32*)secureStart)[0] != 0xE7FFDEFF || ((u32*)secureStart)[1] != 0xE7FFDEFF)
|
||||
{
|
||||
LOG_ERROR("No secure area space found\n");
|
||||
return;
|
||||
}
|
||||
|
||||
std::array<svc_pattern_t, sSvcPatterns.size()> patternLocations;
|
||||
|
||||
for (u32 i = 0; i < sSvcPatterns.size(); i++)
|
||||
|
||||
Reference in New Issue
Block a user