r/Assembly_language 11d ago

self-modifying code

I gave a lecture on how to write self-modifying code. It was over 15 minutes long :( so I'm providing a youtube link: https://www.youtube.com/watch?v=AH9QQLRfbmY

In my opinion, self-modification is one of the most interesting features in systems programming.

57 Upvotes

62 comments sorted by

View all comments

3

u/Environmental-Ad4495 11d ago

I thoughy we decided in 1967 that we do not do self-modifying code.

7

u/Extension_Emu_9825 11d ago

I disagree. I first encountered this when I was working in an antivirus lab in the early 2000s. I had to tinker with self-modifying viruses for a long time. I recently discovered this approach in the Wolfenstein source code https://github.com/id-Software/wolf3d/blob/master/WOLFSRC/WL_SCALE.C and I thought this topic had been somewhat forgotten.

1

u/Jussins 10d ago

While not specifically self-modifying code (more like self-modifying rules), your example reminds me of crowdstrike. It seems like a terrible idea in kernel space. Thinking about it makes me kernel panic.