skyline-dev / skyline

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

Failure with 0 aslr_slide #79

Open liamwhite opened 1 year ago

liamwhite commented 1 year ago

This code does not work when ASLR is disabled or you hit the 1/260000 lottery of selecting a 0 ASLR slide value: https://github.com/skyline-dev/skyline/blob/972cdefcbd5dc01e01c91227f31cee50d1ae95d5/source/skyline/inlinehook/And64InlineHook.cpp#L536-L552

The code assumes addresses before the first .text section can be mapped as generated code. But if the ASLR slide is 0, then they are not mappable as generated code, and the program will fail to perform the call to svc::ControlCodeMemory and subsequently crash.

jam1garner commented 11 months ago

I personally believe unlucky people should not be allowed to use Skyline