It seems like every day there's a new thing that people are getting to run
Doom. It's such a lightweight game, but still fun to play, and it's easy to get running in many things, even a scientific calculator. Additionally it's old enough that there are exploits in it that make it easy for lots of custom and arbitrary code execution.
Well, YouTuber kgsws has decided that we don't have enough
Doom in our lives. So, they decided to show that it is possible to run
Doom from within the game itself. Kgsws points out during the YouTube video that he ultimately found the method of loading arbitrary code in a function that loads objects into the game. The reason it works is because there's no validation as to what the game object that is expected to load. This means just about any file of any file type can be potentially loaded into the game engine using the level object loading code.
YouTube Video of Doom running in Domm
Through the video a few other bugs and odd behaviors are also explored. For example, item pickup is actually related to the texture applied to the object loaded into the level, not the object ID. This means you can decide to load a differing object even after the level loads. So lets say you load a cacodemon texture on top of the rocket launcher ammunition. Well, if you do that, the cacodemon has no behavior because the game still thinks it's the rocket launcher object. However, because pickup relies on texture, you cannot pick up the cacodemon as a rocket.
Of course, loading
Doom into
Doom is not, technically, new, as we've seen id Software, and now Bethesda, load
Doom, and
Doom II into their newer versions of the game. That said, before today we had never seen
Doom II running in
Doom II. The
Doom source code was released to the public 11 years ago by id Software, and there have been dozens of derivatives since then. This particular instance uses one called
Chocolate Doom.
Heretic running in Doom
Additionally, because of the fact that this is arbitrary code execution,
kgsws also decided to show that they could load another classic first person game, Heretic, into Doom. So now it's possible to play
Heretic, or potentially
Hexxen in
Doom or
Doom II. Maybe one day we'll see
Crysis run in
Crysis. Though according to kgsws running
Doom in
Doom requires double the memory, so make sure you have at least 16MB of RAM available.