Item underflow: Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{Incomplete|needs=needs name and date of discovery (look through TASvideos or GCL), comprehensive explanation of how the item bag is laid out in memory and thus how the glitch works, examples of additional exploits (e.g. those used in the current catch 'em all speedrun category); also perhaps more reference links}}
{{Incomplete|needs=needs name and date of discovery (look through TASvideos or GCL), comprehensive explanation of how the item bag is laid out in memory and thus how the glitch works, examples of additional exploits (e.g. those used in the current catch 'em all speedrun category); also perhaps more reference links}}
The '''item underflow glitch''' [[glitch]] is a subglitch of the [[Item_duplication_glitch#255_stack_duplication_glitch|255-stack variant]] of the [[item duplication glitch]], whose effect is to essentially allow the player to arbitrarily read and write RAM just beyond the point where [[item]]s are stored in memory.
The '''item underflow''' [[glitch]] is a subglitch of the [[Item_duplication_glitch#255_stack_duplication_glitch|255-stack variant]] of the [[item duplication glitch]], whose effect is to essentially allow the player to arbitrarily read and write RAM just beyond the point where [[item]]s are stored in memory.


==Method==
==Method==
The first method discovered to perform the item underflow glitch requires obtaining any single [[drink]] from the [[vending machine]]s in the [[Celadon Department Store]], while the player still has not yet unlocked passage to [[Saffron City]].
The first method discovered to perform the item underflow glitch requires obtaining any single [[drink]] from the [[vending machine]]s in the [[Celadon Department Store]], while the player still has not yet unlocked passage to [[Saffron City]].


Keeping the drink in the Bag, the player must repeatedly perform the 255-stack item duplication glitch until the topmost item becomes the acting Cancel button. As mentioned in the item duplication glitch article, at this point the number of items in the Bag and the actual items in the Bag are out of sync; the game believes that the player has 0 items in the [[Bag]], but it also believes that the player has a drink in their Bag. At this point, the player can go to any one of the Saffron City guards and give them the drink to unlock passage to the city (as the game believes that the player has a drink in their Bag to give), but as they only had one drink in their Bag, it will also attempt to decrease the total number of item stacks in the Bag by 1 (as it normally would). This will cause the number of items in the Bag to become -1, which underflows to 255 (hence the name of glitch).
Keeping the drink in the Bag, the player must repeatedly perform the 255-stack item duplication glitch until the topmost item becomes the acting Cancel button. As mentioned in the item duplication glitch article, at this point the number of items in the Bag and the actual items in the Bag are out of sync; the game believes that the player has 0 items in the [[Bag]], but it also believes that the player has a drink in their Bag. At this point, the player can go to any one of the Saffron City guards and give them the drink to unlock passage to the city (as the game believes that the player has a drink in their Bag to give), but as this is the only drink in their Bag, it will also attempt to decrease the total number of item stacks in the Bag by 1. This will cause the number of items in the Bag to become -1, which underflows to 255 (hence the name of glitch).


As the game now believes that the player has 255 item slots to scroll through, the player is able to access several important regions of memory that happen to be stored just beyond the items in RAM, and manipulate these memory areas as if they were items (by swapping, tossing, etc). This effectively gives the player arbitrary read and write access to these regions of memory. Perhaps most notably, this includes the player's map and coordinates, and so for example it is possible to instantly complete the game by warping to the [[Hall of Fame]]. Manipulating coordinates is also a relatively easy way to access glitch items such as [[List of unobtainable items#8F|8F]], by standing on a particular tile (such that the player's coordinates are interpreted as the item 8F) and then swapping that item to a normal Bag slot.
As the game now believes that the player has 255 item slots to scroll through, the player is able to access several important regions of memory that happen to be stored just beyond the items in RAM, and manipulate these memory areas as if they were items (by swapping, tossing, etc). This effectively gives the player arbitrary read and write access to these regions of memory. This perhaps most notably includes the player's current map and coordinates, and so for example it is possible to instantly complete the game by warping to the [[Hall of Fame]]. Manipulating coordinates is also a relatively easy way to access glitch items such as [[List of unobtainable items#8F|8F]], by standing on a particular tile (such that the player's coordinates are interpreted as the item 8F) and then swapping that item to a normal Bag slot.


This method can also be performed in a nearly identical manner using a [[Fossil]] and the scientist in the [[Pokémon Lab]] on [[Cinnabar Island]] who revives it and thus removes it from the inventory.
This item underflow method can also be performed in a nearly identical manner using a [[Fossil]] and the scientist in the [[Pokémon Lab]] on [[Cinnabar Island]] who revives it and thus removes it from the inventory.


Restoring the player's Bag can be easily performed by simply obtaining or purchasing various different items; this will bring the number of item stacks in the Bag back up to 0 or usual positive numbers.  
Restoring the player's Bag to normal can be easily performed by simply obtaining or purchasing various different items; this will bring the number of item stacks in the Bag back up to 0 or usual positive numbers.  


Importantly, while the glitch allows nearly arbitrary ''read'' and ''write'' access to memory, it does not allow arbitrary ''execution'' of that memory as code. Hence this glitch, while powerful, is not as powerful as [[arbitrary code execution]] glitches.
Importantly, while the item underflow glitch allows nearly arbitrary ''read'' and ''write'' access to memory, it does not allow arbitrary ''execution'' of that memory as code. Hence this glitch, while powerful, is not as powerful as [[arbitrary code execution]] glitches.


===Dry item underflow===
===Dry item underflow===
The "dry" variant of the item underflow glitch does not require a Saffron City guard to remove a drink from the player's Bag (hence the name) nor the Pokémon Lab scientist to remove a Fossil; thus it can be performed as soon as the player has access to the necessary 255-stack variant of the item duplication glitch (in theory, as soon as they can perform the Extended [[Mew glitch]] or [[Ditto glitch]] to encounter [[Missingno.]]), before reaching Celadon City.
The "dry" variant of the item underflow glitch does not require a Saffron City guard to remove a drink from the player's Bag (hence the name) nor the Pokémon Lab scientist to remove a Fossil; thus it can be performed as soon as the player has access to the necessary 255-stack variant of the item duplication glitch (in theory, as soon as they can perform the Extended [[Mew glitch]] or [[Ditto glitch]] to encounter [[Missingno.]]), before reaching Celadon City.


This method relies on a little-known feature in that using the Select button to swap two stacks of the same item in fact merges the stacks together (thus subtracting 1 from the number of item stacks in the player's inventory). This effect can occur in normal gameplay; for example, if the player buys 99 [[Potion]]s and then obtains another one, they will have two separate stacks of 99 and 1 Potion(s) respectively. If the player then uses 10 Potions from the stack of 99 (to obtain stacks of 89 and 1), then swaps the two stacks of Potions, they will be merged into one stack of 90 Potions.
This method relies on a little-known feature in that using the Select button to swap two stacks of the same item in fact merges the stacks together (thus subtracting 1 from the number of item stacks in the player's inventory). This effect can occur in normal gameplay; for example, if the player buys 99 [[Potion]]s and then obtains another one, they will have two separate stacks of 99 and 1 Potion(s) respectively. If the player then uses 10 Potions from the stack of 99 (to obtain stacks of 89 and 1), then swaps the two stacks of Potions with the Select button, they will be merged into one stack of 90 Potions.


With the above in mind, the method to underflow the player's item counter is as follows: [http://forums.glitchcity.info/index.php/topic,7175.0.html].
With the above in mind, the method to underflow the player's item counter is as follows: [http://forums.glitchcity.info/index.php/topic,7175.0.html].

Revision as of 19:57, 23 January 2016

050Diglett.png This article is incomplete.
Please feel free to edit this article to add missing information and complete it.
Reason: needs name and date of discovery (look through TASvideos or GCL), comprehensive explanation of how the item bag is laid out in memory and thus how the glitch works, examples of additional exploits (e.g. those used in the current catch 'em all speedrun category); also perhaps more reference links

The item underflow glitch is a subglitch of the 255-stack variant of the item duplication glitch, whose effect is to essentially allow the player to arbitrarily read and write RAM just beyond the point where items are stored in memory.

Method

The first method discovered to perform the item underflow glitch requires obtaining any single drink from the vending machines in the Celadon Department Store, while the player still has not yet unlocked passage to Saffron City.

Keeping the drink in the Bag, the player must repeatedly perform the 255-stack item duplication glitch until the topmost item becomes the acting Cancel button. As mentioned in the item duplication glitch article, at this point the number of items in the Bag and the actual items in the Bag are out of sync; the game believes that the player has 0 items in the Bag, but it also believes that the player has a drink in their Bag. At this point, the player can go to any one of the Saffron City guards and give them the drink to unlock passage to the city (as the game believes that the player has a drink in their Bag to give), but as this is the only drink in their Bag, it will also attempt to decrease the total number of item stacks in the Bag by 1. This will cause the number of items in the Bag to become -1, which underflows to 255 (hence the name of glitch).

As the game now believes that the player has 255 item slots to scroll through, the player is able to access several important regions of memory that happen to be stored just beyond the items in RAM, and manipulate these memory areas as if they were items (by swapping, tossing, etc). This effectively gives the player arbitrary read and write access to these regions of memory. This perhaps most notably includes the player's current map and coordinates, and so for example it is possible to instantly complete the game by warping to the Hall of Fame. Manipulating coordinates is also a relatively easy way to access glitch items such as 8F, by standing on a particular tile (such that the player's coordinates are interpreted as the item 8F) and then swapping that item to a normal Bag slot.

This item underflow method can also be performed in a nearly identical manner using a Fossil and the scientist in the Pokémon Lab on Cinnabar Island who revives it and thus removes it from the inventory.

Restoring the player's Bag to normal can be easily performed by simply obtaining or purchasing various different items; this will bring the number of item stacks in the Bag back up to 0 or usual positive numbers.

Importantly, while the item underflow glitch allows nearly arbitrary read and write access to memory, it does not allow arbitrary execution of that memory as code. Hence this glitch, while powerful, is not as powerful as arbitrary code execution glitches.

Dry item underflow

The "dry" variant of the item underflow glitch does not require a Saffron City guard to remove a drink from the player's Bag (hence the name) nor the Pokémon Lab scientist to remove a Fossil; thus it can be performed as soon as the player has access to the necessary 255-stack variant of the item duplication glitch (in theory, as soon as they can perform the Extended Mew glitch or Ditto glitch to encounter Missingno.), before reaching Celadon City.

This method relies on a little-known feature in that using the Select button to swap two stacks of the same item in fact merges the stacks together (thus subtracting 1 from the number of item stacks in the player's inventory). This effect can occur in normal gameplay; for example, if the player buys 99 Potions and then obtains another one, they will have two separate stacks of 99 and 1 Potion(s) respectively. If the player then uses 10 Potions from the stack of 99 (to obtain stacks of 89 and 1), then swaps the two stacks of Potions with the Select button, they will be merged into one stack of 90 Potions.

With the above in mind, the method to underflow the player's item counter is as follows: [1].

Video

By ChickasaurusGL


References


Bulbapedia logo.png This article is a stub. You can help Bulbapedia by expanding it.


Multiple
generations
Transform glitchesGlitch TrainersCloning glitchesError messagesArbitrary code execution
Generation I GlitchesBattle glitchesOverworld glitches
--0 ERRORBroken hidden itemsCable Club escape glitchDual-type damage misinformation
Experience underflow glitchFight Safari Zone Pokémon trickGlitch CityItem duplication glitchItem underflow
Mew glitchOld man glitchPewter Gym skip glitchPokémon merge glitchRhydon glitchRival twins glitch
Select glitches (dokokashira door glitch, second type glitch) • Super Glitch
Time Capsule exploitWalking through wallsZZAZZ glitch
Generation II GlitchesBattle glitches
Bug-Catching Contest glitchCelebi Egg glitchCoin Case glitchesExperience underflow glitch
Glitch dimensionGlitch EggTeru-samaTime Capsule exploitTrainer House glitchesGS Ball mail glitch
Generation III GlitchesBattle glitches
Berry glitchDive glitchPomeg glitchGlitzer Popping
Generation IV GlitchesBattle glitchesOverworld glitches
Acid rainGTS glitchesPomeg glitchRage glitch
Surf glitchTweakingPal Park Retire glitch
Generation V GlitchesBattle glitchesOverworld glitches
Charge Beam additional effect chance glitchCharge move replacement glitchChoice item lock glitch
Frozen Zoroark glitchSky Drop glitch
Generation VI GlitchesBattle glitchesOverworld glitches
Charge Beam additional effect chance glitchCharge move replacement glitchChoice item lock glitch
Lumiose City save glitchSymbiosis Eject Button glitchToxic sure-hit glitch
Generation VII GlitchesBattle glitches
Charge Beam additional effect chance glitchCharge move replacement glitchChoice item lock glitch
Toxic sure-hit glitchRollout storage glitch
Generation VIII Glitches
Charge Beam additional effect chance glitchCharge move replacement glitchChoice item lock glitch
Toxic sure-hit glitchRollout storage glitchParty item offset glitch
Generation IX Glitches
Glitch effects Game freezeGlitch battleGlitch song
Gen I only: Glitch screenTMTRAINER effectInverted sprites
Gen II only: Glitch dimension
Lists Glitches (GOMystery DungeonTCG GBSpin-off)
Glitch Pokémon (Gen IGen IIGen IIIGen IVGen VGen VIGen VIIGen VIII)
Glitch moves (Gen I) • Glitch types (Gen IGen II)


Project GlitchDex logo.png This article is part of Project GlitchDex, a Bulbapedia project that aims to write comprehensive articles on glitches in the Pokémon games.