hn.today

C64 Mercenary: a novel exploit bug in a 41-year-old game

gamesexplained.com4 points1 comments
Screenshot of C64 Mercenary: a novel exploit bug in a 41-year-old game

A deep reverse-engineering of the Commodore 64 game Mercenary documents how the engine streams and renders the city of Targ one building at a time and uncovers a novel exploit: an invisible 1,024‑unit square of grass near the landing site answers the E key as if it were the Colony Craft’s lift because the lift test checks square and mid‑bytes of X/Y but never reads height. That logic lets a player press E on the patch to enter hangar room 8 and then return to the deck at altitude 64,997; the elevator routine adds a fixed height offset when it reaches surface. The writeup explains when models are loaded (only squares 0-15 on each axis), how buildings pop in when the high byte of X or Y changes, roads appear above height 2,048, and how underground rooms are separate boxes with locked doors, so the exploit is gated but usable.

Beyond the city, the world is a 256×256 grid of 65,536‑unit squares; a few objects sit in the wasteland (two external lifts, a pyramid, a mast). One NPC craft - the Palyar commander’s brother‑in‑law’s ship - flies continuously at fixed X (4,287 units west) and altitude 32,769 (ALT 500), advancing Y by 256 per pass so it laps the city forever yet cannot be boarded. Attack behavior and object mechanics are quantified: distant objects plot as a single pixel past 65,536 units, an attack ship adjusts velocity by 1/32 of the distance per pass and overshoots repeatedly, its missile uses 1/16 and is unsteered, and many behaviors are tied to specific object slots and memory routines.

Read on gamesexplained.com1 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Security

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.