Re: Arbitrary code execution in Red/Blue using the "8F" item
Posted by: Krys3000
Date: 2016-03-27 13:04:04
Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.
You can join Glitch City Research Institute to ask questions or discuss current developments.
You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.
Im relatively new to this whole arbitrary code execution thing but i am looking into figuring out how to work with it on a larger scale. By larger scale, I mean the whole TheZZAZZGlitches' Pong in Pokemon Blue and Torchicken's rewritting of Pallet town to look like Twinleaf town. How reasonable would it be to apply those methods of writing arbitrary code in Pokemon Yellow, given that the bootstrapping code is already written using the PC box? Is there a setup that is optimal enough to leave a significant amount of memory space in the current box to do such code writing?
; Initial hl = DA7F
$DA7F <- 03 || inc bc
$DA80 <- 18 24 || jr DAA6
$DAA6 <- 26 D3 || ld h, D3 ; h = D3
$DAA8 <- 2E 21 || ld l, 21 ; l = 21
$DAAA <- E9 || jp [hl] ; hl = D321
; Initial hl = D163
$D163 <- 06 xx || ld b XX
$D165 <- 18 65 || jr D1CC
$D1CC <- 2E 49 || ld l, 49 ; l=49
$D1CE <- 26 DA || ld h, DA : h=DA
$D1D0 <- 36 26 || ld (hl), 26
$D1D2 <- 2C || inc l ; l=4A
$D1D3 <- 36 D3 || ld (hl), D3
$D1D5 <- 2C || inc l ; l=4B
$D1D6 <- 36 2E || ld (hl), 2E
$D1D8 <- 2C || inc l ; l=4C
$D1D9 <- 36 22 || ld (hl), 22
$D1DB <- 2C || inc l ; l=4D
$D1DC <- 36 E9 || ld (hl), E9
$D1DE <- C9 || ret
; Initial hl = DA47
$DA47 <- 00 || nop
$DA48 <- 00 || nop
$DA49 <- 26 D3 || ld h, D3 ; h=D3
$DA4B <- 2E 22 || ld l, 22 ; l=22
$DA4D <- E9 || jp [hl] ; hl = D322
Just did it, although and admin's approval (usually torchicken's) is required for the change to appear.
Ever thought Tentacool could jump ? No ? YOU WERE SO WRONG.
That method you created is cool, but looks quite heavy to set up (c'mon, ID = DA36 ?)
Also, have you tried to use the game's copying routine ?
It is called CopyData in Pokéred, but I can't remember its ROM address.
The problems comes from that we cannot easily create Pokémon like that. We'd need easier methods of arbitrarily placing data wherever we want, but also simpler to set up.