500B Tokens in AI Decompilation: A First-Person Shooter's Transformation 🎮
An in-depth look at the decompilation of a first-person shooter using AI agents, highlighting the challenges and successes of the project.
Project Overview
Over the past three months, a team of developers, including RektInator, Future, st0rm, and others, have been working on decompiling a popular first-person shooter game. The objective was not just a proof-of-concept but a full, accurate, and stable recreation of the game.
The project aimed at an accurate decompilation of the game to C++, focusing on readability, security, bug fixes, and portability. The team used AI agents, Claude Max, Codex Pro, and other models, orchestrating them over months to achieve their goals.
AI Orchestration and Infrastructure
The AI agents, running on Claude Code CLI and Codex CLI, managed GitHub issues to track progress. They communicated via Discord, allowing for agent-to-agent and human-to-agent interaction. GitHub webhooks were used to post CI failures into the shared channel, notifying agents of issues.
The team used the ida-mcp by Hex-Rays for decompilation, which was found to be stable and headless, supporting all needed features for the project.
Decompilation Progress and Challenges
The agents managed to decompile about 80% of the game, achieving visible progress like launching the game, displaying the main menu, and loading maps. However, the quality of the decompilation was not as great as initially believed, with semantic errors and unnecessary architectural changes introduced by the agents.
Optimizing the Setup
The team optimized their setup by reducing token consumption and addressing agent focus issues. They implemented a document defining the goal, how agents should work, what they must avoid, and how to handle specific situations. This document was regularly injected into the agents' context to maintain focus.
Verification Harness and Automated Checks
To ensure the accuracy of the decompilation, the team developed a verification harness that compared the reconstructed functions with the original game's EXE/PDB files. This harness, which uses byte matching decompilation, has significantly improved the quality of the work and allowed for the use of cheaper, less capable models.
“Precise instructions are necessary. Agents have the desire to cheat if the assignment leaves room for interpretation.”
— Project Lead