Games

Hacker Exploits Bugs In Original ‘Doom’ Code to Run ‘Snake’ Inside the Game

By exploiting a bug in the way Doom 2 and Ultimate Doom load saved games, a programmer has found a new technique to run custom code inside of Doom.
Screen Shot 2021-03-29 at 4

For years, people have found ways to play the classic 1990s game Doom on anything from McDonald's cash registers, to billboard trucks, and even iPhone hacking devices

Now, a programmer has flipped the script, putting the classic game Snake inside Doom

The programmer, who goes by kgsws, said he was able to sneak a snake made of little skulls into Doom by finding a vulnerability in the way Doom 2 and Ultimate Doom load saved games, which allowed him to run custom code inside the game. 

Advertisement

Kgsws published this inventive project on GitHub, meaning anyone can download and run it, provided they have a computer with the old operating system DOS or a DOS emulator. What's more, the programmer also published techniques on how to exploit two other bugs that allow hackers and programmers to customize and modify Doom in several different ways. 

"I was playing with Doom source code for a long time already so I already knew a lot about Doom engine. Since source code is available, there are many source ports for modern platforms. Those source ports added many cool features. Before that, there were only limited ways you could modify the game," kgsws told Motherboard in an online chat. "One day I was wondering what would it take to add some new features to the original DOS version, but without modifying it. Something that would allow anyone to hide new features."

Do you hack or reverse engineer video games? We’d love to hear from you. You can contact Lorenzo Franceschi-Bicchierai securely on Signal at +1 917 257 1382, OTR chat at lorenzofb@jabber.ccc.de, or email lorenzofb@vice.com

And to demonstrate his findings, he chose Snake. 

"I wanted to make the Snake with a twist. I know it was already done. But if you imagine Snake, you might expect [it] to move in four different directions. In my code you have to steer the snake like a car," kgsws said. 

Advertisement

Kgsws is the creator of the ACE Engine, a project to customize and modify Doom 2 by exploiting bugs in it. 

You can see how kgsws's Snake runs inside Doom in the video below. 

The programmer explained that he also found ways to exploit map files, and the way Doom allocates memory. 

Anatoly Shashkin, a YouTuber who is passionate about DOS games and who recorded the video above, said that he's excited about kgsws's project because it can help others find more exploits or ways to modify Doom.  

"The exploit is wonderful," Shashkin told Motherboard in an online chat. "I believe it opens up quite a lot of opportunities for vanilla Doom modding. It's essentially limitless." 

Subscribe to our cybersecurity podcast CYBER, here.