Re: Arbitrary code execution in Red/Blue using the "8F" item
Posted by: ISSOtm
Date: 2017-01-25 03:06:58
Well, just decided to quickly code something for 8F…
[size=12pt]CHANGE ANY BYTE IN RAM TO ANYTHING[/size]
[size=8pt](or, psuedo-GameShark in software)[/size]
This code uses only 5 basic items, and will easily allow you to modify any byte in RAM one wants to.
Item 1: any item
Item 2: 8F
Item 3: Lemonade, quantity (byte to change to, or 2nd byte of GScode)
Item 4: X Accuracy, quantity (low byte of RAM address to change, or 3rd byte of GScode)
Item 5: Carbos, quantity (high byte of RAM address to change, or 4th byte of GScode)
Item 6: Poké Ball, quantity 119
Item 7: Fresh Water, quantity 201
ASM:D322: 3E xx ld a, xx
D324: 2E xx ld l, xx
D326: 26 xx ld h, xx
D328: 04 inc b
D329: 77 ld (hl), a
D32A: 3C inc a
D32B: C9 ret
So, for GameShark code 011559D0, which would encounter a Mew after you close the menu (and yes, this is the one i tested it with – on a real cart no less), use the following item list:
Item 1: any item (but I guess you'd want Master Balls here for this example!)
Item 2: 8F
Item 3: Lemonade, quantity 21
Item 4: X Accuracy, quantity 89
Item 5: Carbos, quantity 208
Item 6: Poké Ball, quantity 119
Item 7: Fresh Water, quantity 201
By the way, since no address is hardcoded, this *should* work on Yellow too; but I haven't tested it there. (obviously the example posted above won't!)