Glitch City Laboratories Archives

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.

Arbitrary Code Execution Discussion

Increment a byte in RAM: Crash (Pokémon Blue) - Page 1

Increment a byte in RAM: Crash (Pokémon Blue)

Posted by: NunoLava1998
Date: 2016-04-24 11:05:59
I found that, in RAM at FF80 (Pokémon Blue), incrementing the first byte by 1 will crash the game. But, if you increment the first 3 bytes, some stuff dissapears.



That's how sensitive Pokémon Blue is. Yep.

Re: Increment a byte in RAM: Crash (Pokémon Blue)

Posted by: Spoink
Date: 2016-04-24 12:49:21
FF80 is actually part of the ROM that is mostly the same in all gb games

Re: Increment a byte in RAM: Crash (Pokémon Blue)

Posted by: NunoLava1998
Date: 2016-04-26 06:01:00
Also, at FF80, if you change the 9th byte to FF, the game will crash. For some reason, FE and below doesn't crash the game. But FF just crashes the game for no reason.

Re: Increment a byte in RAM: Crash (Pokémon Blue)

Posted by: Spoink
Date: 2016-04-26 15:34:05

Also, at FF80, if you change the 9th byte to FF, the game will crash. For some reason, FE and below doesn't crash the game. But FF just crashes the game for no reason.

0xFF actually calls ROM address $0038, which is an 0xFF opcode. You can see why it crashes.

Re: Increment a byte in RAM: Crash (Pokémon Blue)

Posted by: NunoLava1998
Date: 2016-04-27 02:04:04
And in 0040, if you replace the first byte with FF the game crashes.

And it didn't say "Unknown opcode FF at 0038", it just went to that line type of crash.

Re: Increment a byte in RAM: Crash (Pokémon Blue)

Posted by: Ketsuban
Date: 2016-04-27 02:53:05
Because opcode ff is known it's rst $38. And what's at 0038? Always ff. So the stack floods with an unending deluge of 39.

Re: Increment a byte in RAM: Crash (Pokémon Blue)

Posted by: ISSOtm
Date: 2016-04-27 17:26:24
Literally unending. (Hopefully the values written to ROM don't enable SRAM edition, otherwise… meh)

(Fake) hysterical time : Why didn't they just put a simple ret there ? Aw yeah, I forgot how many glitches exist in Gen I games thanks to wonderful programming. They should get a special award for these. I love these games : "Sup guyz, for the first three champions the data structure {beaten, TM got} is this one" "But I want this completely different one now !" "Okay, but I'm too lazy to change back the previous."

Re: Increment a byte in RAM: Crash (Pokémon Blue)

Posted by: Stackout
Date: 2016-04-27 17:53:39

(Fake) hysterical time : Why didn't they just put a simple ret there ?


probably they had a breakpoint set there when debugging.

Re: Increment a byte in RAM: Crash (Pokémon Blue)

Posted by: ISSOtm
Date: 2016-04-28 01:24:58
Makes no sense to me, but maybe…