Re: Arbitrary code execution in Red/Blue using the "8F" item
Posted by: Yeniaul
Date: 2017-02-15 20:09:54
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.
any item/ws# #m#
any item/ws# #m# (one of these has to be ws# #m# obviously)
TM50 x186
TM10 x3 (works with 64, but 3 should too)
TM34 x93
TM09 x35
Poké Ball x52
X Accuracy x44
Great Ball x52
TM01 x[any qty]
any item/ws# #m#
any item/ws# #m#
Lemonade x89
Repel x12
Carbos x 211 (Should work even if you remove this item)
X Accuracy x94
Water Stone x115
TM01 x(any)
Super-compressed 3-Pokémon setup (problematic because of hex D3 glitch Pokémon, which can be difficult to obtain; also, some item lists do not work with this setup)
[tt]1. Exactly 6 Pokémon in the party [0xD163 = 0x06]
2. Hex C3 glitch Pokémon as the first Pokémon [0xD164 = 0xC3]
3. Onix as the second Pokémon [0xD165 = 0x22]
4. Hex D3 glitch Pokémon as the third Pokémon [0xD166 = 0xD3][/tt]
WRA1:D163 06 C3 ld b, 0xC3
WRA1:D165 22 ld (hl), a
WRA1:D166 D3 <Invalid Opcode>
WRA1:D163 03 inc bc
WRA1:D164 C3 22 D3 jp 0xD322
WRA1:D163 04 inc b
WRA1:D164 C3 22 D3 jp 0xD322
WRA1:D163 05 dec b
WRA1:D164 C3 22 D3 jp 0xD322
8F / first item (Depends on the script)
8F / second item (Depends on the script)
X Accuracy x34
Carbos x211
<Script>
HL contains D322
D322: CB 8D
D324: 34 / 35
D325: C9
D322: RES 1, L
D324: INC (HL) / DEC (HL)
D325: RET
*-------*
|D000 XX|
|D001 XX|
|D002 XX|
*-------*
What would be the fastest/easiest way to get a working 8F setup starting from a brand new save file?
I'm guessing it would start out like the standard speedrun route (Brock thru walls to Saffron, encounter missingno via Trainer Fly with Abra, then item underflow) but then use the underflow to obtain 8F instead… Then what would be the optimal way to get all the pokémon required for the bootstrap? Regular encounters, or trainer fly?
ldd a, (hl)
ldd a, (hl)
ldi (hl), a
inc b ; filler
ld (hl), 1
dec (hl)
inc b ; filler
ret
Dire Hit x58
Water Stone x4
Max revive x1
Revive x4
TM01 x[Any qty]
ld a, [hli]
ld [hld], a
8F
[item] x(Any)
Dire Hit x4
Max revive x1
Revive x4
TM01 x[Any qty]
8F
Item x[any qty]
Poké Ball (or Great Ball) x43
Revive x3
TM01 x[any qty]