Reverse Engineering Galaga To Fix The No-Fire Cheat

We didn’t know there was a cheat to Galaga, but [Chris Cantrell] did. And so he did what any curious hacker would do — reverse-engineer the game to diagnose and eventually fix the bug.

Spoilers ahoy! Go read the website first if you’d like to follow [Chris]’s reversing efforts in the order that they actually happened.

The glitch is triggered by first killing most of the bees. When only six are left, they go into a second pattern where they swoop across the screen and wrap around the edges. While swooping, sometimes the bees will fire a shot when they’re at coordinates with X=0. Now two facts: there’s a maximum of eight missiles on the screen at any given time, and the position X=0 was reserved by the software to hide sprites that don’t need updating.

The end result is that eight missiles get stuck in a place where they never drop and don’t get drawn. No further shots are fired in the entire game. You win.

So that’s the punchline, but everyone knows that a good joke is in the telling. If you’re at all interested in learning reverse engineering, go read [Chris]’s explanations and work through them on your own.

And here’s our generic plug for Computer Archaeology:

Ancient video games run on MAME or similar emulators are the perfect playground for learning to reverse engineer; you can pause the machine, flip a bit in memory, and watch what happens next. Memory was expensive back then too, so the games themselves are small. (It’s not like trying to reverse engineer all however many jiggabytes of Microsoft Office.) The assembly languages for the old chips are small and well-documented, and most of the time you’ve also got a good dissasembler. What more could you ask for?

A walkthrough tutorial?  We’ve just given you one.

Oh and PS: If you get past level 255, the game freaks out.

13 thoughts on “Reverse Engineering Galaga To Fix The No-Fire Cheat

    1. Super old! Like early 2000’s.

      I actually double-triple checked that we’d never run a story on Computer Archaeology before, but we hadn’t and it’s still a great introduction to real reverse engineering in a mini-sandbox. So I wrote it up.

      Is everything new awesome? Is everything awesome new?

  1. This is a prime example and nice overview and education of how to fix something without the source code. This is real software hacking that just is not as common anymore except in the Car hacking world. A lot of automotive ECM’s were reverse engineered like this.

  2. This trick doesn’t always work … I waited 20 mins last night and it didn’t kick in … but I’ve had it work many times before.

    Based on the description of the programming, it requires both bees to fire while off screen? So if the bees aren’t synced up in their path of travel that’s never going to happen.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.