• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Development: Hex Editing - Gen. 4 & 5

3,830
Posts
14
Years
  • Age 26
  • OH
  • Seen Feb 26, 2024

Generation 4 & 5 Hex Editing

Okay, so I've been doing research into pretty much all DS Pokémon games, and I'm just creating a library for all of my research I've found.

Pokemon Base Stats

A pokémon's base stats are all the basic info of the pokémon, like the base HP, Attack, Special Abilities, etc.

Diamond Info.

Instead of writing this all out, please see this.

Narc: "poketool/personal.narc"
Location in ROM: 0x1C15A08 (Bulbasaur)
Thanks to thethethethe.

HeartGold Info.

In Pokémon HeartGold, it follows the exact same format as found in Pokémon Diamond.

Narc: "poketool/personal.narc"
Location in ROM: 0x12B2840 (Bulbasaur)
Thanks to me.


Black (Japan) Info.

In Pokémon Black, it uses a different format from Gen. 4. I'm still researching, so bear with me.

Narc: "a/0/1/6"
Location in ROM: 0x6F98554 (Bulbasaur)
Thanks to me.

Format Explained (Gen. 4)

To explain the format, I will present an example, taken from HeartGold.
The pokémon shown is Arceus.
Code:
78 - HP (120)
78 - Attack (120)
78 - Defense (120)
78 - Speed (120)
78 - Special Attack (120)
78 - Special Defense (120)
00 - Type 1 (Normal)
00 - Type 2 (Normal)
03 - Catch Rate (3)
FF - Base XP (255)
03 - Effort Yield 1 - Not sure how works.
00 - Effort Yield 2 - Not sure how works.
0000 - Held Item 1 (None)
0000 - Held Item 2 (None)
FF - Gender Chance (Genderless)
78 - Steps for Egg to Hatch (121)*
00 - Base Happiness (0)
05 - Experience Type (1,250,000)
0F - Egg Type 1 (None)
0F - Egg Type 2 (None)
79 - Special Ability 1 (Multitype)
00 - Special Ability 2 (None)
00 - Safari Zone Run Chance (0)
07 - Pokedex Color (Gray)
00 - None (Padding)
00 - None (Padding)
7E - TM Switches 1-8
F7 - TM Switches 9-16
FF - TM Switches 17-24
F7 - TM Switches 25-32
FF - TM Switches 33-40
0E - TM Switches 41-48
5A - TM Switches 49-56
37 - TM Switches 57-64
EF - TM Switches 65-72
DD - TM Switches 73-80
7F - TM Switches 81-88
FE - TM Switches 89-92, HM 1-4
0F - HM 5-8
00 - None (Padding)
00 - None (Padding)
00 - None (Padding)
*To get actual cycles, add 1.

How does the Gender Chance Work?

To edit the gender chance, what you do is convert it to decimal, then do this:

Data to Percent (Value * 100) / 254 = Percent (of Male).
Precent to Value (Percent * 254) / 100 = Value.
To get genderless pokémon, you make the value 0xFF (255).

Format Explained (Gen. 5)

Thanks to Awkward Squirtle for telling me about the different format.
To explain this, I will post my current research for it by showing Bulbasaur (from Black).
Code:
2D - HP
31 - Attack
31 - Defense
2D - Speed
41 - Special Attack
41 - Special Defense
0B - Type 1 (Grass)
03 - Type 2 (Poison)
2D - Catch Rate
00
00 - Effort Yield 1
01 - Effort Yield 2
0000 - Item 1
0000 - Item 2
00
00
1F - Gender Chance
14 - Steps for Egg to Hatch (in Cycles)
46
03 - Pokedex Color
01 - Egg Type 1
07 - Egg Type 2
41 - Special Ability 1 (Overgrow)
00 - Special Ability 2 (None)
22 - Dream World/Hidden Ability (Chlorophyll)
00
00
00
00
00
01
03 - Experience Type?
40 - Base XP
00 - Base XP 2?
07
00
45
00
20
87
39
84
08
9A
11
00
20
04
60
A2
04
00
00
00
01
00 - Padding
00 - Padding
00 - Padding

Helpful Lists


Pokemon (Gen 4)

Thanks to Darthatron.
Spoiler:


Types (Gen 4)

Thanks to thethethethe.
Spoiler:


Types (Gen. 5)

Thanks to Awkward Squirtle.
Spoiler:


Items

Thanks to gamefreakfatty.
Spoiler:


Experience Types

Found by me.
Spoiler:


Egg Types

Found by me.
Spoiler:


MORE COMING SOON! :D
 
Last edited:
1,323
Posts
16
Years
  • Seen Dec 9, 2023
It would be better simply to tell us what narc file the data would be in; the offsets are useless since the offsets of nearly EVERYTHING changes every time you modify a narc file.
 
3,830
Posts
14
Years
  • Age 26
  • OH
  • Seen Feb 26, 2024
It would be better simply to tell us what narc file the data would be in; the offsets are useless since the offsets of nearly EVERYTHING changes every time you modify a narc file.

Good point. They are in the "personal.narc" in Diamond and HeartGold. I'm actually not sure about black.

EDIT: Black's pokemon data is in the narc "a/0/1/6"
 
Last edited:

Awkward Squirtle

,@,e .ºoO
110
Posts
12
Years
  • Seen Jan 29, 2016
Gen 5 doesn't have a ??? type; 09 is Fire etc. Effort yield is as simple as two bits per stat, I believe (12 bits in total).

B/W use a different Pokémon data format; this change was responsible for Serebii originally getting the Pokédex data wrong on his site (IIRC, the types were wrong because of the above change, for example). B/W use two bytes for the base experience, and have a third ability byte (I'm pretty sure there's more, but I can't remember them off the top of my head). Also, the level-up move list is different, as each move is now four bytes rather than two (though you haven't covered this). The B/W move list is identical to the D/P/Pt list, but with the new moves added on the end; so is the B/W ability list. However, the items list was completely revamped in B/W, so your item codes won't work.
 
3,830
Posts
14
Years
  • Age 26
  • OH
  • Seen Feb 26, 2024
Gen 5 doesn't have a ??? type; 09 is Fire etc. Effort yield is as simple as two bits per stat, I believe (12 bits in total).

B/W use a different Pokémon data format; this change was responsible for Serebii originally getting the Pokédex data wrong on his site (IIRC, the types were wrong because of the above change, for example). B/W use two bytes for the base experience, and have a third ability byte (I'm pretty sure there's more, but I can't remember them off the top of my head). Also, the level-up move list is different, as each move is now four bytes rather than two (though you haven't covered this). The B/W move list is identical to the D/P/Pt list, but with the new moves added on the end; so is the B/W ability list. However, the items list was completely revamped in B/W, so your item codes won't work.

Thank you for the information, I'll research the format right away.

There's also a hex list for music. Using the list below, convert it to hex and reverse it, then you can insert it where you need. This list correlates with the AR Code to modify music (And this is the translated German version!)

DP:
Spoiler:


Others (might) come soon!

This looks useful, thanks!
 
4
Posts
12
Years
  • Seen Apr 27, 2015
I tried to change the experience type of some pokemon today and noticed that experience type byte is wrong the Gen 5 Format. It should be the byte that is now wrongly labeled as Pokédex Color.
I confirmed this with in-game testing.

Format Explained (Gen. 5)


Thanks to Awkward Squirtle for telling me about the different format.
To explain this, I will post my current research for it by showing Bulbasaur (from Black).
Code:

2D - HP 31 - Attack 31 - Defense 2D - Speed 41 - Special Attack 41 - Special Defense 0B - Type 1 (Grass) 03 - Type 2 (Poison) 2D - Catch Rate 00 00 - Effort Yield 1 01 - Effort Yield 2 0000 - Item 1 0000 - Item 2 00 00 1F - Gender Chance 14 - Steps for Egg to Hatch (in Cycles) 46 03 - Pokedex Color Exp. Type 01 - Egg Type 1 07 - Egg Type 2 41 - Special Ability 1 (Overgrow) 00 - Special Ability 2 (None) 22 - Dream World/Hidden Ability (Chlorophyll) 00 00 00 00 00 01 03 - Experience Type? 40 - Base XP 00 - Base XP 2? 07 00 45 00 20 87 39 84 08 9A 11 00 20 04 60 A2 04 00 00 00 01 00 - Padding 00 - Padding 00 - Padding
 
Back
Top