View Full Version : [Tutorial] Hex Editing Learnable Attacks

February 10th, 2007, 3:30 PM
This tutorial was translated from the tutorial at the German site ROM Hacker's World.

Egg Moves

The attacks that are transferred by breeding, are found in a list according to the following pattern:
[Pokémon1][Attack1][Attack2]... [Pokémon2][Attack1]...
It puts the first digit in 3 or more digit references after the last two digits. (Thus having two bytes for every attack)

Example: Geodude

The data would look like this:
[ 6A4E][0500][9D00][4F01 ]

First word (at 20074 in the ROM) indicates that it concerns Geodude. On The following indicates the learnable attacks:
0500 - > 5 = Mega Punch
9D00 - > 9D = Rock Slide
4F01 - > 14F = Block

Learnable TMs/HMs

This actually does very little since Gold/Silver. The data is only accommodated through special means, not through Pokémon data.
8 bytes are assigned to each Pokémon:
[TMs 8-1][TMs 16-9][TMs 24-17][TMs 32-25][TMs 40-33][TMs 48-41][HMS 6-1 and TMs 50-49][6 zero-bytes and HMs 8-7 ]
Pay attention to the fact that the sequence is in descending order within the bytes. For example, byte 1 looks like this:
[ TM8, TM7, TM6, TM5, TM4, TM3, TM2, TM1 ]
If the bit is a 1, then the Pokémon can learn the TM/HM.

Example: Bulbasaur

The first byte of Bulbasaur is [00100000].
With this information, you can see that of the first 8 TMs, Bulbasaur only learns TM6, Toxic.
Attacks Learnable by Leveling Up

The level-up attacks that Pokémon learn are stored in an easily compressed form. (OK, it isn’t really compression, is only a little tightly squeezed)
Every attack has the level it was learned, in two bytes. Any one Pokémon has it’s attacks separated from those of others by two bytes that form FFFF, like this:
(There isn’t anything there that you can see about which Pokémon learns the attacks. The lists are in the order of the Pokémon within the ROM’s hexadecimal list.)
This is how you will see the attacks listed where you can edit them:
[byte2: L64, L32, L16, L8, L4, L2, L1, A256][byte1: A128, a64, a32, a16, a8, a4, a2, a1 ]
All L-bits show the level, all A-bits show the attack ID.

Example: Treecko

First word [ 0102 ] is turned and converted then into the following:
- > 0201 - > 0000001 000000001
The seven bits indicate the level, which, in this example, is level 1. The attack results from the nine following bits, where 1=Pound. Thus, Treecko learns Pound at level 1.

February 11th, 2007, 8:46 AM
I'm a bit confused about converting binary to hex etc

February 11th, 2007, 8:49 AM
I'm a bit confused about converting binary to hex etc

The Windows calculator can do that for you. Just switch to Scientific mode and you will see all those modes as options on the top left.
Enter your values and click one of the options, it will convert them.

February 11th, 2007, 5:23 PM
I'm a bit confused about converting binary to hex etc

There is not binary in this tutorial. In fact, the ones and zeros are in hex, within the ROMs. It is just that they use the following format:


The tutorial tells you which TM/HM each 0 or 1 represents, so it should be pretty straightforward from there.

February 12th, 2007, 12:31 AM
Oh ok. Thanks to u both lol