How Games Are Reverse-Engineered to Run in a Browser

· 5 min read

A game runs in a browser tab because someone turned its code into something a browser can execute. There are three usual routes: decompilation, a source port or reimplementation, and emulation. All three finish in the same place, with C or C++ compiled to WebAssembly and drawn through WebGL or WebGPU.

Decompilation: rebuilding the source until it matches the ROM

A decompilation starts with a finished game binary and works backwards. The team splits the ROM into functions, gives them readable names, rewrites each one in C, and compiles the result. The test is brutal: the rebuilt ROM has to match the original byte for byte. The Super Mario 64 decompilation ships builds for five releases and lists the SHA1 hash each one must produce.

The same repository explains the catch that shapes this whole world: it "does not include all assets necessary for compiling the ROMs. A prior copy of the game is required to extract the assets." Code can be rebuilt from analysis. Art, music and level data cannot, so they get pulled from a copy you already own.

Super Mario 64's decompilation led to an unofficial PC port in 2020, which Nintendo had removed with copyright complaints within days, as GameSpot reported. The code survived. The download links did not.

The Ocarina of Time decompilation is a slower, still unfinished version of the same idea. It says it "is not producing a PC port"; separate projects use that work. One of them, Ship of Harkinian, states that "The Ship does not include any copyrighted assets. You are required to provide a supported copy of the game."

Source ports and reimplementations: new code, same behaviour

A source port takes engine code and makes it run somewhere new. A reimplementation writes fresh code that behaves like the original, sometimes without looking at the original source, which is where the term clean room comes from.

The re3 and reVC projects reverse-engineered the code behind GTA III and Vice City so modders could build on it. GamesIndustry.biz reported that a DMCA notice attributed to Take-Two appeared on the repositories in 2021, and noted one reason the project was exposed: it "did use PC game assets, so players needed to own a copy of GTA 3 in order to use it." The browser version of Vice City on browsergame.si is the descendant of that work.

Other long-running examples:

  • DevilutionX is "a port of Diablo and Hellfire" that needs DIABDAT.MPQ from your own copy, or the free shareware spawn.mpq. That is how Diablo can run in a tab today.
  • OpenRCT2 calls itself an "open source re-implementation of RollerCoaster Tycoon 2" and needs "the object files (containing graphics, sounds and models) from the original" game.
  • Xash3D FWGS is an engine built to stay compatible with Half-Life. The browser Half-Life loads the game from a zip of your own files, so the engine travels and the content does not.

Emulation: bring the whole old machine

Emulation skips the rewrite. You build a virtual 486 or PlayStation in software, load the original game into it, and let the game run unchanged. In a browser that means an emulator compiled to WebAssembly.

DOSBox is the classic DOS emulator, and js-dos wraps emulators in a browser player with a small JavaScript API. The js-dos documentation shows it mounting remote disk images from dos.zone over a WebSocket drive, which is how a site can serve a large DOS game without stuffing it into one download. That route is why the original 1993 Doom and Fallout can run as the DOS releases rather than as reconstructions.

Emulation is the most faithful option and the least flexible.

From C++ to the tab: Emscripten, WebAssembly, WebGL and WebGPU

Nearly every route ends at the same toolchain. Emscripten "is a complete Open Source compiler toolchain to WebAssembly" that turns C and C++ into WebAssembly using LLVM, plus a little JavaScript to connect it to the page. It also supplies the pieces games expect, including SDL2 for input and audio and OpenGL ES style graphics calls.

WebAssembly is the target: "a binary instruction format for a stack-based virtual machine", designed as a portable compilation target and run inside a sandbox that follows the browser's security rules.

Drawing is the other half. WebGL is a JavaScript binding to OpenGL ES 2.0 and has been around since 2011. WebGPU is its successor, with better access to modern GPUs, cheaper draw calls and compute shaders. The newest browser ports, including Skate 3, require WebGPU.

Browsers still have limits that show up in ports. A page cannot open a raw UDP socket, so browser multiplayer gets tunnelled over WebSockets, usually through a small relay server.

Why some ports need your own game files

The split is always code versus content. A port ships its own engine code, not the textures, models, music and levels that make the game recognisable, so it reads those from a file you supply.

That is the whole reason Super Mario 64 wants a baserom, OpenRCT2 wants RCT2 object files, Ship of Harkinian wants a supported ROM, and DevilutionX wants an MPQ. Some projects go further and avoid shipping anything retail at all: Clean Room Skate Online runs the Skate 3 Rust engine with a pack where every texture, sound and mesh was regenerated.

If a fan port asks for a file from a game you own, that is the normal pattern. If a site asks for your password, your card, or a "launcher" download, close the tab.

The 2026 wave: AI made decompilation faster

The recent burst of browser ports is not a coincidence. Polygon puts it simply: a new version of Claude means "modders can decompile games ... much faster than before", and AI tools help with the port itself. Halo: Combat Evolved was decompiled for the first time, and its browser build drew nearly 20,000 plays in five hours, according to TechPowerUp.

Faster is not the same as better. As Polygon notes, AI-assisted ports are more likely to be buggy. Speed also makes it easier to ship a project built on copied assets, and Activision took the Call of Duty browser ports down within days of them going viral. You can still find the surviving zombies project on the Black Ops Zombies game page.

FAQ

This is not legal advice. The practical pattern is that ports which require your own game files keep the original content out of the download, and that publishers still decide whether a project stays up. Nintendo, Take-Two and Activision have all been linked to takedowns at different points.

Do I need a powerful PC to play a game in a browser?

For DOS emulation, almost anything works. For WebAssembly and WebGPU ports, you need hardware acceleration turned on in Chrome or Edge and a reasonably recent graphics chip.

Why does a browser port take so long to load?

Two reasons: the engine and assets download, and shaders compile for your GPU. Big 3D ports often load a data pack before the first frame, so the first visit is the slowest.

Can I play these on a phone?

Sometimes. Games with touch controls, like Heroes of Might and Magic II, work well. Heavy 3D ports usually expect a keyboard and mouse or a controller, and some will not run at all on mobile browsers.

More articles