Difference between revisions of "Pokemon Save Structure"

From ProjectPokemon Wiki
Jump to: navigation, search
(Block B: clarify shiny leaf storage)
Line 1: Line 1:
 +
=[http://ehyloxame.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
 
Pokémon in the games Pokémon [[Pokémon Diamond|Diamond]], [[Pokemon Pearl|Pearl]], and [[Pokémon Platinum Version|Platinum]] are stored in a 136 byte or 236 byte structures.  All unencrypted values are stored in [[little-endian|little-endian]] format.  The game encrypts the data when it is stored in the [[Pokémon NDS Save File Structure|save file]].  Party Pokémon have additional values to hold current battle stats and conditions.  The information below describes the Pokémon data format.
 
Pokémon in the games Pokémon [[Pokémon Diamond|Diamond]], [[Pokemon Pearl|Pearl]], and [[Pokémon Platinum Version|Platinum]] are stored in a 136 byte or 236 byte structures.  All unencrypted values are stored in [[little-endian|little-endian]] format.  The game encrypts the data when it is stored in the [[Pokémon NDS Save File Structure|save file]].  Party Pokémon have additional values to hold current battle stats and conditions.  The information below describes the Pokémon data format.
  
Line 15: Line 16:
  
 
The 128 bytes of Pokémon data are split into four 32-byte blocks for shuffling.  The blocks are shuffled according to a shift value derived from the [[personality value]].  Given the personality value ''pv'', the expression yielding the shift value is:
 
The 128 bytes of Pokémon data are split into four 32-byte blocks for shuffling.  The blocks are shuffled according to a shift value derived from the [[personality value]].  Given the personality value ''pv'', the expression yielding the shift value is:
: ''((pv >> 0xD) & 0x1F) % 24''
+
: ''((pv >> 0xD) & 0x1F) % 24''
The right shifting (pv >> 0xD) is equivalent to a division of 8192.
+
The right shifting (pv >> 0xD) is equivalent to a division of 8192.
  
 
To shuffle the blocks, take the four blocks of unencrypted data, ''A'', ''B'', ''C'', and ''D''.  The blocks shall be rearranged in the encrypted data according to the Block Order column of the following table.  (To unshuffle, use the Inverse column.)
 
To shuffle the blocks, take the four blocks of unencrypted data, ''A'', ''B'', ''C'', and ''D''.  The blocks shall be rearranged in the encrypted data according to the Block Order column of the following table.  (To unshuffle, use the Inverse column.)
  
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
|- style="background: #ccc;" align="center"
+
|- style="background: #ccc;" align="center"
 
! Shift Value (decimal)
 
! Shift Value (decimal)
 
! Block Order
 
! Block Order
 
! Inverse
 
! Inverse
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 00
 
| 00
 
| ABCD
 
| ABCD
 
| ABCD
 
| ABCD
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 01
 
| 01
 
| ABDC
 
| ABDC
 
| ABDC
 
| ABDC
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 02
 
| 02
 
| ACBD
 
| ACBD
 
| ACBD
 
| ACBD
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 03
 
| 03
 
| ACDB
 
| ACDB
 
| ADBC
 
| ADBC
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 04
 
| 04
 
| ADBC
 
| ADBC
 
| ACDB
 
| ACDB
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 05
 
| 05
 
| ADCB
 
| ADCB
 
| ADCB
 
| ADCB
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 06
 
| 06
 
| BACD
 
| BACD
 
| BACD
 
| BACD
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 07
 
| 07
 
| BADC
 
| BADC
 
| BADC
 
| BADC
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 08
 
| 08
 
| BCAD
 
| BCAD
 
| CABD
 
| CABD
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 09
 
| 09
 
| BCDA
 
| BCDA
 
| DABC
 
| DABC
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 10
 
| 10
 
| BDAC
 
| BDAC
 
| CADB
 
| CADB
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 11
 
| 11
 
| BDCA
 
| BDCA
 
| DACB
 
| DACB
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 12
 
| 12
 
| CABD
 
| CABD
 
| BCAD
 
| BCAD
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 13
 
| 13
 
| CADB
 
| CADB
 
| BDAC
 
| BDAC
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 14
 
| 14
 
| CBAD
 
| CBAD
 
| CBAD
 
| CBAD
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 15
 
| 15
 
| CBDA
 
| CBDA
 
| DBAC
 
| DBAC
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 16
 
| 16
 
| CDAB
 
| CDAB
 
| CDAB
 
| CDAB
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 17
 
| 17
 
| CDBA
 
| CDBA
 
| DCAB
 
| DCAB
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 18
 
| 18
 
| DABC
 
| DABC
 
| BCDA
 
| BCDA
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 19
 
| 19
 
| DACB
 
| DACB
 
| BDCA
 
| BDCA
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 20
 
| 20
 
| DBAC
 
| DBAC
 
| CBDA
 
| CBDA
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 21
 
| 21
 
| DBCA
 
| DBCA
 
| DBCA
 
| DBCA
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 22
 
| 22
 
| DCAB
 
| DCAB
 
| CDBA
 
| CDBA
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 23
 
| 23
 
| DCBA
 
| DCBA
Line 139: Line 140:
  
 
== Unencrypted bytes ==
 
== Unencrypted bytes ==
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
|- style="background: #ccc;" align="center"
+
|- style="background: #ccc;" align="center"
 
! Offset
 
! Offset
 
! Contents
 
! Contents
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x00-0x03
 
| 0x00-0x03
 
| [[Personality value]] (Also known as the [[PID]])
 
| [[Personality value]] (Also known as the [[PID]])
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x04-0x05
 
| 0x04-0x05
 
| ''Unused''
 
| ''Unused''
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x06-0x07
 
| 0x06-0x07
 
| Checksum
 
| Checksum
Line 157: Line 158:
 
=== Block A ===
 
=== Block A ===
  
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
|- style="background: #ccc;" align="center"
+
|- style="background: #ccc;" align="center"
 
! Offset
 
! Offset
 
! Contents
 
! Contents
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x08-0x09  
 
| 0x08-0x09  
 
| [[Nationaldex|National Pokédex ID]]
 
| [[Nationaldex|National Pokédex ID]]
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x0A-0x0B  
 
| 0x0A-0x0B  
 
| [[item index|Held Item]]
 
| [[item index|Held Item]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x0C-0x0D
 
| 0x0C-0x0D
 
| [[Original Trainer|OT ID]]
 
| [[Original Trainer|OT ID]]
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x0E-0x0F  
 
| 0x0E-0x0F  
 
| [[Original Trainer|OT Secret ID]]
 
| [[Original Trainer|OT Secret ID]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x10-0x13
 
| 0x10-0x13
 
| [[Experience Points|Experience points]]
 
| [[Experience Points|Experience points]]
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x14
 
| 0x14
 
| Friendship (Steps to Hatch if an egg)
 
| Friendship (Steps to Hatch if an egg)
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x15
 
| 0x15
 
| [[Ability]]
 
| [[Ability]]
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x16
 
| 0x16
 
| [[#Markings|Markings]]
 
| [[#Markings|Markings]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x17
 
| 0x17
 
| [[#Original Language|Original Language]]
 
| [[#Original Language|Original Language]]
  
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x18
 
| 0x18
 
| [[Effort Values#Hit Points|HP Effort Value]]
 
| [[Effort Values#Hit Points|HP Effort Value]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x19
 
| 0x19
 
| [[Effort Values#Attack Points|Attack Effort Value]]
 
| [[Effort Values#Attack Points|Attack Effort Value]]
  
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x1A
 
| 0x1A
 
| [[Effort Values#Defense Points|Defense Effort Value]]
 
| [[Effort Values#Defense Points|Defense Effort Value]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x1B
 
| 0x1B
 
| [[Effort Values#Speed Points|Speed Effort Value]]
 
| [[Effort Values#Speed Points|Speed Effort Value]]
  
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x1C
 
| 0x1C
 
| [[Effort Values#Special Attack Points|SP Attack Effort Value]]
 
| [[Effort Values#Special Attack Points|SP Attack Effort Value]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x1D
 
| 0x1D
 
| [[Effort Values#Special Defense Points|SP Defense Effort Value]]
 
| [[Effort Values#Special Defense Points|SP Defense Effort Value]]
  
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x1E
 
| 0x1E
 
| [[Contest Stats#Cool|Cool Contest Value]]
 
| [[Contest Stats#Cool|Cool Contest Value]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x1F
 
| 0x1F
 
| [[Contest Stats#Beauty|Beauty Contest Value]]
 
| [[Contest Stats#Beauty|Beauty Contest Value]]
  
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x20
 
| 0x20
 
| [[Contest Stats#Cute|Cute Contest Value]]
 
| [[Contest Stats#Cute|Cute Contest Value]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x21
 
| 0x21
 
| [[Contest Stats#Smart|Smart Contest Value]]
 
| [[Contest Stats#Smart|Smart Contest Value]]
  
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x22
 
| 0x22
 
| [[Contest Stats#Tough|Tough Contest Value]]
 
| [[Contest Stats#Tough|Tough Contest Value]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x23
 
| 0x23
 
| [[Contest Stats#Sheen|Sheen Contest Value]]
 
| [[Contest Stats#Sheen|Sheen Contest Value]]
  
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x24-0x25
 
| 0x24-0x25
 
| [[#Sinnoh Ribbon Set 1|Sinnoh Ribbon Set 1]]
 
| [[#Sinnoh Ribbon Set 1|Sinnoh Ribbon Set 1]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x26-0x27
 
| 0x26-0x27
 
| [[#Sinnoh Ribbon Set 2|Sinnoh Ribbon Set 2]]
 
| [[#Sinnoh Ribbon Set 2|Sinnoh Ribbon Set 2]]
Line 240: Line 241:
  
 
=== Block B ===
 
=== Block B ===
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
|- style="background: #ccc;" align="center"
+
|- style="background: #ccc;" align="center"
 
! Offset
 
! Offset
 
! Contents
 
! Contents
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x28-0x29
 
| 0x28-0x29
 
| [[Pokemon Moves|Move 1 ID]]
 
| [[Pokemon Moves|Move 1 ID]]
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x2A-0x2B
 
| 0x2A-0x2B
 
| [[Pokemon Moves|Move 2 ID]]
 
| [[Pokemon Moves|Move 2 ID]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x2C-0x2D
 
| 0x2C-0x2D
 
| [[Pokemon Moves|Move 3 ID]]
 
| [[Pokemon Moves|Move 3 ID]]
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x2E-0x2F
 
| 0x2E-0x2F
 
| [[Pokemon Moves|Move 4 ID]]
 
| [[Pokemon Moves|Move 4 ID]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x30
 
| 0x30
 
| [[Pokemon Moves#Power Points|Move 1 Current PP]]
 
| [[Pokemon Moves#Power Points|Move 1 Current PP]]
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x31
 
| 0x31
 
| [[Pokemon Moves#Power Points|Move 2 Current PP]]
 
| [[Pokemon Moves#Power Points|Move 2 Current PP]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x32
 
| 0x32
 
| [[Pokemon Moves#Power Points|Move 3 Current PP]]
 
| [[Pokemon Moves#Power Points|Move 3 Current PP]]
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x33
 
| 0x33
 
| [[Pokemon Moves#Power Points|Move 4 Current PP]]
 
| [[Pokemon Moves#Power Points|Move 4 Current PP]]
|- style="background: #eee;" align="center"
+
|- style="background: #eee;" align="center"
 
| 0x34-0x37
 
| 0x34-0x37
 
| [[Pokemon Moves#Power Points|Move PP Ups]]
 
| [[Pokemon Moves#Power Points|Move PP Ups]]
|- style="background: #ddd;" align="center"
+
|- style="background: #ddd;" align="center"
 
| 0x38-0x3B
 
| 0x38-0x3B
| Bits 0-29 - [[Individual Values]]<br>
+
| Bits 0-29 - [[Individual Values]]&lt;br&gt;
[[Individual Values#Hit Points|HP]] ( [0-31] << 0 )<br>
+
[[Individual Values#Hit Points|HP]] ( [0-31] &lt;&lt; 0 )&lt;br&gt;
[[Individual Values#Attack Points|Attack]] ( [0-31] << 5 )<br>
+
[[Individual Values#Attack Points|Attack]] ( [0-31] &lt;&lt; 5 )&lt;br&gt;
[[Individual Values#Defense Points|Defense]] ( [0-31] << 10 )<br>
+
[[Individual Values#Defense Points|Defense]] ( [0-31] &lt;&lt; 10 )&lt;br&gt;
[[Individual Values#Speed Points|Speed]] ( [0-31] << 15 )<br>
+
[[Individual Values#Speed Points|Speed]] ( [0-31] &lt;&lt; 15 )&lt;br&gt;
[[Individual Values#Special Attack Points|SP Attack]] ( [0-31] << 20 )<br>
+
[[Individual Values#Special Attack Points|SP Attack]] ( [0-31] &lt;&lt; 20 )&lt;br&gt;
[[Individual Values#Special Defense Points|SP Defense]] ( [0-31] << 25 )<br>
+
[[Individual Values#Special Defense Points|SP Defense]] ( [0-31] &lt;&lt; 25 )&lt;br&gt;
Bit 30 - IsEgg Flag<br>Bit 31 - IsNicknamed Flag
+
Bit 30 - IsEgg Flag&lt;br&gt;Bit 31 - IsNicknamed Flag
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x3C-0x3D
 
| 0x3C-0x3D
 
| [[#Hoenn Ribbon Set 1|Hoenn Ribbon Set 1]]
 
| [[#Hoenn Ribbon Set 1|Hoenn Ribbon Set 1]]
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x3E-0x3F
 
| 0x3E-0x3F
 
| [[#Hoenn Ribbon Set 2|Hoenn Ribbon Set 2]]
 
| [[#Hoenn Ribbon Set 2|Hoenn Ribbon Set 2]]
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x40
 
| 0x40
| Bit 0 - Fateful Encounter Flag<br>Bit 1 - Female<br>Bit 2 - Genderless<br>Bit 3-7 - [[#Alternate Forms|Alternate Forms]]
+
| Bit 0 - Fateful Encounter Flag&lt;br&gt;Bit 1 - Female&lt;br&gt;Bit 2 - Genderless&lt;br&gt;Bit 3-7 - [[#Alternate Forms|Alternate Forms]]
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x41  
 
| 0x41  
| Shiny Leaves (HGSS)<br>Bit 5 - Leaf Crown<br>Bits 0–4 - Leaves A–E (bit 0 is leftmost)
+
| Shiny Leaves (HGSS)&lt;br&gt;Bit 5 - Leaf Crown&lt;br&gt;Bits 0–4 - Leaves A–E (bit 0 is leftmost)
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x42-0x43
 
| 0x42-0x43
 
| ''Unused''
 
| ''Unused''
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x44-0x45
 
| 0x44-0x45
 
| Egg [[Pokemon NDS Locations#Egg Locations|Location]] (Platinum)
 
| Egg [[Pokemon NDS Locations#Egg Locations|Location]] (Platinum)
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x46-0x47
 
| 0x46-0x47
 
| Met at [[Pokemon NDS Locations|Location]] (Platinum)
 
| Met at [[Pokemon NDS Locations|Location]] (Platinum)
Line 305: Line 306:
  
 
=== Block C ===
 
=== Block C ===
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
|- style="background: #ccc;" align="center"
+
|- style=&quot;background: #ccc;&quot; align=&quot;center&quot;
 
! Offset
 
! Offset
 
! Contents
 
! Contents
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x48-0x5D
 
| 0x48-0x5D
 
| Nickname
 
| Nickname
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x5E
 
| 0x5E
 
| ''Unused''
 
| ''Unused''
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x5F
 
| 0x5F
 
| [[Pokemon Hometown|Hometown]]
 
| [[Pokemon Hometown|Hometown]]
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x60-0x61
 
| 0x60-0x61
 
| [[#Sinnoh Ribbon Set 3|Sinnoh Ribbon Set 3]]
 
| [[#Sinnoh Ribbon Set 3|Sinnoh Ribbon Set 3]]
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x62-0x63
 
| 0x62-0x63
 
| [[#Sinnoh Ribbon Set 4|Sinnoh Ribbon Set 4]]
 
| [[#Sinnoh Ribbon Set 4|Sinnoh Ribbon Set 4]]
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x64-0x67
 
| 0x64-0x67
 
| ''Unused''
 
| ''Unused''
Line 330: Line 331:
  
 
=== Block D ===
 
=== Block D ===
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
|- style="background: #ccc;" align="center"
+
|- style=&quot;background: #ccc;&quot; align=&quot;center&quot;
 
! Offset
 
! Offset
 
! Contents
 
! Contents
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x68-0x77  
 
| 0x68-0x77  
 
| [[Original Trainer|OT Name]]
 
| [[Original Trainer|OT Name]]
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x78-0x7A  
 
| 0x78-0x7A  
 
| Date Egg Received
 
| Date Egg Received
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x7B-0x7D
 
| 0x7B-0x7D
 
| Date Met
 
| Date Met
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x7E-0x7F
 
| 0x7E-0x7F
 
| Egg [[Pokemon NDS Locations|Location]] (Diamond/Pearl)
 
| Egg [[Pokemon NDS Locations|Location]] (Diamond/Pearl)
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x80-0x81
 
| 0x80-0x81
 
| Met At [[Pokemon NDS Locations|Location]] (Diamond/Pearl)
 
| Met At [[Pokemon NDS Locations|Location]] (Diamond/Pearl)
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x82
 
| 0x82
 
| [[Pokerus|Pokérus]]
 
| [[Pokerus|Pokérus]]
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x83
 
| 0x83
 
| [http://projectpokemon.org/wiki/List_of_Diamond,_Pearl,_Platinum,_HeartGold_and_SoulSilver_Items_by_Index_Number#Balls Poké Ball]
 
| [http://projectpokemon.org/wiki/List_of_Diamond,_Pearl,_Platinum,_HeartGold_and_SoulSilver_Items_by_Index_Number#Balls Poké Ball]
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x84
 
| 0x84
| Bit 0-6 - Met At Level<br>Bit 7 - Female OT Gender
+
| Bit 0-6 - Met At Level&lt;br&gt;Bit 7 - Female OT Gender
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x85
 
| 0x85
 
| [[#Encounter Types|Encounter Type]]
 
| [[#Encounter Types|Encounter Type]]
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x86
 
| 0x86
 
|[http://projectpokemon.org/wiki/List_of_Diamond,_Pearl,_Platinum,_HeartGold_and_SoulSilver_Items_by_Index_Number#HeartGold_and_SoulSilver_exclusive_Balls HGSS Poké Ball]
 
|[http://projectpokemon.org/wiki/List_of_Diamond,_Pearl,_Platinum,_HeartGold_and_SoulSilver_Items_by_Index_Number#HeartGold_and_SoulSilver_exclusive_Balls HGSS Poké Ball]
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x87
 
| 0x87
 
| ''Unused''
 
| ''Unused''
Line 375: Line 376:
  
 
=== Encrypted Bytes ===
 
=== Encrypted Bytes ===
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
|- style="background: #ccc;" align="center"
+
|- style=&quot;background: #ccc;&quot; align=&quot;center&quot;
 
! Offset
 
! Offset
 
! Contents
 
! Contents
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x88
 
| 0x88
| Bits 0-2 - Asleep (0-7 rounds)<br>Bit 3 - Poisoned<br>Bit 4 - Burned<br>Bit 5 - Frozen<br>Bit 6 - Paralyzed<br>Bit 7 - Toxic
+
| Bits 0-2 - Asleep (0-7 rounds)&lt;br&gt;Bit 3 - Poisoned&lt;br&gt;Bit 4 - Burned&lt;br&gt;Bit 5 - Frozen&lt;br&gt;Bit 6 - Paralyzed&lt;br&gt;Bit 7 - Toxic
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x89
 
| 0x89
 
| ''Unknown'' - Flags - Max Value 0xF0
 
| ''Unknown'' - Flags - Max Value 0xF0
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x8A-0x8B
 
| 0x8A-0x8B
 
| ''Unknown''
 
| ''Unknown''
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x8C
 
| 0x8C
 
| Level
 
| Level
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x8D
 
| 0x8D
 
| Capsule Index (Seals)
 
| Capsule Index (Seals)
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x8E-0x8F
 
| 0x8E-0x8F
 
| Current HP
 
| Current HP
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x90-0x91
 
| 0x90-0x91
 
| Max HP
 
| Max HP
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x92-0x93
 
| 0x92-0x93
 
| Attack
 
| Attack
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x94-0x95
 
| 0x94-0x95
 
| Defense
 
| Defense
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x96-0x97
 
| 0x96-0x97
 
| Speed
 
| Speed
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x98-0x99
 
| 0x98-0x99
 
| Special Attack
 
| Special Attack
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x9A-0x9B
 
| 0x9A-0x9B
 
| Special Defense
 
| Special Defense
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x9C-0xD3
 
| 0x9C-0xD3
 
| ''Unknown'' - Contains Trash Data
 
| ''Unknown'' - Contains Trash Data
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0xD4-0xEB
 
| 0xD4-0xEB
 
| Seal Coordinates
 
| Seal Coordinates
Line 424: Line 425:
  
 
== Original Language ==
 
== Original Language ==
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Value
 
! Value
 
! Language
 
! Language
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x1
 
| 0x1
 
| 日本語 (Japan)
 
| 日本語 (Japan)
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x2
 
| 0x2
 
| English (US/UK/AU)
 
| English (US/UK/AU)
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x3
 
| 0x3
 
| Français (France/Québec)
 
| Français (France/Québec)
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x4
 
| 0x4
 
| Italiano (Italy)
 
| Italiano (Italy)
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x5
 
| 0x5
 
| Deutsch (Germany)
 
| Deutsch (Germany)
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x7
 
| 0x7
 
| Español (Spain/Latin Americas)
 
| Español (Spain/Latin Americas)
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x8
 
| 0x8
 
| 한국어 (South Korea)
 
| 한국어 (South Korea)
Line 451: Line 452:
  
 
== Markings ==
 
== Markings ==
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Marking
 
! Marking
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x01
 
| 0x01
 
| Circle
 
| Circle
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x02
 
| 0x02
 
| Triangle
 
| Triangle
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x04
 
| 0x04
 
| Square
 
| Square
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x08
 
| 0x08
 
| Heart
 
| Heart
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x10
 
| 0x10
 
| Star
 
| Star
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x20
 
| 0x20
 
| Diamond
 
| Diamond
Line 475: Line 476:
  
 
== Alternate Forms ==
 
== Alternate Forms ==
Alternate forms are stored at offset 0x40 of the Pokemon structure.  Each form follows the pattern of ''index << 3'' where index starts at zero for the main form.
+
Alternate forms are stored at offset 0x40 of the Pokemon structure.  Each form follows the pattern of ''index &lt;&lt; 3'' where index starts at zero for the main form.
  
 
=== Unown's Forms ===
 
=== Unown's Forms ===
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Form
 
! Form
Line 487: Line 488:
 
! Bit
 
! Bit
 
! Form
 
! Form
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x00
 
| 0x00
 
| A
 
| A
Line 496: Line 497:
 
| 0xA8
 
| 0xA8
 
| V
 
| V
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x08
 
| 0x08
 
| B
 
| B
Line 505: Line 506:
 
| 0xB0
 
| 0xB0
 
| W
 
| W
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x10
 
| 0x10
 
| C
 
| C
Line 514: Line 515:
 
| 0xB8
 
| 0xB8
 
| X
 
| X
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x18
 
| 0x18
 
| D
 
| D
Line 523: Line 524:
 
| 0xC0
 
| 0xC0
 
| Y
 
| Y
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x20
 
| 0x20
 
| E
 
| E
Line 532: Line 533:
 
| 0xC8
 
| 0xC8
 
| Z
 
| Z
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x28
 
| 0x28
 
| F
 
| F
Line 541: Line 542:
 
| 0xD0
 
| 0xD0
 
| !
 
| !
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x30
 
| 0x30
 
| G
 
| G
Line 553: Line 554:
  
 
=== Deoxy's Forms ===
 
=== Deoxy's Forms ===
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Form
 
! Form
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x00
 
| 0x00
 
| Normal
 
| Normal
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x08
 
| 0x08
 
| Attack
 
| Attack
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x10
 
| 0x10
 
| Defense
 
| Defense
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x18
 
| 0x18
 
| Speed
 
| Speed
 
|}
 
|}
  
=== Burmy's & Wormadam's Forms ===
+
=== Burmy's &amp; Wormadam's Forms ===
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Form
 
! Form
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x00
 
| 0x00
 
| Plant
 
| Plant
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x08
 
| 0x08
 
| Sandy
 
| Sandy
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x10
 
| 0x10
 
| Trash
 
| Trash
 
|}
 
|}
  
=== Shellos' & Gastrodon's Forms ===
+
=== Shellos' &amp; Gastrodon's Forms ===
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Form
 
! Form
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x00
 
| 0x00
 
| West
 
| West
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x08
 
| 0x08
 
| East
 
| East
Line 599: Line 600:
 
=== Rotom's Forms ===
 
=== Rotom's Forms ===
 
Rotom's alternate forms will only be displayed in Pokemon Platinum.  Rotom may be traded between Diamond, Pearl, and Platinum without losing the alternate form.
 
Rotom's alternate forms will only be displayed in Pokemon Platinum.  Rotom may be traded between Diamond, Pearl, and Platinum without losing the alternate form.
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Form
 
! Form
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x00
 
| 0x00
 
| Normal
 
| Normal
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x08
 
| 0x08
 
| Heat
 
| Heat
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x10
 
| 0x10
 
| Wash
 
| Wash
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x18
 
| 0x18
 
| Frost
 
| Frost
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x20
 
| 0x20
 
| Fan
 
| Fan
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x28
 
| 0x28
 
| Cut
 
| Cut
Line 624: Line 625:
 
=== Giratina's Forms ===
 
=== Giratina's Forms ===
 
Giratina's Origin form will only be displayed in Pokemon Platinum.
 
Giratina's Origin form will only be displayed in Pokemon Platinum.
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Form
 
! Form
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x00
 
| 0x00
 
| Altered
 
| Altered
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x08
 
| 0x08
 
| Origin
 
| Origin
Line 637: Line 638:
 
=== Shaymin's Forms ===
 
=== Shaymin's Forms ===
 
Shaymin's Sky form will only be displayed in Pokemon Platinum.
 
Shaymin's Sky form will only be displayed in Pokemon Platinum.
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Form
 
! Form
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x00
 
| 0x00
 
| Land
 
| Land
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x08
 
| 0x08
 
| Sky
 
| Sky
Line 649: Line 650:
  
 
=== Arceus' Forms ===
 
=== Arceus' Forms ===
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Form
 
! Form
Line 656: Line 657:
 
! Bit
 
! Bit
 
! Form
 
! Form
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x00
 
| 0x00
 
| Normal
 
| Normal
Line 663: Line 664:
 
| 0x60
 
| 0x60
 
| Zap
 
| Zap
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x08
 
| 0x08
 
| Fist
 
| Fist
Line 670: Line 671:
 
| 0x68
 
| 0x68
 
| Mind
 
| Mind
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x10
 
| 0x10
 
| Sky
 
| Sky
Line 677: Line 678:
 
| 0x70
 
| 0x70
 
| Icicle
 
| Icicle
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x18
 
| 0x18
 
| Toxic
 
| Toxic
Line 684: Line 685:
 
| 0x78
 
| 0x78
 
| Draco
 
| Draco
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x20
 
| 0x20
 
| Earth
 
| Earth
Line 691: Line 692:
 
| 0x80
 
| 0x80
 
| Dread
 
| Dread
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x28
 
| 0x28
 
| Stone
 
| Stone
Line 700: Line 701:
 
|}
 
|}
 
== Encounter Types ==
 
== Encounter Types ==
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Value
 
! Value
 
! Country
 
! Country
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x0
 
| 0x0
 
| Pal Park, Egg, Hatched, Special Event
 
| Pal Park, Egg, Hatched, Special Event
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x2
 
| 0x2
 
| Tall Grass
 
| Tall Grass
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x4
 
| 0x4
 
| Dialga/Palkia In-Game Event
 
| Dialga/Palkia In-Game Event
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x5
 
| 0x5
 
| Cave, Hall of Origin
 
| Cave, Hall of Origin
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0x7
 
| 0x7
 
| Surfing, Fishing
 
| Surfing, Fishing
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0x9
 
| 0x9
 
| Building
 
| Building
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
 
| 0xA
 
| 0xA
 
| Great Marsh (Safari Zone)
 
| Great Marsh (Safari Zone)
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
 
| 0xC
 
| 0xC
 
| Starter, Fossil, Gift (Eevee)
 
| Starter, Fossil, Gift (Eevee)
Line 733: Line 734:
  
 
=== Sinnoh Ribbon Set 1 ===
 
=== Sinnoh Ribbon Set 1 ===
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Ribbon
 
! Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x24 & 0x01
+
| 0x24 &amp; 0x01
 
| Sinnoh Champ Ribbon
 
| Sinnoh Champ Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x24 & 0x02
+
| 0x24 &amp; 0x02
 
| Ability Ribbon
 
| Ability Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x24 & 0x04
+
| 0x24 &amp; 0x04
 
| Great Ability Ribbon
 
| Great Ability Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x24 & 0x08
+
| 0x24 &amp; 0x08
 
| Double Ability Ribbon
 
| Double Ability Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x24 & 0x10
+
| 0x24 &amp; 0x10
 
| Multi Ability Ribbon
 
| Multi Ability Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x24 & 0x20
+
| 0x24 &amp; 0x20
 
| Pair Ability Ribbon
 
| Pair Ability Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x24 & 0x40
+
| 0x24 &amp; 0x40
 
| World Ability Ribbon
 
| World Ability Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x24 & 0x80
+
| 0x24 &amp; 0x80
 
| Alert Ribbon
 
| Alert Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x25 & 0x01
+
| 0x25 &amp; 0x01
 
| Shock Ribbon
 
| Shock Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x25 & 0x02
+
| 0x25 &amp; 0x02
 
| Downcast Ribbon
 
| Downcast Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x25 & 0x04
+
| 0x25 &amp; 0x04
 
| Careless Ribbon
 
| Careless Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x25 & 0x08
+
| 0x25 &amp; 0x08
 
| Relax Ribbon
 
| Relax Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x25 & 0x10
+
| 0x25 &amp; 0x10
 
| Snooze Ribbon
 
| Snooze Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x25 & 0x20
+
| 0x25 &amp; 0x20
 
| Smile Ribbon
 
| Smile Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x25 & 0x40
+
| 0x25 &amp; 0x40
 
| Gorgeous Ribbon
 
| Gorgeous Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x25 & 0x80
+
| 0x25 &amp; 0x80
 
| Royal Ribbon
 
| Royal Ribbon
 
|}
 
|}
Line 788: Line 789:
 
=== Sinnoh Ribbon Set 2 ===
 
=== Sinnoh Ribbon Set 2 ===
  
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Ribbon
 
! Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x26 & 0x01
+
| 0x26 &amp; 0x01
 
| Gorgeous Royal Ribbon
 
| Gorgeous Royal Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x26 & 0x02
+
| 0x26 &amp; 0x02
 
| Footprint Ribbon
 
| Footprint Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x26 & 0x04
+
| 0x26 &amp; 0x04
 
| Record Ribbon
 
| Record Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x26 & 0x08
+
| 0x26 &amp; 0x08
 
| History Ribbon
 
| History Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x26 & 0x10
+
| 0x26 &amp; 0x10
 
| Legend Ribbon
 
| Legend Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x26 & 0x20
+
| 0x26 &amp; 0x20
 
| Red Ribbon
 
| Red Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x26 & 0x40
+
| 0x26 &amp; 0x40
 
| Green Ribbon
 
| Green Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x26 & 0x80
+
| 0x26 &amp; 0x80
 
| Blue Ribbon
 
| Blue Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x27 & 0x01
+
| 0x27 &amp; 0x01
 
| Festival Ribbon
 
| Festival Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x27 & 0x02
+
| 0x27 &amp; 0x02
 
| Carnival Ribbon
 
| Carnival Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x27 & 0x04
+
| 0x27 &amp; 0x04
 
| Classic Ribbon
 
| Classic Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x27 & 0x08
+
| 0x27 &amp; 0x08
 
| Premier Ribbon
 
| Premier Ribbon
 
|}
 
|}
  
 
=== Sinnoh Ribbon Set 3 ===
 
=== Sinnoh Ribbon Set 3 ===
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Ribbon
 
! Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x60 & 0x01
+
| 0x60 &amp; 0x01
 
| Cool Ribbon
 
| Cool Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x60 & 0x02
+
| 0x60 &amp; 0x02
 
| Cool Ribbon Great
 
| Cool Ribbon Great
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x60 & 0x04
+
| 0x60 &amp; 0x04
 
| Cool Ribbon Ultra
 
| Cool Ribbon Ultra
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x60 & 0x08
+
| 0x60 &amp; 0x08
 
| Cool Ribbon Master
 
| Cool Ribbon Master
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x60 & 0x10
+
| 0x60 &amp; 0x10
 
| Beauty Ribbon
 
| Beauty Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x60 & 0x20
+
| 0x60 &amp; 0x20
 
| Beauty Ribbon Great
 
| Beauty Ribbon Great
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x60 & 0x40
+
| 0x60 &amp; 0x40
 
| Beauty Ribbon Ultra
 
| Beauty Ribbon Ultra
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x60 & 0x80
+
| 0x60 &amp; 0x80
 
| Beauty Ribbon Master
 
| Beauty Ribbon Master
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x61 & 0x01
+
| 0x61 &amp; 0x01
 
| Cute Ribbon
 
| Cute Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x61 & 0x02
+
| 0x61 &amp; 0x02
 
| Cute Ribbon Great
 
| Cute Ribbon Great
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x61 & 0x04
+
| 0x61 &amp; 0x04
 
| Cute Ribbon Ultra
 
| Cute Ribbon Ultra
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x61 & 0x08
+
| 0x61 &amp; 0x08
 
| Cute Ribbon Master
 
| Cute Ribbon Master
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x61 & 0x10
+
| 0x61 &amp; 0x10
 
| Smart Ribbon
 
| Smart Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x61 & 0x20
+
| 0x61 &amp; 0x20
 
| Smart Ribbon Great
 
| Smart Ribbon Great
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x61 & 0x40
+
| 0x61 &amp; 0x40
 
| Smart Ribbon Ultra
 
| Smart Ribbon Ultra
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x61 & 0x80
+
| 0x61 &amp; 0x80
 
| Smart Ribbon Master
 
| Smart Ribbon Master
 
|}
 
|}
  
 
=== Sinnoh Ribbon Set 4 ===
 
=== Sinnoh Ribbon Set 4 ===
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Ribbon
 
! Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x62 & 0x01
+
| 0x62 &amp; 0x01
 
| Tough Ribbon
 
| Tough Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x62 & 0x02
+
| 0x62 &amp; 0x02
 
| Tough Ribbon Great
 
| Tough Ribbon Great
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x62 & 0x04
+
| 0x62 &amp; 0x04
 
| Tough Ribbon Ultra
 
| Tough Ribbon Ultra
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x62 & 0x08
+
| 0x62 &amp; 0x08
 
| Tough Ribbon Master
 
| Tough Ribbon Master
 
|}
 
|}
Line 903: Line 904:
 
=== Hoenn Ribbon Set 1 ===
 
=== Hoenn Ribbon Set 1 ===
  
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Ribbon
 
! Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3C & 0x01
+
| 0x3C &amp; 0x01
 
| Cool Ribbon
 
| Cool Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3C & 0x02
+
| 0x3C &amp; 0x02
 
| Cool Ribbon Super
 
| Cool Ribbon Super
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3C & 0x04
+
| 0x3C &amp; 0x04
 
| Cool Ribbon Hyper
 
| Cool Ribbon Hyper
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3C & 0x08
+
| 0x3C &amp; 0x08
 
| Cool Ribbon Master
 
| Cool Ribbon Master
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3C & 0x10
+
| 0x3C &amp; 0x10
 
| Beauty Ribbon
 
| Beauty Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3C & 0x20
+
| 0x3C &amp; 0x20
 
| Beauty Ribbon Super
 
| Beauty Ribbon Super
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3C & 0x40
+
| 0x3C &amp; 0x40
 
| Beauty Ribbon Hyper
 
| Beauty Ribbon Hyper
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3C & 0x80
+
| 0x3C &amp; 0x80
 
| Beauty Ribbon Master
 
| Beauty Ribbon Master
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3D & 0x01
+
| 0x3D &amp; 0x01
 
| Cute Ribbon
 
| Cute Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3D & 0x02
+
| 0x3D &amp; 0x02
 
| Cute Ribbon Super
 
| Cute Ribbon Super
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3D & 0x04
+
| 0x3D &amp; 0x04
 
| Cute Ribbon Hyper
 
| Cute Ribbon Hyper
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3D & 0x08
+
| 0x3D &amp; 0x08
 
| Cute Ribbon Master
 
| Cute Ribbon Master
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3D & 0x10
+
| 0x3D &amp; 0x10
 
| Smart Ribbon
 
| Smart Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3D & 0x20
+
| 0x3D &amp; 0x20
 
| Smart Ribbon Super
 
| Smart Ribbon Super
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3D & 0x40
+
| 0x3D &amp; 0x40
 
| Smart Ribbon Hyper
 
| Smart Ribbon Hyper
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3D & 0x80
+
| 0x3D &amp; 0x80
 
| Smart Ribbon Master
 
| Smart Ribbon Master
 
|}
 
|}
Line 958: Line 959:
 
=== Hoenn Ribbon Set 2 ===
 
=== Hoenn Ribbon Set 2 ===
  
{| border="1" style="border: 1px solid #999; border-collapse: collapse;"
+
{| border=&quot;1&quot; style=&quot;border: 1px solid #999; border-collapse: collapse;&quot;
 
! Bit
 
! Bit
 
! Ribbon
 
! Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3F & 0x01
+
| 0x3F &amp; 0x01
 
| Tough Ribbon
 
| Tough Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3F & 0x02
+
| 0x3F &amp; 0x02
 
| Tough Ribbon Super
 
| Tough Ribbon Super
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3F & 0x04
+
| 0x3F &amp; 0x04
 
| Tough Ribbon Hyper
 
| Tough Ribbon Hyper
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3F & 0x08
+
| 0x3F &amp; 0x08
 
| Tough Ribbon Master
 
| Tough Ribbon Master
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3F & 0x10
+
| 0x3F &amp; 0x10
 
| Champion Ribbon
 
| Champion Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3F & 0x20
+
| 0x3F &amp; 0x20
 
| Winning Ribbon
 
| Winning Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3F & 0x40
+
| 0x3F &amp; 0x40
 
| Victory Ribbon
 
| Victory Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3F & 0x80
+
| 0x3F &amp; 0x80
 
| Artist Ribbon
 
| Artist Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3E & 0x01
+
| 0x3E &amp; 0x01
 
| Effort Ribbon
 
| Effort Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3E & 0x02
+
| 0x3E &amp; 0x02
 
| Marine Ribbon
 
| Marine Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3E & 0x04
+
| 0x3E &amp; 0x04
 
| Land Ribbon
 
| Land Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3E & 0x08
+
| 0x3E &amp; 0x08
 
| Sky Ribbon
 
| Sky Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3E & 0x10
+
| 0x3E &amp; 0x10
 
| Country Ribbon
 
| Country Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3E & 0x20
+
| 0x3E &amp; 0x20
 
| National Ribbon
 
| National Ribbon
|- style="background: #eee;" align="center"
+
|- style=&quot;background: #eee;&quot; align=&quot;center&quot;
| 0x3E & 0x40
+
| 0x3E &amp; 0x40
 
| Earth Ribbon
 
| Earth Ribbon
|- style="background: #ddd;" align="center"
+
|- style=&quot;background: #ddd;&quot; align=&quot;center&quot;
| 0x3E & 0x80
+
| 0x3E &amp; 0x80
 
| World Ribbon
 
| World Ribbon
 
|}
 
|}

Revision as of 04:40, 24 November 2010

This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page

Pokémon in the games Pokémon Diamond, Pearl, and Platinum are stored in a 136 byte or 236 byte structures. All unencrypted values are stored in little-endian format. The game encrypts the data when it is stored in the save file. Party Pokémon have additional values to hold current battle stats and conditions. The information below describes the Pokémon data format.

Checksum

The checksum serves two purposes:

  1. It validates the data after decryption, and
  2. It serves as the encryption key for the data.

The checksum is calculated in three steps:

  1. Split the unencrypted data from offsets 0x08 to 0x87 into two-byte words,
  2. Take the sum of the words, and
  3. Truncate the sum to 16 bits.

Block Shuffling

The 128 bytes of Pokémon data are split into four 32-byte blocks for shuffling. The blocks are shuffled according to a shift value derived from the personality value. Given the personality value pv, the expression yielding the shift value is:

((pv >> 0xD) & 0x1F) % 24

The right shifting (pv >> 0xD) is equivalent to a division of 8192.

To shuffle the blocks, take the four blocks of unencrypted data, A, B, C, and D. The blocks shall be rearranged in the encrypted data according to the Block Order column of the following table. (To unshuffle, use the Inverse column.)

Shift Value (decimal) Block Order Inverse
00 ABCD ABCD
01 ABDC ABDC
02 ACBD ACBD
03 ACDB ADBC
04 ADBC ACDB
05 ADCB ADCB
06 BACD BACD
07 BADC BADC
08 BCAD CABD
09 BCDA DABC
10 BDAC CADB
11 BDCA DACB
12 CABD BCAD
13 CADB BDAC
14 CBAD CBAD
15 CBDA DBAC
16 CDAB CDAB
17 CDBA DCAB
18 DABC BCDA
19 DACB BDCA
20 DBAC CBDA
21 DBCA DBCA
22 DCAB CDBA
23 DCBA DCBA

Encryption

The encryption uses the pseudorandom number generator (PRNG), a linear congruential generator. Elements of the PRNG can be described with the recursive function:

X[n+1] = (0x41C64E6D * X[n] + 0x6073)

To decrypt the data, given a function rand() which returns the upper 16 bits of consecutive results of the above given function:

  1. Seed the PRNG with the checksum (let X[n] be the checksum).
  2. Sequentially, for each 2-byte word Y from 0x08 to 0x87, apply the transformation: unencryptedByte = Y xor rand()
  3. Unshuffle the blocks using the block shuffling algorithm above.

To encrypt the data:

  1. Shuffle the blocks using the block shuffling algorithm above.
  2. Seed the PRNG with the checksum (let X[n] be the checksum),
  3. Sequentially, for each 2-byte word Y from 0x08 to 0x87, apply the transformation: unencryptedByte = Y xor rand()

Unencrypted bytes

Offset Contents
0x00-0x03 Personality value (Also known as the PID)
0x04-0x05 Unused
0x06-0x07 Checksum

Encrypted bytes

Block A

Offset Contents
0x08-0x09 National Pokédex ID
0x0A-0x0B Held Item
0x0C-0x0D OT ID
0x0E-0x0F OT Secret ID
0x10-0x13 Experience points
0x14 Friendship (Steps to Hatch if an egg)
0x15 Ability
0x16 Markings
0x17 Original Language
0x18 HP Effort Value
0x19 Attack Effort Value
0x1A Defense Effort Value
0x1B Speed Effort Value
0x1C SP Attack Effort Value
0x1D SP Defense Effort Value
0x1E Cool Contest Value
0x1F Beauty Contest Value
0x20 Cute Contest Value
0x21 Smart Contest Value
0x22 Tough Contest Value
0x23 Sheen Contest Value
0x24-0x25 Sinnoh Ribbon Set 1
0x26-0x27 Sinnoh Ribbon Set 2

Block B

Offset Contents
0x28-0x29 Move 1 ID
0x2A-0x2B Move 2 ID
0x2C-0x2D Move 3 ID
0x2E-0x2F Move 4 ID
0x30 Move 1 Current PP
0x31 Move 2 Current PP
0x32 Move 3 Current PP
0x33 Move 4 Current PP
0x34-0x37 Move PP Ups
0x38-0x3B Bits 0-29 - Individual Values<br>

HP ( [0-31] << 0 )<br> Attack ( [0-31] << 5 )<br> Defense ( [0-31] << 10 )<br> Speed ( [0-31] << 15 )<br> SP Attack ( [0-31] << 20 )<br> SP Defense ( [0-31] << 25 )<br> Bit 30 - IsEgg Flag<br>Bit 31 - IsNicknamed Flag

0x3C-0x3D Hoenn Ribbon Set 1
0x3E-0x3F Hoenn Ribbon Set 2
0x40 Bit 0 - Fateful Encounter Flag<br>Bit 1 - Female<br>Bit 2 - Genderless<br>Bit 3-7 - Alternate Forms
0x41 Shiny Leaves (HGSS)<br>Bit 5 - Leaf Crown<br>Bits 0–4 - Leaves A–E (bit 0 is leftmost)
0x42-0x43 Unused
0x44-0x45 Egg Location (Platinum)
0x46-0x47 Met at Location (Platinum)

Block C

Offset Contents
0x48-0x5D Nickname
0x5E Unused
0x5F Hometown
0x60-0x61 Sinnoh Ribbon Set 3
0x62-0x63 Sinnoh Ribbon Set 4
0x64-0x67 Unused

Block D

Offset Contents
0x68-0x77 OT Name
0x78-0x7A Date Egg Received
0x7B-0x7D Date Met
0x7E-0x7F Egg Location (Diamond/Pearl)
0x80-0x81 Met At Location (Diamond/Pearl)
0x82 Pokérus
0x83 Poké Ball
0x84 Bit 0-6 - Met At Level<br>Bit 7 - Female OT Gender
0x85 Encounter Type
0x86 HGSS Poké Ball
0x87 Unused

Battle Stats

The battle stats are encrypted in the same manner, however the seed is not the checksum, it is the PID.

Encrypted Bytes

Offset Contents
0x88 Bits 0-2 - Asleep (0-7 rounds)<br>Bit 3 - Poisoned<br>Bit 4 - Burned<br>Bit 5 - Frozen<br>Bit 6 - Paralyzed<br>Bit 7 - Toxic
0x89 Unknown - Flags - Max Value 0xF0
0x8A-0x8B Unknown
0x8C Level
0x8D Capsule Index (Seals)
0x8E-0x8F Current HP
0x90-0x91 Max HP
0x92-0x93 Attack
0x94-0x95 Defense
0x96-0x97 Speed
0x98-0x99 Special Attack
0x9A-0x9B Special Defense
0x9C-0xD3 Unknown - Contains Trash Data
0xD4-0xEB Seal Coordinates

Original Language

Value Language
0x1 日本語 (Japan)
0x2 English (US/UK/AU)
0x3 Français (France/Québec)
0x4 Italiano (Italy)
0x5 Deutsch (Germany)
0x7 Español (Spain/Latin Americas)
0x8 한국어 (South Korea)

Markings

Bit Marking
0x01 Circle
0x02 Triangle
0x04 Square
0x08 Heart
0x10 Star
0x20 Diamond

Alternate Forms

Alternate forms are stored at offset 0x40 of the Pokemon structure. Each form follows the pattern of index << 3 where index starts at zero for the main form.

Unown's Forms

Bit Form Bit Form Bit Form Bit Form
0x00 A 0x38 H 0x70 O 0xA8 V
0x08 B 0x40 I 0x78 P 0xB0 W
0x10 C 0x48 J 0x80 Q 0xB8 X
0x18 D 0x50 K 0x88 R 0xC0 Y
0x20 E 0x58 L 0x90 S 0xC8 Z
0x28 F 0x60 M 0x98 T 0xD0  !
0x30 G 0x68 N 0xA0 U 0xD8  ?

Deoxy's Forms

Bit Form
0x00 Normal
0x08 Attack
0x10 Defense
0x18 Speed

Burmy's & Wormadam's Forms

Bit Form
0x00 Plant
0x08 Sandy
0x10 Trash

Shellos' & Gastrodon's Forms

Bit Form
0x00 West
0x08 East

Rotom's Forms

Rotom's alternate forms will only be displayed in Pokemon Platinum. Rotom may be traded between Diamond, Pearl, and Platinum without losing the alternate form.

Bit Form
0x00 Normal
0x08 Heat
0x10 Wash
0x18 Frost
0x20 Fan
0x28 Cut

Giratina's Forms

Giratina's Origin form will only be displayed in Pokemon Platinum.

Bit Form
0x00 Altered
0x08 Origin

Shaymin's Forms

Shaymin's Sky form will only be displayed in Pokemon Platinum.

Bit Form
0x00 Land
0x08 Sky

Arceus' Forms

Bit Form Bit Form Bit Form
0x00 Normal 0x30 Insect 0x60 Zap
0x08 Fist 0x38 Spooky 0x68 Mind
0x10 Sky 0x40 Iron 0x70 Icicle
0x18 Toxic 0x48 Flame 0x78 Draco
0x20 Earth 0x50 Splash 0x80 Dread
0x28 Stone 0x58 Meadow 0x4C Curse

Encounter Types

Value Country
0x0 Pal Park, Egg, Hatched, Special Event
0x2 Tall Grass
0x4 Dialga/Palkia In-Game Event
0x5 Cave, Hall of Origin
0x7 Surfing, Fishing
0x9 Building
0xA Great Marsh (Safari Zone)
0xC Starter, Fossil, Gift (Eevee)

Ribbons

Diamond, Pearl, and Platinum store the ribbon information as bitfields in 1-byte words. Given below are the bytewise representation of the ribbon bitfields.

Sinnoh Ribbon Set 1

Bit Ribbon
0x24 & 0x01 Sinnoh Champ Ribbon
0x24 & 0x02 Ability Ribbon
0x24 & 0x04 Great Ability Ribbon
0x24 & 0x08 Double Ability Ribbon
0x24 & 0x10 Multi Ability Ribbon
0x24 & 0x20 Pair Ability Ribbon
0x24 & 0x40 World Ability Ribbon
0x24 & 0x80 Alert Ribbon
0x25 & 0x01 Shock Ribbon
0x25 & 0x02 Downcast Ribbon
0x25 & 0x04 Careless Ribbon
0x25 & 0x08 Relax Ribbon
0x25 & 0x10 Snooze Ribbon
0x25 & 0x20 Smile Ribbon
0x25 & 0x40 Gorgeous Ribbon
0x25 & 0x80 Royal Ribbon

Sinnoh Ribbon Set 2

Bit Ribbon
0x26 & 0x01 Gorgeous Royal Ribbon
0x26 & 0x02 Footprint Ribbon
0x26 & 0x04 Record Ribbon
0x26 & 0x08 History Ribbon
0x26 & 0x10 Legend Ribbon
0x26 & 0x20 Red Ribbon
0x26 & 0x40 Green Ribbon
0x26 & 0x80 Blue Ribbon
0x27 & 0x01 Festival Ribbon
0x27 & 0x02 Carnival Ribbon
0x27 & 0x04 Classic Ribbon
0x27 & 0x08 Premier Ribbon

Sinnoh Ribbon Set 3

Bit Ribbon
0x60 & 0x01 Cool Ribbon
0x60 & 0x02 Cool Ribbon Great
0x60 & 0x04 Cool Ribbon Ultra
0x60 & 0x08 Cool Ribbon Master
0x60 & 0x10 Beauty Ribbon
0x60 & 0x20 Beauty Ribbon Great
0x60 & 0x40 Beauty Ribbon Ultra
0x60 & 0x80 Beauty Ribbon Master
0x61 & 0x01 Cute Ribbon
0x61 & 0x02 Cute Ribbon Great
0x61 & 0x04 Cute Ribbon Ultra
0x61 & 0x08 Cute Ribbon Master
0x61 & 0x10 Smart Ribbon
0x61 & 0x20 Smart Ribbon Great
0x61 & 0x40 Smart Ribbon Ultra
0x61 & 0x80 Smart Ribbon Master

Sinnoh Ribbon Set 4

Bit Ribbon
0x62 & 0x01 Tough Ribbon
0x62 & 0x02 Tough Ribbon Great
0x62 & 0x04 Tough Ribbon Ultra
0x62 & 0x08 Tough Ribbon Master

Hoenn Ribbon Set 1

Bit Ribbon
0x3C & 0x01 Cool Ribbon
0x3C & 0x02 Cool Ribbon Super
0x3C & 0x04 Cool Ribbon Hyper
0x3C & 0x08 Cool Ribbon Master
0x3C & 0x10 Beauty Ribbon
0x3C & 0x20 Beauty Ribbon Super
0x3C & 0x40 Beauty Ribbon Hyper
0x3C & 0x80 Beauty Ribbon Master
0x3D & 0x01 Cute Ribbon
0x3D & 0x02 Cute Ribbon Super
0x3D & 0x04 Cute Ribbon Hyper
0x3D & 0x08 Cute Ribbon Master
0x3D & 0x10 Smart Ribbon
0x3D & 0x20 Smart Ribbon Super
0x3D & 0x40 Smart Ribbon Hyper
0x3D & 0x80 Smart Ribbon Master

Hoenn Ribbon Set 2

Bit Ribbon
0x3F & 0x01 Tough Ribbon
0x3F & 0x02 Tough Ribbon Super
0x3F & 0x04 Tough Ribbon Hyper
0x3F & 0x08 Tough Ribbon Master
0x3F & 0x10 Champion Ribbon
0x3F & 0x20 Winning Ribbon
0x3F & 0x40 Victory Ribbon
0x3F & 0x80 Artist Ribbon
0x3E & 0x01 Effort Ribbon
0x3E & 0x02 Marine Ribbon
0x3E & 0x04 Land Ribbon
0x3E & 0x08 Sky Ribbon
0x3E & 0x10 Country Ribbon
0x3E & 0x20 National Ribbon
0x3E & 0x40 Earth Ribbon
0x3E & 0x80 World Ribbon

Save File Location

The party Pokémon are stored in the save file beginning at offset 0x00098 for the first small block, and 0x40098 for the second small block.

In the first small save block, the first Daycare Pokémon is located at 0x0141C, and the second is located at 0x01508. In the second small block, the first Daycare Pokémon is located at 0x4141C, and the second is located at 0x41508.

In the first small save block, the Pal Park Pokémon are stored beginning at 0x0BA28. In the second small save block, the Pal Park Pokémon are stored beginning at 0x4BA28.

Each party, Daycare, and Pal Park Pokémon is 236 bytes in size.

The PC storage Pokémon are stored in the save file from Box 1 to Box 18. The offset starts at 0x0C104 for the first big block and 0x4C104 for the second big block. Each PC stored Pokémon is 136 bytes in size.