The Self-Modifying Game
Back in the good old days, we programming cowboys had a trick that's seldom used these days: self-modifying code. One segment of code re-wrote another segment of code. This was frowned upon because it made debugging particularly difficult. How could you tell where the problem was arising if you couldn't know which version of the code was actually executing?
Nevertheless, there were some situations in which self-modifying code was useful. One of these was anti-piracy. If self-modifying code was difficult for the programmer to debug, imagine how tough it would be on a pirate! I used that trick twice, and I still smile at the thought of some poor teenage geek running through code, trying to figure it out, and then encountering ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access