arstechnica.com
Because we can This PDF contains a playable copy of Doom Adobe Acrobat's little-used JavaScript support gets exploited in Chromium browsers. Kyle Orland Jan 15, 2025 11:45 am | 45 Have you ever fired a BFG in a PDF? Credit: Ading2210 Have you ever fired a BFG in a PDF? Credit: Ading2210 Story textSizeSmallStandardLargeWidth *StandardWideLinksStandardOrange* Subscribers only Learn moreHere 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 supportwhich dates back decades and is still fully documented in Adobe's official PDF specsis 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). Zooming in shows the individual ASCII characters that make up a PDF Doom frame. Credit: Ading210 Zooming in shows the individual ASCII characters that make up a PDF Doom frame. Credit: Ading210 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 Acrobatyou 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.Kyle OrlandSenior Gaming EditorKyle OrlandSenior Gaming Editor Kyle Orland has been the Senior Gaming Editor at Ars Technica since 2012, writing primarily about the business, tech, and culture behind video games. He has journalism and computer science degrees from University of Maryland. He once wrote a whole book about Minesweeper. 45 Comments