This glitch involves swapping a battling Pokémon's move 7 with another move with an ID greater than a particular value.
Move 7 is accessed via the selection of item 7, and since move 7 represents a Pokémon's first experience byte, it can be replaced with a value that enables the battling Pokémon to instantly jump to level 100 after a battle. The ID depends on the experience group of the Pokémon.
You need a Bag occupying at least seven item slots and an attack. Most attacks can be used, but there are some exceptions depending on the Pokémon's growth rate. To check up an attack ID, see The Big HEX List.
Below are the minimum attack IDs for a Pokémon's growth rate:
Medium-Slow: Attack ID is ≥17 (hex:11) or ≥16 (hex:10) if the second and third experience bytes are 2Ch, 14h, respectively, or higher. Example: Wing Attack (11h).
Medium-Fast: Attack ID is ≥16 (hex:10) or ≥15 (hex:0F) if the second and third experience bytes are 42h, 40h, respectively, or higher. Example: Gust (10h).
Fast: Attack ID is ≥13 (hex:0D) or ≥12 (hex:0C) if the second and third experience bytes are 35h, 00h, respectively, or higher. Example: Tackle (21h).
Slow: Attack ID is ≥14 (hex: 0E) or ≥13 (hex:0D) if the second and third experience bytes are 12h, D0h, respectively, or higher. Example: Tackle (21h).
1) Outside of battle, press select on the seventh item.
2) Exit the menu via B,B and enter a battle.
3) Press Select on the first-fourth attack provided you have the right move (see above for more information). This will give the identifier of your move to the Pokémon's experience byte 1 and you'll obtain the equivalent move for the old value.
4) End the battle by beating a Pokémon. If you run then you may be able to deposit the Pokémon in a box and then withdraw it, but you might get a Pokémon over level 100; so in order to fix that you'll have to win a battle with it.
Examples of Pokémon by growth rate
Medium-slow: All Pokémon part of a three stage evolution, except Caterpie/Weedle and their evolutions. Mew also uses this experience group.
Medium-fast: Rattata/Raticate, Ekans/Arbok, Pikachu/Raichu, etc.
Slow: Growlithe/Arcanine, Tentacool/Tentacruel, Shellder/Cloyster, Rhyhorn/Rhydon, Staryu/Starmie, legendary Pokémon, etc.
This glitch works because on the moves list you're swapping the cursor in the 7th position with the 1st-4th. The address for the fourth move is D136, while the (invalid) address for the seventh move is D139. This happens to be the address for the first Pokémon's current experience byte 1 (+a multiple of 65536) and this value doesn't have to be too high for a normal Pokémon at level 100.
When you swap the 7th move with the 1st-4th one, you receive an item with the same identifier as your current experience byte and the current experience byte gets replaced with the identifier of the move. For example, if your Pokémon currently has a current experience byte 1 of [02h] and you swap it with Wing Attack [11h], then the move will be replaced with Karate Chop (which has an index number of 2) and your current experience will increase by
65536*(17-02) (hex: 10000*(11-02)), which is equal to 983040 in decimal. If you're using a medium-slow, medium-fast or fast growth rate Pokémon (see Bulbapedia's list of Pokémon by experience group article to see which Pokémon uses which), then its experience will cap to 1059860 as long as the species bytes match (the donor byte, e.g. poké 1: D124 manages max experience and the recipient byte e.g. poké 1: D12B manages growth rate), but for a Slow growth rate Pokémon, you need a higher value, such as 13h (1245184).
The glitch was likely known in Japanese circles in the past and was later documented by Cl0vis15 on "davidwonn.kontek. net".
It was also referenced on the main Pokémon website.