5 ms·
The biggest problem is that iOS completely bans executing native code that isn’t code signed, with the sole exception of the Safari JIT (and possibly Swift Play
by nneonneo 7y ago
The biggest problem is that iOS completely bans executing native code that isn’t code signed, with the sole exception of the Safari JIT (and possibly Swift Playgrounds - not sure how that works). There’s weird hacks to get around this, e.g. a JIT compiler that compiles native code into ROP chains that jump around gadgets precompiled into your native binary, but otherwise there’s really no way to run arbitrary CPU-native code. Hence, the emulator. And if you have to emulate the CPU, you might as well emulate the most popular CPU for compatibility.
- saagarjha 7y agoSwift Playgrounds has the com.apple.private.amfi.can-execute-cdhash entitlement, which allows it to dynamically load unsigned code.