Hooking keyboard input to play Snake in Notepad.exe (2020)
kylehalladay.com
kylehalladay.com
[1] https://www.reddit.com/r/programming/comments/gnazif/ray_tra... (I've first seen this from Steve Klabnik's tweet https://twitter.com/steveklabnik/status/1263190719721766918)
I think the first place I encountered this sort of thing in notepad was http://thesiteformerlyknownas.zachtronicsindustries.com/note...
ExecuteRemoteThread() does what it's name says, copying RemoteThread to cmd.exe, and running it. The rest of the code is about getting pointers to a few WinAPIs that are used in a safe way, and dancing around not having a CRT that can be sanely used inside of cmd.exe.
https://twitter.com/neilsardesai/status/1379185826920300545?...
For those of you who don't know it, it's a rather obscure and in some ways delightfully refreshing game, albeit populated by unsavory players worth of the Mos Eisley cantina quote taken at its face value. It's based on two things, physics-based movement and the prisoner's dilemma split three-ways.
"Deal-making, deal-breaking, and the occasional high-speed car chase." And of course, having to walk up to a computer and type MS-DOS commands to play snake. The developer plans to make the game's computer a "full 6502 or Z80 emulation so players can write their own games."
1997 is actually later than I would've thought.