← Wed, Nov 11 digest

Show HN: Black Ops II statically recompiled to native ARM64 macOS

read article ↗ hn thread ↗

Call of Duty: Black Ops II has been statically recompiled from 32-bit x86 Windows to native ARM64 macOS using Remill and custom LLVM passes, running at 60 FPS without Wine or Rosetta.

read it Provides deep technical insight into static binary recompilation, LLVM IR lifting, and running complex Windows games natively on Apple Silicon.

summary

An independent developer statically recompiled Call of Duty: Black Ops II into a native ARM64 macOS app, bypassing Wine, Crossover, and Rosetta 2. The pipeline lifts x86 binaries to LLVM IR using Remill, applies custom optimization passes, and links them against a custom Win32 runtime and a D3D11-to-Metal translation layer. Running on a base Apple M1, the campaign, zombies, and bot multiplayer achieve 51 to 60 frames per second. The project also implements clean-room match rules and handles copy-protection mechanics via a small integrated x86 interpreter.

key points

  1. Remill lifts 150,000 x86 functions to LLVM IR, followed by custom passes to inline memory access, promote the x87 stack, and convert lock sequences to hardware atomics.
  2. Win32 APIs are replaced with a hand-written runtime, routing Direct3D 11 calls to Metal via a custom fake-COM layer and HLSLcc for shaders.
  3. Copy protection integrity checks are executed safely by running encrypted heap code and un-lifted segments through an integrated Unicorn-based x86 interpreter.

who should read it

Systems engineers, reverse engineers, and developers interested in binary translation and Apple Silicon graphics pipelines.

discussion warm

consensus

Commenters express strong admiration for the technical achievement and the rapid development enabled by AI tooling, while debating the technical definitions of emulation versus static recompilation.

pushback

A few critics argue the project documentation lacks clear motivations and direct performance comparisons against existing translation methods.

best comment by adrbn ↗

Yes, it uses two already existing tools for the heavy lifting. Remill lifts the x86 machine code to LLVM IR, and LLVM then compiles that IR to ARM64. And no, nobody translates the assembly by hand luckily, not me nor the agent. All of these 150k functions go through this automatic chain I explained before.

What I wrote with Claude is basically everything else: custom LLVM passes, a hand-written runtime that replaces the Windows calls, a Direct3D 11 to Metal layer and the shader translation! Plus fixing the crashes one by one by iterating and playing. All details are in the Pipeline section …

The author clarifies the exact division of labor between standard lifting tools and AI-assisted custom passes and runtimes.

Generated by an LLM from the article and thread. Check the sources before relying on it.