Skip to content

Instantly share code, notes, and snippets.

@ISSOtm
ISSOtm / cartswap.md
Last active November 25, 2023 12:57
Swapping GB carts from the Game Boy to our advantage

The beauties (and crashes) of CartSwap

CartSwap (Cartridge Swapping) is a technique that allows ACE in any Game Boy game, even before the game has actually booted up! Example applications include :

  • Spoofing consoles (Pokémon Crystal can run on the Gray Brick!)
  • Speedrunning games quicker than a TAS
  • Gaining ACE on games that are otherwise ACE-less
"""
This file contains code that, when run on Python 2.7.5 or earlier, creates
a string that should not exist: u'\Udeadbeef'. That's a single "character"
that's illegal in Python because it's outside the valid Unicode range.
It then uses it to crash various things in the Python standard library and
corrupt a database.
On Python 3... well, this file is full of syntax errors on Python 3. But
if you were to change the print statements and byte literals and stuff: