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

Arbitrary code execution in Red/Blue using the "8F" item - Page 1

Arbitrary code execution in Red/Blue using the "8F" item

Posted by: TheZZAZZGlitch
Date: 2013-04-25 08:57:48
Newcomers: I highly recommend you read beyond this thread's first post. Thanks to the later posts you will learn how to do the described glitch on Yellow, Japanese Red/Green/Yellow or other international releases.

[size=12pt]WHAT'S 8F?[/size]

8F is a Red/Blue equivalent of JP Red/Green's 5 - an item executing machine code starting from $D163 (Number of Pokemon) upon use. Its hex identifier is 0x5D, despite its hex-like name. 8F is treated by the game as a key item and it can't be tossed away or sold in the mart.

As address $D163 contains re-writeable data, it is possible to redirect the instruction pointer to the item list with relative jumps and easily run arbitrary code just by spelling the opcodes with items. With enough items, one could also make a program that reads key input continuously, writes it somewhere in the RAM and jumps to it after a while, allowing to even run your own homebrew software.

[size=12pt]HOW TO OBTAIN IT:[/size]

[size=12pt]OBTAINING 8F USING ITEM COUNTER UNDERFLOW GLITCH:[/size]

PREREQUISITES:

- Access to any event that removes an item from your inventory (Saffron guards, handing out a fossil in Cinnabar Lab, etc.)
- A following item list:
  Any item x[Any qty]
  X Special x255
  Item you need to give away x1

If you don't have access to any item-removing event, you can still do the "dry variation" of the glitch, by following the steps described here.

EXECUTION:

1. Toss the first item. It should change to X Special x255
2. Continue tossing the first item until the item menu "stops responding"
3. Trigger an event that removes the item from your inventory
4. Now, you should have 255 items with you. Go to the eastmost corner of Celadon City:

[img]http://i34.tinypic.com/2me4qdl.png[/img]

5. Toss 254 of your X Specials. Then swap the 'X Special x1' with 'Nugget x1' (35th item)
6. Try walking to the right - the map should now loop back to the left side of Celadon City. The amount of steps you take to the right determines the item you will get, so position yourself properly to obtain 8F. Swap it with the first item, then fly back to Celadon.
7. Store one of your newly acquired glitch items into the PC. Then buy any 3 items to bring your inventory back to normal.

A video of this method (makes it a lot easier to understand): http://www.youtube.com/watch?v=98_azamLeh4

[size=12pt]OBTAINING 8F USING INVALID ENCOUNTER FLAGS (OBSOLETE):[/size]

PREREQUISITES:

- A Ditto with a Cooltrainer move, nicknamed "R:u"
- At least 1 Escape Rope
- Good Rod on your 4th item slot
- Exactly 10 Pokemon in your current box (this tremendously increases the chances of Cooltrainer move working properly)
- Preferably a Bicycle, to make things a little bit faster.

EXECUTION:

1. Heal your Pokemon in Fuchsia City's Pokemon Center.
2. Do the Safari Zone walk through walls glitch, with only Ditto in your party.
3. After you appear back at the Fuchsia City's Center with noclip activated, walk exactly:
a) 19 steps west
b) 28 steps north
c) 1 step west
d) 29 steps north
e) 11 steps east
4. Open your Pokemon menu and close it (important). You may want to use bicycle now to travel faster - you won't be able to do this later.
5. Go 11 steps west and keep walking south until you find yourself back on Route 18. Do not open your Start menu from now on.
6. Walk/bike to Seafoam Islands and enter the cave.
7. Encounter a wild Pokemon, and continuously try to use the Cooltrainer move. If it does not work after about 15 tries, quit the battle and start a new one. Do not open your Pokemon menu, Item menu or Start menu at all!
8. Eventually, the music will fade out, the move typing will become blank, and name of the opponent will get changed. Catch the resulting Pokemon - the game will state you caught a "98", and your Good Rod will turn into an 8F.
9. Use an Escape Rope, as there's a slight chance the game will crash after exiting the cave normally.

[size=12pt]OBTAINING 8F WITH A CORRUPTED ITEM PACK (OBSOLETE):[/size]

This method is not recommended - it has a lot of side effects and is terribly complicated. Use it only when any other method does not seem to work for you.

PREREQUISITES:

- A Pokemon on the first slot meeting very specific requirements:
    > It needs to have a Super Glitch as a 4th move
> Its three moves besides the Super Glitch have to contain 25 characters in total
> One of its three moves needs to be 4 characters long
> This Pokemon needs to be able to learn Mega Kick through TM05
An example: ?L ||?M 4 (hex C6) with moves Body Slam, TM50, Quick Attack, [Super Glitch]
- Any Pokemon on the second slot you don't care about, nicknamed "cccccccc". It will be gone in the process, so don't use your L100 Charizard.
- A Pokemon on the third slot knowing Fly.
- Exactly 3 useless items in your Bag. They will get destroyed again, so don't pick anything important.
- TM05 (Mega Kick), deposited in the PC
- At least one free space in the PC to store your obtained 8F
- An empty Pokemon box currently selected, most likely box 12

SIDE EFFECTS:

Sadly, those side effects are actually quite annoying. But also, happily enough, one can fix them with 8F's arbitrary code execution.

1. Your player name will become blank (the game will save just fine though). However, with 8F's arbitrary code execution capabilities, one can change his name back to something nice.
2. Lower 5 Pokedex bytes will become corrupted, displaying some yet unseen species as caught. There's no easy way to fix this, but it's not a big deal unless you care about your Pokedex progression.
3. Your Pokemon box may get to a state where trying to release the glitch Pokemon inside will crash the game. This side effect does not happen every time, but if it does, again, this can be fixed with 8F's arbitrary code execution.

EXECUTION:

http://www.youtube.com/watch?v=Sw0h7ImFsAs

[size=12pt]BOOTSTRAPPING:[/size]

8F won't do anything amazing by itself. In order to make it execute code from $D322 (third item), we need to use the party Pokemon to spell out a short program. This program will redirect the instruction pointer to the item pack, so that the effects of 8F become easier to control. This process is referred to as bootstrapping.

There are several bootstrapping configurations that are easier or harder to set up. Below I listed the most commonly used ones.

Pigdevil2010's Pokémon Red/Blue 8F 5-Pokémon 233 HP bootstrap (recommended)

[tt]1.  Exactly 5 Pokémon in the party                                    [0xD163 = 0x05]
2.  Pidgey as the first Pokémon                                      [0xD164 = 0x24]
3.  Parasect as the second Pokémon                                    [0xD165 = 0x2E]
4.  Onix as the third Pokémon                                        [0xD166 = 0x22]
5.  Tentacool as the fourth Pokémon                                  [0xD167 = 0x18]
6.  Kangaskhan as the fifth Pokémon                                  [0xD168 = 0x02]
7.  First Pokémon's current HP has to be exactly 233                  [0xD16D = 0xE9][/tt]

TheZZAZZGlitch's Pokémon Red/Blue 8F 6-Pokémon 233 Attack bootstrap (outdated, but still popular)

[tt]1.  Exactly 5 Pokémon in the party                                    [0xD163 = 0x05]
2.  Onix as the first Pokémon                                        [0xD164 = 0x22]
3.  Pidgey as the second Pokémon                                      [0xD165 = 0x24]
4.  Tentacool as the third Pokémon                                    [0xD165 = 0x18]
5.  Meowth as the fourth Pokémon                                      [0xD166 = 0x4D]
6.  24 PP left on the second Pokémon's second move w/ 0 PP Ups used  [0xD1B5 = 0x18]
7.  21 PP left on the second Pokémon's third move w/ 1 PP Up used    [0xD1B6 = 0x55]
8.  36 PP left on the fourth Pokémon's first move w/ 0 PP Ups used    [0xD20C = 0x24]
9.  24 PP left on the fourth Pokémon's second move w/ 0 PP Ups used  [0xD20D = 0x18]
10. 20 PP left on the fourth Pokémon's third move w/ 0 PP Ups used    [0xD20E = 0x14]
11. Double Team as the fifth Pokémon's first move                    [0xD223 = 0x68]
12. Double Kick as the fifth Pokémon's second move                    [0xD224 = 0x18]
13. Strength as the fifth Pokémon's third move                        [0xD225 = 0x46]
14. Sixth Pokémon's attack stat has to be exactly 233                [0xD26C = 0xE9][/tt]

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]

There are other versions of the game (Yellow and foreign language localizations of R/B) where items similar to 8F exist. Most notable is the 'ws m' item in Yellow, which executes code starting from the current PC Pokémon storage box. For your convenience, here are several bootstrapping setups for Yellow:

Pigdevil2010's Pokémon Yellow 'ws m' 10-Pokémon 233 HP bootstrap (recommended)
TheZZAZZGlitch's Pokémon Yellow 'ws m' 20-Pokémon 233 HP bootstrap (also recommended, since a lot of the Pokémon on the list are Geodudes and Slowpokes, which are easy to catch)
Pigdevil2010's Pokémon Yellow 'ws m' 19-Pokémon bootstrap

[size=12pt]USING 8F TO OUR ADVANTAGE[/size]

Well, now we're done with all those preparations, let's try to actually do something with this item! Below I present some examples of what is possible.

[size=12pt]"CATCH 'EM ALL" SCRIPT[/size]

This is just K)ry's ASM for JP Red/Green ported on the international release. With those items, 8F will act like an item that forces a Pokemon encounter based on the quantity of item #1, allowing to catch all 151 Pokemon easily.

Video: http://www.youtube.com/watch?v=Sw0h7ImFsAs#t=782s

ITEM LIST (starting from the first slot):
[tt]* Preferably Master Balls
* 8F
TM50                x31
TM11                x4
TM34                x89
TM08                x201[/tt]

ASM:
WRA1:D322 FA 1F D3        ld  a,(D31F)
WRA1:D325 04              inc  b
WRA1:D326 EA 59 D0        ld  (D059),a
WRA1:D329 C9              ret 


[size=12pt]ALTERNATIVE CATCH 'EM ALL[/size]

This version of the Catch 'Em All script requires more items, but gives the Pokemon instead of forcing an encounter (like: BLUE got EEVEE!), and allows for getting normally unobtainable glitch Pokemon without trading. The given Pokemon depends on the quantity of the 3rd item.

Remark: Avoid obtaining Missingno with this method. It will duplicate your 6th item and screw the opcodes up.

Video: http://www.youtube.com/watch?v=Sw0h7ImFsAs#t=865s

ITEM LIST (starting from the first slot):
[tt]* Any item
* 8F
Repel                x[SpeciesIndex]
X Speed              x14
Ultra Ball          x64
TM05                x72
Lemonade            x201[/tt]

ASM:
WRA1:D322 1E 20            ld  e,[SpeciesIndex]
WRA1:D324 43              ld  b,e
WRA1:D325 0E 02            ld  c,02
WRA1:D327 40              ld  b,b
WRA1:D328 CD 48 3E        call 3E48
WRA1:D32B C9              ret


[size=12pt]CHANGE THE PLAYER'S NAME[/size]

With this setup, you can change your name to the nickname of your first Pokemon. Using 8F will copy one letter from your first Pokemon's nickname to your player name. Use 8F (length of the name+1) times to copy all the name characters.
Warning: This code is self modifying, it will increase quantities of items #3 and #5 every use - remember to set those quantities back to 181 and 88 if you want to reset this. Also use carefully, as there's no memory protection implemented and you may cause save corruption if you're not careful.

Video: http://www.youtube.com/watch?v=Sw0h7ImFsAs#t=918s

ITEM LIST (starting from the first slot):
[tt]* Any item
* 8F
TM50                x181
TM10                x64
TM34                x88
TM09                x46
Calcium              x52
X Accuracy          x35
Full Heal            x201[/tt]

ASM:
WRA1:D322 FA B5 D2        ld  a,(D2B5)
WRA1:D325 40              ld  b,b
WRA1:D326 EA 58 D1        ld  (D158),a
WRA1:D329 2E 27            ld  l,27
WRA1:D32B 34              inc  (hl)
WRA1:D32C 2E 23            ld  l,23
WRA1:D32E 34              inc  (hl)
WRA1:D32F C9              ret 


[size=12pt]CHANGE THE SECOND ITEM[/size]

This easy code uses only 3 basic items, and it increases the first item's index by 1 every time 8F is used. You can obtain normally unobtainable items, glitch items or TMs so you can do other item configurations described.

Video: http://www.youtube.com/watch?v=Sw0h7ImFsAs#t=974s

ITEM LIST (starting from the first slot):
[tt]* 8F
* Item you want to morph
Burn Heal            x43
Ice Heal            x43
Full Heal            x201[/tt]

ASM:
WRA1:D322 0C              inc  c
WRA1:D323 2B              dec  hl
WRA1:D324 0D              dec  c
WRA1:D325 2B              dec  hl
WRA1:D32A 34              inc  (hl)
WRA1:D32B C9              ret


[size=12pt]WALK THROUGH WALLS[/size]

Jump off a ledge after using 8F to walk through walls.

http://www.youtube.com/watch?v=Sw0h7ImFsAs#t=1020s

ITEM LIST (starting from the first slot):
[tt]* Any item
* 8F
TM34                x20
TM15                x201[/tt]

ASM:
WRA1:D322 EA 14 D7        ld (d714),a
WRA1:D325 C9              ret


[size=12pt]ESCAPE FROM A TRAINER BATTLE[/size]

This turns 8F into an item which allows escaping from any battle, including trainer battles.

http://www.youtube.com/watch?v=Sw0h7ImFsAs#t=1048s

ITEM LIST (starting from the first slot):
[tt]* Any item
* 8F
TM34                x120
TM08                x201[/tt]

ASM:
WRA1:D322 EA 78 D0        ld (d078),a
WRA1:D325 C9              ret


[size=12pt]CLEAR A POKEMON BOX[/size]

When 8F was first discovered, the method of obtaining it had a slight chance to corrupt Pokemon at the PC box, causing crashes when trying to release/withdraw them. One can either deal with it and switch to another box, or make the box empty with this item configuration.

Switch to the corrupted box, use 8F, done. Be careful though, you don't probably want to clear the box with your L100 legendaries.

Video: http://www.youtube.com/watch?v=Sw0h7ImFsAs#t=1104s

ITEM LIST (starting from the first slot):
[tt]* Any item
* 8F
Lemonade            x1
Soda Pop            x64
TM34                x128
TM18                x201[/tt]

ASM:
WRA1:D322 3E 01            ld a,01
WRA1:D324 3D              dec a
WRA1:D325 40              ld b,b
WRA1:D326 EA 80 DA        ld (da80),a
WRA1:D329 C9              ret


[size=12pt]BUT WAIT, THERE'S MORE![/size]

Possibilities with 8F are unlimited. Here are some other item lists, posted by different people throughout the years (wow, this glitch is 3 years old now? I didn't realize).

Pseudo-GameShark (aka change any byte in RAM to any value) (by Wack0)
Instant Hall of Fame (by Wack0)
Pokémon Yellow US - play Pikachu's Beach (by Wack0)
Change OT of the first slot Pokémon (by blahpy)
Perpetually resetting save file (by Wack0)
Max stat Exp and DVs (by eironeia)
Set debug mode flag (by Rena)
Get 255 of second item (by lowena)
Daycare Pokémon cloning (by Skeef)
Set/unset badges (by Skeef)
Change a Pokémon's typing (by hashtag)
Reusable RAM writer (by Torchickens)
Make Pokémon shiny when traded to Gen II (by Krys3000 & thelinekioubeur)

List last updated on: 2016-07-04

[size=12pt]ENDING REMARK: BIG ITEM QUANTITIES?[/size]

All of those item lists will have at least one item with quantity bigger than 99. Obviously, it's possible to obtain those big quantities using the Missingno. item duplication glitch (duplicating a 99 item stack will result in a 227 item stack).
However, the numbers bigger than 9 are represented with glitch blobs, so it's normally impossible to read how many items you actually have. This short image guide below will help you with reading quantities of those big item stacks.

[img]http://i38.tinypic.com/2d8jgqg.png[/img]
* This image uses the Pokemon Center tileset

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: Torchickens
Date: 2013-04-25 11:27:50
Impressive. Great work on finding all those extra tricks and an alternative to k(y's code too!

I'm gonna re-post the CPU registers for D322 that you added as a caption in your video.

af = 6300 [a=63, f=00]
bc = 22B8
de= 0001 [d=00, e=01]
hl= D322 [h=D3, l=22]
All flags reset

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: Stackout
Date: 2013-04-25 11:34:27
yay, I think everyone was waiting for this.

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: camper
Date: 2013-04-25 12:20:28
Why is step 5 necessary?

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: TheZZAZZGlitch
Date: 2013-04-25 12:37:47
Why is step 5 necessary?


Super Glitch changes the boxset value ($D12C) to a glitch value 0x10, which corrupts the map if viewed. By opening the Pokemon Center's HEAL/CANCEL dialog the boxset value gets reset back to 0 (default YES/NO), so the game does not corrupt my map when I try to toss an item or save. Step 33 is necessary for the exact same reason.

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: Torchickens
Date: 2013-04-25 12:42:14
Here are a few simple tricks I made that work with the bootstrap program:


[size=14pt]Gym Leader theme plays for the next battle[/size]

Use this outside of battle to make the next battle play the Gym Leader theme.

Requirements:

Item 3 = TM34 x 92
Item 4 = TM08 x 201

ASM:

WRA1: D322 EA 5C D0              ld (D05C), a  : Put 63h into D05C
WRA1: D325 C9                    ret


[size=14pt]Battle Safari Zone style[/size]

Use 8F in the middle of the battle to turn it into a Safari Zone battle. If you use it outside of battle, you'll be forced to use item 1 infinitely.

Requirements:

Item 3 = Lemonade x 2
Item 4 = TM34 x 90
Item 5 = TM08 x 201

ASM:

WRA1: D322 3E 02                  ld a, 02 : Put 02h into a
WRA1: D324 EA 5A D0              ld (D05A), a  : Put 02h into D05A
WRA1: D327 C9   ret


[img]http://i.minus.com/jqPcnrhyGwBh3.png[/img]

[size=14pt]Steal other Trainer's Pokémon without Gameshark[/size]

Use this in a Trainer battle to enable the ability to catch the enemy Pokémon and escape from battle. You can also use it to disable wild battles, but you can't use it to turn a Trainer into a Pokémon.

[img]http://i.minus.com/jdrkmggEYxevh.png[/img][img]http://i.minus.com/jsKIa2lTQprx4.png[/img]

Requirements:

Item 3 = Lemonade x 1
Item 4 = TM34 x 87
Item 5 = TM08 x 201

ASM:

WRA1: D322 3E 01   ld a, 01: Put 01h into a
WRA1: D324 EA 57 D0   ld (D057), a: Put 01h into D057
WRA1: D327 C9   ret

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: OwnageMuch
Date: 2013-04-25 16:41:13
Words can't even describe how I felt reading this. You're amazing.

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: TheDarkAce
Date: 2013-04-25 21:54:57
I'm in awe of this, congratulations on the find!

i may have to try this at some point…

will it work on yellow?

if so, how do you get the enormous quantities of items on there?

i heard you can only ever get 129 per stack (missingnoXpert's Lets Glitch series on youtube taught me most of my glitching knowledge for R/B/Y, along with a bit of experimentation and whatever i could gleam from various sources, including the main site)

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: TheZZAZZGlitch
Date: 2013-04-25 22:54:10
will it work on yellow?


The shown method of obtaining 8F won't work in Yellow, as it uses Super Glitch, which works differently for this game.

Also, 8F does not execute code from $D163 in Yellow, but from $04FE instead - which has a less beneficial effect of teleporting you to a messed up version of a Pokemon Center.
Yellow has a relatively similar item "ws m" (hex 63), which executes code from $DA7F (number of Pokemon in the current box), but we still don't know how to obtain it though.

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: Torchickens
Date: 2013-04-26 07:54:19

if so, how do you get the enormous quantities of items on there?

i heard you can only ever get 129 per stack (missingnoXpert's Lets Glitch series on youtube taught me most of my glitching knowledge for R/B/Y, along with a bit of experimentation and whatever i could gleam from various sources, including the main site)


Just toss 2 or more items after it is duplicated by 128 the first time. For example, if you encounter Missingno. when you have 127 items in the sixth position, you will get 255. This is because all Dex #000 Pokémon add 128 to the quantity of the sixth item upon encounter provided that it is less than 128. Also capturing the Pokémon/obtaining it as a gift counts as both seeing it (adding 128 to the sixth item if its quantity is less than 128) and owning it (this registers Cubone in the Pokédex as 'seen'. You can avoid seeing Missingno.'s Pokédex entry and the Rhydon glitch if you've seen Cubone).

To duplicate your items on Yellow without a risk of freezing the game, you can use the Ditto glitch to encounter one of the special Missingno. (special stat = 182 [Kabutops fossil], 183 [Aerodactyl Fossil] or 184 [Ghost Missingno.] ) These are safe and won't freeze the game.

Alternatively, you can perform the Cable Club escape glitch with more than one Dex #000 Pokémon or similar item duplicating glitch Pokémon that don't freeze the game to duplicate multiple items by throwing balls / switching different items into the sixth position.

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: Stackout
Date: 2013-04-26 09:20:49

Here are a few simple tricks I made that work with the bootstrap program:


so in theory, 01xxyyzz gameshark codes could easily be converted for use with 8F with following asm skeleton:

D322 : 3E xx          ld a, xx      ; register a = xx
D324 : EA yy zz      ld (zzyy),a  ; memory address zzyy = register a
D327 : C9            ret          ; does this even need explaining?!


…which corresponds to following items:
Item3: Lemonade, quantity xx
Item4: TM34, quantity yy
Item5: Item with hex zz, quantity 201


…and if hex zz corresponds to glitch item or otherwise unobtainable item, one can change the second item using TheZZAZZGlitch's code above.

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: TheDarkAce
Date: 2013-04-26 18:26:01

[size=14pt]Steal other Trainer's Pokémon without Gameshark[/size]

Use this in a Trainer battle to enable the ability to catch the enemy Pokémon and escape from battle. You can also use it to disable wild battles, but you can't use it to turn a Trainer into a Pokémon.

[img]http://i.minus.com/jdrkmggEYxevh.png[/img][img]http://i.minus.com/jsKIa2lTQprx4.png[/img]

Requirements:

Item 3 = Lemonade x 1
Item 4 = TM34 x 87
Item 5 = TM08 x 201

ASM:

WRA1: D322 3E 01   ld a, 01: Put 01h into a
WRA1: D324 EA 57 D0   ld (D057), a: Put 01h into D057
WRA1: D327 C9   ret



just thought of a way to use this - use the ditto trick to set up a battle with a trainer with an abnormal level for a certain route, then set up the bootstrap code at the pokemon center you teleported to. once in the battle, run the code and you now have a stupidly high level pokemon… am i thinking about this right?

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: Torchickens
Date: 2013-04-27 07:07:28
Hey TheZZAZZGlitch, I found a much easier way to obtain 8F.

Due to having an invalid encounter flag, 94 and 94h's Pokédex number #213 means that they add 16 to the fourth item identifier provided that it is not  $X4 $X5 $X6 $X7 $XC $XD $XE $XF. If you put a Good Rod in the fourth position, and then use this glitch or the Cable Club escape glitch with a 94 or 94h, you can easily turn your Good Rod (4Dh) into an 8F (5Dh).



[size=14pt]Steal other Trainer's Pokémon without Gameshark[/size]

Use this in a Trainer battle to enable the ability to catch the enemy Pokémon and escape from battle. You can also use it to disable wild battles, but you can't use it to turn a Trainer into a Pokémon.

[img]http://i.minus.com/jdrkmggEYxevh.png[/img][img]http://i.minus.com/jsKIa2lTQprx4.png[/img]

Requirements:

Item 3 = Lemonade x 1
Item 4 = TM34 x 87
Item 5 = TM08 x 201

ASM:

WRA1: D322 3E 01   ld a, 01: Put 01h into a
WRA1: D324 EA 57 D0   ld (D057), a: Put 01h into D057
WRA1: D327 C9   ret



just thought of a way to use this - use the ditto trick to set up a battle with a trainer with an abnormal level for a certain route, then set up the bootstrap code at the pokemon center you teleported to. once in the battle, run the code and you now have a stupidly high level pokemon… am i thinking about this right?


Yes, you're right. You can do this with glitchy Trainers from the Ditto glitch or Old Man glitch to get Pokémon over level 100. There's something I forgot to mention though, a) using 8F counts as using up one turn, so Super Glitch/ moves that freeze the game might be a problem b) you'll still need a Master Ball or other type of Poké Ball to capture the Pokémon.

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: camper
Date: 2013-04-27 11:43:36
Which identifier is the first video's glitch roster? It can be 80h, 82h or 87h from the name. I guess only one of them corresponds to that roster.

I don't prefer the Cable Club escape glitch, mainly because of the need of TGB Dual.


just thought of a way to use this - use the ditto trick to set up a battle with a trainer with an abnormal level for a certain route, then set up the bootstrap code at the pokemon center you teleported to. once in the battle, run the code and you now have a stupidly high level pokemon… am i thinking about this right?

Few glitched rosters can be found by the Ditto trick. (2, to be exact, without the use of a Pokemon with Swords Dance)

Btw,
Unlike the 'death Trainer' found after the ZZAZZ glitch, a Trainer with Red's picture cannot be found by encountering a wild Pokémon and will only be found when trying to encounter an existing Trainer.
This is not true. ZZAZZ glitch won't change wild Pokemon encounters.

Re: Arbitrary code execution in Red/Blue using the "8F" item

Posted by: TheZZAZZGlitch
Date: 2013-04-27 12:17:21
Due to having an invalid encounter flag, 94 and 94h's Pokédex number #213 means that they add 16 to the fourth item identifier provided that it is not  $X4 $X5 $X6 $X7 $XC $XD $XE $XF. If you put a Good Rod in the fourth position, and then use this glitch or the Cable Club escape glitch with a 94 or 94h, you can easily turn your Good Rod (4Dh) into an 8F (5Dh)


Well, that's amazing. However, it still requires having a right name. Also, no matter which roster (letter after the MN symbol) I try, Prof. Oak will throw a " 8" (hex C9) out. Maybe this roster on the video has something to do with that Rocket in Silph Co. the author of the video fought previously and lost to?

Also, about the Cable Club escape glitch, it obviously requires access to the Cable Club. Also, to make trainers send out a "94" or "94h", the other trainer needs to own it first. And to own it, Johto guard glitch is needed. And to do this, one needs a hex FF ????? and a bad clone. And this gets far more complicated than the original method.

Anyways, thank you about all those information on encounter flags - maybe I will be able to use this to shorten up my first obtainment method.