This PDF contains a playable copy of Doom – Ars Technica
Adobe Acrobat’s little-used JavaScript support gets exploited in Chromium browsers.
Here at Ars, we’re suckers for stories about hackers getting Doom running on everything from CAPTCHA robot checks and Windows’ notepad.exe to AI hallucinations and fluorescing gut bacteria. Despite all that experience, we were still thrown for a loop by a recent demonstration of Doom running in the usually static confines of a PDF file.On the Github page for the quixotic project, coder ading2210 discusses how Adobe Acrobat included some robust support for JavaScript in the PDF file format. That JS coding support—which dates back decades and is still fully documented in Adobe’s official PDF specs—is currently implemented in a more limited, more secure form as part of PDFium, the built-in PDF-rendering engine of Chromium-based browsers.In the past, hackers have used this little-known Adobe feature to code simple games like Breakout and Tetris into PDF documents. But ading220 went further, recompiling a streamlined fork of Doom’s open source code using an old version of Emscripten that outputs optimized asm.js code.With that code loaded, the Doom PDF can take inputs via the user typing in a designated text field and generate “video” output in the form of converted ASCII text fed into 200 individual text fields, each representing a horizontal line of the Doom display. The text in those fields is enough to simulate a six-color monochrome display at a “pretty poor but playable” 13 frames per second (about 80 ms per frame).Despite its obvious limitations in terms of sound and color, PDF Doom also suffers from text-field input that makes it nearly impossible to perform two actions simultaneously (i.e., moving and shooting). We also have to dock at least a few coolness points because the port doesn’t actually work on generic desktop versions of Adobe Acrobat—you need to load it through a Chromium-based web browser. But the project gains those coolness points back with a web front-end that lets users load generic WAD files into a playable PDF.Critical quibbles aside, it’s a bit wild playing a game of Doom in a format more commonly used for viewing tax documents and forms from your doctor’s office. We eagerly look forward to the day that some enterprising hacker figures out a way to get a similar, playable Doom working on the actual printed PDF page that comes out of our printers.Ars Technica has been separating the signal from
the noise for over 25 years. With our unique combination of
technical savvy and wide-ranging interest in the technological arts
and sciences, Ars is the trusted source in a sea of information. After
all, you don’t need to know everything, only what’s important.
Source: https://arstechnica.com/gaming/2025/01/this-pdf-contains-a-playable-copy-of-doom/