skyline-dev / skyline

An environment for runtime hooking/code patching within Super Smash Bros Ultimate
MIT License
227 stars 33 forks source link

Fix issues with page-alignment of RW/RX page sizes #9

Open jam1garner opened 4 years ago

jam1garner commented 4 years ago

Requires testing before merge.

Things to test:

  1. Ensure this isn't a reversion by testing that A64HookFunction works
  2. Ensure that this actually fixes modifying .text/.rodata along page boundaries resulting in a lower offset-in-page of the end of the buffer than the start of the buffer.

For example:

rx = 0xFFC;
size = 0x8;

In this instance, the 4 bytes on the second page would not be properly included in the ControlledPages and will crash if you attempt to write to it due to the second page not being mapped.