User:MrMissingNo72/Item 0x6B arbitrary code execution

From Glitch City Wiki
Jump to navigation Jump to search

Item 0x6B executes CD35 when used, so it's better than 8F (0x5D) and 'd m (0x65). Before you use item 0x6B, make sure the bytes (C3, 22, D3) are at CD35.

Gameshark-like code

  1. Item 0x6B, any
  2. Master Ball, x99
  3. X-Accuracy, x(b2)
  4. Carbos, x(b3)
  5. Lemonade, x(b1)
  6. Item 0x77, x201

ASM instructions:

  • ld l, (b2)
  • ld h, (b3)
  • ld a, (b1)
  • ld [hl], a
  • ret

Example - 011559D0

  • ld l, 59
  • ld h, D0
  • ld a, 15
  • ld [hl], a
  • ret