Arbitrary code execution

From Glitch City Wiki
Revision as of 09:59, 4 April 2015 by >ISSOtm (** UNFINISHED ** Created the page with explanations on how to pull of the glitches)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Arbitrary code execution refers to a method that allows the player to force the game to run code written by the player.

It usually uses an invalid execution pointer (glitch items in Generation I, an incorrectly terminated string in English Pokémon Gold and Silver), which the player can manipulate to run custom assembly code.

This custom code is often spelled with items, as a stack of items uses only two bytes.

In Generation I

Via Items

Both items require a special setup for the item to run correct code.

Using 8F (Red/Blue)

The player's party must be in a certain order :

Using "ws m" (Yellow)

The Pokémon in the current PC box must be in a certain order for the instruction pointer to be redirected to

Via ZZAZZ Trainer hex:FC

Video by TheZZAZZGlitch

This method will make the ZZAZZ trainer hex:FC (encountered via the Trainer escape glitch) to run code based on ???

In Generation II

Main article: Coin Case glitch

The English versions of Pokémon Gold and Silver use a hex:57 character as a terminator for the Coin Case's "Coins: (x)" text, like in the Japanese versions.

While this is a valid control character for the Japanese version, it isn't for the English versions, causing the game to jump into the memory at echo RAM address E112 and execute code there.