Hello,
After reading this wikipedia article :
http://en.wikipedia.org/wiki/Self-modifying_code
I am wondering if this technique has been done on iPhone.
Thanks
Thierry
Hello,
After reading this wikipedia article :
http://en.wikipedia.org/wiki/Self-modifying_code
I am wondering if this technique has been done on iPhone.
Thanks
Thierry
Not allowed by apple, and I believe it's physically prevented, the code space can't be modified, and code cannot run from the data space. (Jailbreaking could fix this however)
A standard iPhone application is unable to set a memory page as executable. So, it's impossible to modify your own code or generate code at runtime (ie.: Just In Time compilation).
A jailbroken device will allow you to have such pages though.
Three things that are most trecherous:
Connectors that corrode
Recursive algorithms
And self modifying code
-- traditional programmer's chanty
Self modifying code is the easiest and surest way to make code behavior completely unpredictable. It's something that is interesting academically but it is seldom a practical tool.
As near as I can tell, it's primary use is to wreak vengeance on an employer when you know you're going to be fired.