Add EKHookMemoryRaw, fix compilation with Xcode 15.3 #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the
EKHookMemoryRaw
function pointer that jailbreaks are able to set to intercept memory hooks. I have also rewritten the old implementation in C (as it was just Swift code calling C functions anyways) and added some improvements to it, such as checking if remapping is even neccessary to write to it.In the future it would make sense to centralize this API further to also cover any writes of to-be-made-executable data (right now there are some places in ellekit that allocate memory, write to it and then set it as executable), which would also allow a jailbreak to handle something like page signing, but for now this API is enough for Dopamine to intercept all hooks of DSC pages to fix spinlock panics.
Additionally, this also fixes compilation on Xcode 15.3 which was broken due to Apple adding XPC headers to the iOS sdk, because I sure as hell didn't want to install an older Xcode just to compile ellekit :P.