Main Menu
Main Page
Forums
New pages
Recent changes
Random page
Help

Glitches
Arbitrary code execution
Pokémon cloning
Pomeg glitch and Glitzer Popping
Tweaking and voiding
Glitches by generation
Other glitch categories

References/Resources
Databases
Disassembly projects
The Big HEX List
Interactive tools
Reference documents
Terminology

Affiliates
Legendary Star Blob 2 (Hakuda) (日本語/Japanese)
Pokémon Speedruns wiki (English)
PRAMA Initiative (Français/French)
MissingNo. Glitch City (Italiano/Italian)
Become an affiliate!

Technical
Site source code

Search Wiki

 

Search Forums

 

Author Topic: Arbitrary code execution in Red/Blue using the "8F" item  (Read 443148 times)

0 Members and 2 Guests are viewing this topic.

Evie the Bird Mother 🌸 ☽

  • Veteran Contributor
  • *
  • Offline Offline
  • Gender: Female
  • ああ、紅茶がおいしい。 ~ ^^
    • View Profile
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #540 on: February 07, 2017, 04:34:47 pm »
Is there an Intuitive, Searchable, opcode map for the GB, I would like to write some item codes.

As Flandre Scarlet suggested you can use the table found at Pastraiser.

We also have an opcode table on http://glitchcity.info/wiki/The_Big_HEX_List but if you want a plain text file with only opcodes and operands another one can be found here (https://iimarck.us/etc/asmopcodes.txt) which is the table I used to use. I personally feel the latter two are simpler and may be more user friendly.

And if you want to learn assembly I learned some of it after experimenting with http://marc.rawer.de/Gameboy/Docs/GBCPU_Instr.html and http://datacrystal.romhacking.net/wiki/Pok%C3%A9mon_Red/Blue:RAM_map for a list of memory addresses, so for example ld a, xx puts a value into a and ld (xxyy),a puts the value of a into another memory address and a ret ($C9 byte) will end the code.

Hope that helps!
« Last Edit: February 07, 2017, 04:38:13 pm by Torchickens »
(I was former joint head admin but stepped down)
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Here have some free flowers on every post. ^^
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Love, faith, hope are free. If all is lost friends save us.
Thanks fans for lovely Torchic artwork. ♡ First image thanks Nyapon.

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #541 on: February 08, 2017, 12:48:03 am »
You also have our Big HEX List, whoch makes for a nice conversion tool. It's not as much readable IMO, but saves a ton of time.
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)

tigere89

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #542 on: February 09, 2017, 02:23:23 pm »
Greetings to all,

I simply wanted to say thank you for the information provided on this topic. Unfortunately I  lost my 8F shortly after obtaining it by putting it into my item box.

This being said, I wanted to confirm that by placing the item in Computer Item Box, that it would be lost; I think this is due to not resetting the item list by buying 3 different items first before saving.

Thank you, any insight would be great.

Tigere89

Unused Trainer

  • GCLF Member
  • *
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #543 on: February 10, 2017, 02:48:36 am »
Quick question: how powerfull is the 8F item for discovet new glitchs in future?

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #544 on: February 10, 2017, 07:25:57 am »
Since 8F is all-powerful, I guess "infinitely" is the right answer.
Until we exhaust the number of possible glitches, I guess.
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)

Yeniaul

  • Guest
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #545 on: February 10, 2017, 07:52:27 am »
Until we exhaust the number of possible glitches, I guess.
You do realize it's Game Freak's first(?) game we're talking about, right? I doubt my grandkids will see the last glitch to be found in this game be discovered.  ::)

Wack0

  • Coder, reverser, beta collector [BetaArchive staff]
  • Banned
  • *
  • Offline Offline
  • Gender: Male
  • cBRH - Doing nothing since 2k7
    • View Profile
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #546 on: February 10, 2017, 05:39:06 pm »
Until we exhaust the number of possible glitches, I guess.
You do realize it's Game Freak's first(?) game we're talking about, right? I doubt my grandkids will see the last glitch to be found in this game be discovered.  ::)

First GB game, maybe.

First game, no. Their first game was Mendel Palace for NES.
C H E C K E D . B U I L D S . A R E . A W E S O M E N E S S

BetaArchiveSoftHistory Forumsirc.rol.im #galaxy,#softhistory

Also known as The Distractor.

Shane, please stop telling children that there's a Mew outside under the delivery trucks. - Management

Pokémon: arbitrary code execution 1996-2016

Charmy

  • A guy who likes glitchyness.
  • Member+
  • *
  • Offline Offline
  • Gender: Male
  • "NIDOQUEEN THOMAS wants to battle!"
    • View Profile
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #547 on: February 11, 2017, 03:58:00 am »
Until we exhaust the number of possible glitches, I guess.
You do realize it's Game Freak's first(?) game we're talking about, right? I doubt my grandkids will see the last glitch to be found in this game be discovered.  ::)

First GB game, maybe.

First game, no. Their first game was Mendel Palace for NES.
And in Yellow, there's a unused port of it's boss theme, so it's confirmed now.
"Time is mone
Go along then" - Old Man


TMZ4 is the BEST TM while the sucky Channel is the best channel.

[]J.

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • Unknown opcode "bada55"
    • View Profile
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #548 on: February 14, 2017, 10:27:14 pm »
     Hi, I'm new to GCL (at least my account is) and I've recently obtained 8F in Pokemon red due to the recently (I think) discovered easier party arrangement redirecting to the fifth byte of the item menu. After messing with it, (accidentally) making a script of my own, and completing my Pokedex, I quickly became tired of being a script kiddie. I fear that I may loose interest in Pokemon red and never boot the cartridge up again (I understand it's hazardous to script on something lacking savestates, but I'm careful.) due to the fact that there isn't all too much left to do.

Anyway, I'll stop beating around the bush. What is the best resource I can use to learn how to script in Pokemon? I'm fluent in many refined languages, but machine code eludes me.

Any help would be much appreciated.

NUNsLAUGHTER

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #549 on: February 14, 2017, 10:47:26 pm »



Force encounter with a pokemon of a specified species (lvl is not guaranteed, for me it was lvl11 usually) :
1: Any item
2: wsm
3: Lemonade x[SpeciesIndex] (http://glitchcity.info/wiki/The_Big_HEX_List)
4: TM34 x93
5: TM08 x201


Receive a lvl 2 pokemon of a specified species (as if a NPC was giving it to the character):
1: Any item
2: wsm
3: Repel x[SpeciesIndex] (http://glitchcity.info/wiki/The_Big_HEX_List)
4: X Speed x14
5: Ultra Ball x64
6: TM05 x92
7: Lemonade x201
Note : the lvl is equal to the hex ID (http://glitchcity.info/wiki/The_Big_HEX_List) of the item in the fifth position (here, the Ultra ball
For your first one, if you withdraw a level 5/whatever level pokemon then put it back in the pc, next encounter will be that level, at least on blue.
I've got a question for the pokemon giving method, can you use something other than ultra balls to make the pokemon 40/50/100? I'd like to use this for getting ditto but pokebank doesn't see level 2 ditto as acceptable and I'd rather use this than having to battle ditto, catch it then deposit it but I don't want to use a bunch of rare candy, that'd make it more time consuming than the first one.

Unused Trainer

  • GCLF Member
  • *
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #550 on: February 15, 2017, 02:46:06 am »



Force encounter with a pokemon of a specified species (lvl is not guaranteed, for me it was lvl11 usually) :
1: Any item
2: wsm
3: Lemonade x[SpeciesIndex] (http://glitchcity.info/wiki/The_Big_HEX_List)
4: TM34 x93
5: TM08 x201


Receive a lvl 2 pokemon of a specified species (as if a NPC was giving it to the character):
1: Any item
2: wsm
3: Repel x[SpeciesIndex] (http://glitchcity.info/wiki/The_Big_HEX_List)
4: X Speed x14
5: Ultra Ball x64
6: TM05 x92
7: Lemonade x201
Note : the lvl is equal to the hex ID (http://glitchcity.info/wiki/The_Big_HEX_List) of the item in the fifth position (here, the Ultra ball
For your first one, if you withdraw a level 5/whatever level pokemon then put it back in the pc, next encounter will be that level, at least on blue.
I've got a question for the pokemon giving method, can you use something other than ultra balls to make the pokemon 40/50/100? I'd like to use this for getting ditto but pokebank doesn't see level 2 ditto as acceptable and I'd rather use this than having to battle ditto, catch it then deposit it but I don't want to use a bunch of rare candy, that'd make it more time consuming than the first one.

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #551 on: February 15, 2017, 09:09:06 am »
     Hi, I'm new to GCL (at least my account is) and I've recently obtained 8F in Pokemon red due to the recently (I think) discovered easier party arrangement redirecting to the fifth byte of the item menu. After messing with it, (accidentally) making a script of my own, and completing my Pokedex, I quickly became tired of being a script kiddie. I fear that I may loose interest in Pokemon red and never boot the cartridge up again (I understand it's hazardous to script on something lacking savestates, but I'm careful.) due to the fact that there isn't all too much left to do.

Anyway, I'll stop beating around the bush. What is the best resource I can use to learn how to script in Pokemon? I'm fluent in many refined languages, but machine code eludes me.

Any help would be much appreciated.
I tried making a page about programming for the Game Boy. I find it hard to read though, so after you are done reading it head to the "ASM in 28 days" thing linked at the end, it is a tutorial for TI 8x calcs, which have almost the same processor as the GB. The tutorial talks about sutff such as "ports" which don't exist on the GB anymore, but the more you know.
Then you'll probably figure out the rest, just use GBdevWiki as a reference to all GameBoy-specific stuff.
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)

Wack0

  • Coder, reverser, beta collector [BetaArchive staff]
  • Banned
  • *
  • Offline Offline
  • Gender: Male
  • cBRH - Doing nothing since 2k7
    • View Profile
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #552 on: February 15, 2017, 01:35:46 pm »
     Hi, I'm new to GCL (at least my account is) and I've recently obtained 8F in Pokemon red due to the recently (I think) discovered easier party arrangement redirecting to the fifth byte of the item menu. After messing with it, (accidentally) making a script of my own, and completing my Pokedex, I quickly became tired of being a script kiddie. I fear that I may loose interest in Pokemon red and never boot the cartridge up again (I understand it's hazardous to script on something lacking savestates, but I'm careful.) due to the fact that there isn't all too much left to do.

Anyway, I'll stop beating around the bush. What is the best resource I can use to learn how to script in Pokemon? I'm fluent in many refined languages, but machine code eludes me.

Any help would be much appreciated.
I tried making a page about programming for the Game Boy. I find it hard to read though, so after you are done reading it head to the "ASM in 28 days" thing linked at the end, it is a tutorial for TI 8x calcs, which have almost the same processor as the GB. The tutorial talks about sutff such as "ports" which don't exist on the GB anymore, but the more you know.
Then you'll probably figure out the rest, just use GBdevWiki as a reference to all GameBoy-specific stuff.

I'm pretty sure this is the wiki page you meant to link to.
C H E C K E D . B U I L D S . A R E . A W E S O M E N E S S

BetaArchiveSoftHistory Forumsirc.rol.im #galaxy,#softhistory

Also known as The Distractor.

Shane, please stop telling children that there's a Mew outside under the delivery trucks. - Management

Pokémon: arbitrary code execution 1996-2016

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #553 on: February 15, 2017, 02:01:11 pm »
Yep.
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)

[]J.

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • Unknown opcode "bada55"
    • View Profile
Re: Arbitrary code execution in Red/Blue using the "8F" item
« Reply #554 on: February 15, 2017, 07:25:42 pm »
     Hi, I'm new to GCL (at least my account is) and I've recently obtained 8F in Pokemon red due to the recently (I think) discovered easier party arrangement redirecting to the fifth byte of the item menu. After messing with it, (accidentally) making a script of my own, and completing my Pokedex, I quickly became tired of being a script kiddie. I fear that I may loose interest in Pokemon red and never boot the cartridge up again (I understand it's hazardous to script on something lacking savestates, but I'm careful.) due to the fact that there isn't all too much left to do.

Anyway, I'll stop beating around the bush. What is the best resource I can use to learn how to script in Pokemon? I'm fluent in many refined languages, but machine code eludes me.

Any help would be much appreciated.
I tried making a page about programming for the Game Boy. I find it hard to read though, so after you are done reading it head to the "ASM in 28 days" thing linked at the end, it is a tutorial for TI 8x calcs, which have almost the same processor as the GB. The tutorial talks about sutff such as "ports" which don't exist on the GB anymore, but the more you know.
Then you'll probably figure out the rest, just use GBdevWiki as a reference to all GameBoy-specific stuff.

I'm pretty sure this is the wiki page you meant to link to.

"MediaWiki internal error.

Original exception: [df666237fde71cf5d357b568] /wiki/GB_Programming MWException from line 767 of /application/w/includes/skins/SkinTemplate.php: SkinTemplate::makeTalkUrlDetails given invalid pagename User:[]J.
Backtrace:
#0 /application/w/includes/skins/SkinTemplate.php(606): SkinTemplate->makeTalkUrlDetails(string)
#1 /application/w/includes/skins/SkinTemplate.php(472): SkinTemplate->buildPersonalUrls()
#2 /application/w/includes/skins/SkinTemplate.php(246): SkinTemplate->prepareQuickTemplate(OutputPage)
#3 /application/w/includes/OutputPage.php(2324): SkinTemplate->outputPage()
#4 /application/w/includes/MediaWiki.php(753): OutputPage->output()
#5 /application/w/includes/MediaWiki.php(519): MediaWiki->main()
#6 /application/w/index.php(43): MediaWiki->run()
#7 {main}

Exception caught inside exception handler: [df666237fde71cf5d357b568] /wiki/GB_Programming MWException from line 767 of /application/w/includes/skins/SkinTemplate.php: SkinTemplate::makeTalkUrlDetails given invalid pagename User:[]J.
Backtrace:
#0 /application/w/includes/skins/SkinTemplate.php(606): SkinTemplate->makeTalkUrlDetails(string)
#1 /application/w/includes/skins/SkinTemplate.php(472): SkinTemplate->buildPersonalUrls()
#2 /application/w/includes/skins/SkinTemplate.php(246): SkinTemplate->prepareQuickTemplate(OutputPage)
#3 /application/w/includes/OutputPage.php(2324): SkinTemplate->outputPage()
#4 /application/w/includes/exception/MWException.php(204): OutputPage->output()
#5 /application/w/includes/exception/MWException.php(244): MWException->reportHTML()
#6 /application/w/includes/exception/MWExceptionHandler.php(69): MWException->report()
#7 /application/w/includes/exception/MWExceptionHandler.php(180): MWExceptionHandler::report(MWException)
#8 /application/w/includes/MediaWiki.php(528): MWExceptionHandler::handleException(MWException)
#9 /application/w/index.php(43): MediaWiki->run()
#10 {main}"

This is all that link gave me...