mirror of
https://github.com/N64Recomp/N64ModernRuntime.git
synced 2025-10-30 08:02:29 +00:00
Fix issue with regenerating patched functions with no base functions regenerated, add 1kB of padding between mods to mitigate OOB accesses in mods, update N64Recomp (#84)
This commit is contained in:
parent
3474514013
commit
7319630e2e
2 changed files with 12 additions and 8 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit b18e0ca2dd359d62dcc019771f0ccc4a1302bd03
|
||||
Subproject commit 198de1b5cf6e58415948588584750c51562d58dd
|
||||
|
|
@ -1320,13 +1320,15 @@ std::vector<recomp::mods::ModLoadErrorDetails> recomp::mods::ModContext::regener
|
|||
}
|
||||
|
||||
// Apply the regenlist.
|
||||
regenerated_code_handle = apply_regenlist(regenlist, decompressed_rom);
|
||||
if (!regenerated_code_handle || !regenerated_code_handle->good()) {
|
||||
regenerated_code_handle.reset();
|
||||
ret.emplace_back(ModLoadErrorDetails{
|
||||
"", ModLoadError::FailedToLoadCode, error_to_string(CodeModLoadError::InternalError)
|
||||
});
|
||||
return ret;
|
||||
if (!regenlist.functions.empty()) {
|
||||
regenerated_code_handle = apply_regenlist(regenlist, decompressed_rom);
|
||||
if (!regenerated_code_handle || !regenerated_code_handle->good()) {
|
||||
regenerated_code_handle.reset();
|
||||
ret.emplace_back(ModLoadErrorDetails{
|
||||
"", ModLoadError::FailedToLoadCode, error_to_string(CodeModLoadError::InternalError)
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (!regenlist.patched_hooks.empty()) {
|
||||
|
|
@ -1484,6 +1486,8 @@ recomp::mods::CodeModLoadError recomp::mods::ModContext::init_mod_code(uint8_t*
|
|||
cur_section_addr += section.size + section.bss_size;
|
||||
// Align the next section's address to 16 bytes.
|
||||
cur_section_addr = (cur_section_addr + 15) & ~15;
|
||||
// Add some empty space between mods to act as a buffer for misbehaving mods that have out of bounds accesses.
|
||||
cur_section_addr += 0x400;
|
||||
}
|
||||
|
||||
// Iterate over each section again after loading them to perform R_MIPS_32 relocations.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue