原地址:http://projectpokemon.org/wiki/Pokemon_X/Y_3DS_Structure
Pokémon in the games Pokémon X and Y are stored in a new 232 byte structure (for the box data only). Party Pokémon hold 28 bytes of additional data for overworld and battle values. We recommend using the pk6 extension for decrypted 232-byte box data and 260-byte party data structures.
Contents
Checksum / Block Shuffling / Encryption
There have been some changes compared to the Generation 4 and Generation 5 structures. First, the LCRNG to decrypt the structure's blocks is now seeded with the Encryption Key at the beginning of the pk6 file. Second, the blocks are now 56 bytes instead of the previous 32. However, the way the blocks are shuffled based on the PID did not change. That said, the shuffling algorithm now uses the Encryption Key at the beginning of the pk6 instead of the PID.
Unencrypted Bytes (0x0-0x7)
Offset | Contents | 0x00-0x03 | Encryption Key | 0x04-0x05 | Sanity Placeholder | 0x06-0x07 | Checksum |
Encrypted Bytes
Block A (0x8-0x3F)
Block B (0x40-0x77)
Block C (0x78-0xAF)
Offset | Contents | 0x78-0x8F | Latest NotOT Handler
Updates Every Trade | 0x90-0x91 | Null Terminator | 0x92 | NotOT Gender
0 - Male
1 - Female | 0x93 | Current Handler
0 - OT
1 - NotOT | 0x94-0x95 | Geolocation 1 - (Region,Country) | 0x96-0x97 | Geolocation 2 - (Region,Country) | 0x98-0x99 | Geolocation 3 - (Region,Country) | 0x9A-0x9B | Geolocation 4 - (Region,Country) | 0x9C-0x9D | Geolocation 5 - (Region,Country) | 0x9E-0x9F | Unused | 0xA0-0xA1 | Unused | 0xA2 | NotOT Friendship | 0xA3 | NotOT Affection | 0xA4 | NotOT Memory Intensity | 0xA5 | NotOT Memory Line | 0xA6 | NotOT Memory Feeling | 0xA7 | Unused | 0xA8-0xA9 | NotOT Memory TextVar | 0xAA-0xAB | Unused | 0xAC-0xAD | Unused | 0xAE | Fullness | 0xAF | Enjoyment |
Block D (0xB0-0xE7)
Offset | Contents | 0xB0-0xC7 | OT Name | 0xC8-0xC9 | Null Terminator | 0xCA | OT Friendship | 0xCB | OT Affection | 0xCC | OT Memory Intensity | 0xCD | OT Memory Line | 0xCE-0xCF | OT Memory TextVar | 0xD0 | OT Memory Feeling | 0xD1-0xD3 | Date Egg Received | 0xD4-0xD6 | Date Met | 0xD7 | Unknown / Unused | 0xD8-0xD9 | Egg Location | 0xDA-0xDB | Met At Location | 0xDC | Pokéball | 0xDD | Bit 0-6 - Encounter Level
Bit 7 - Female OT Gender | 0xDE | Encounter Type (Gen 4) | 0xDF | OT Game ID | 0xE0 | Country ID | 0xE1 | Region ID | 0xE2 | 3DS Region ID | 0xE3 | OT Language ID | 0xE4-0xE7 | Unused |
Battle Stats
The battle stats are encrypted in the exact same manner as the main pk6 data. The seed is still the Encryption Key.
Encrypted Bytes
Offset | Contents | 0xE8 | Bits 0-2 - Asleep (0-7 rounds)
Bit 3 - Poisoned
Bit 4 - Burned
Bit 5 - Frozen
Bit 6 - Paralyzed
Bit 7 - Toxic | 0xE9 | Unknown - Flags | 0xEA-0xEB | Unknown / Unused | 0xEC | Level | 0xED | Unknown / Unused | 0xEE-0xEF | Unknown / Unused | 0xF0-0xF1 | Current HP | 0xF2-0xF3 | Max HP | 0xF4-0xF5 | Attack | 0xF6-0xF7 | Defense | 0xF8-0xF9 | Speed | 0xFA-0xFB | Special Attack | 0xFC-0xFD | Special Defense | 0xFE-0xFF | Unknown / Unused | 0x100-0x103 | Unknown / Unused |
Original Language
Value | Language | 0x1 | 日本語 (Japan) | 0x2 | English (US/UK/AU) | 0x3 | Francais (France/Québec) | 0x4 | Italiano (Italy) | 0x5 | Deutsch (Germany) | 0x7 | Espanol (Spain/Latin Americas) | 0x8 | 韓国語 (South Korea) |
Markings
Bit | Marking | 0x01 | Circle | 0x02 | Triangle | 0x04 | Square | 0x08 | Heart | 0x10 | Star | 0x20 | Diamond |
Encounter Types
Encounter Types are not used in X/Y. Transferred Pokemon keep their Encounter Type hex.
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) |
Medals & Ribbons
Super Training Medals
Flag Value | 0x2C | 0x2D | 0x2E | 0x2F | 0x01 | Unused | Sp. Atk Level 2 | Atk Level 3 | Follow Those Fleeing Goals! | 0x02 | Unused | HP Level 2 | Sp. Def Level 3 | Watch Out! That's One Tricky Second Half! | 0x04 | Sp. Atk Level 1 | Atk Level 2 | Speed Level 3 | An Opening of Lighting-Quick Attacks! | 0x08 | HP Level 1 | Sp. Def Level 2 | Def Level 3 | Those Long Shots Are No Long Shot! | 0x10 | Atk Level 1 | Speed Level 2 | The Troubles Keep on Coming?! | Scatterbug Lugs Back! | 0x20 | Sp. Def Level 1 | Def Level 2 | The Leaf Stone Cup Begins! | A Barrage of Bitbots! | 0x40 | Speed Level 1 | Sp. Atk Level 3 | The Fire Stone Cup Begins! | Drag Down Hydreigon! | 0x80 | Def Level 1 | HP Level 3 | The Water Stone Cup Begins! | The Battle for the Best: Version X/Y! |
Ribbon Set 1
Flag Value | 0x30 | 0x31 | 0x01 | Kalos Champ Ribbon | Alert Ribbon | 0x02 | Champion Ribbon | Shock Ribbon | 0x04 | Sinnoh Champ Ribbon | Downcast Ribbon | 0x08 | Best Friends Ribbon | Careless Ribbon | 0x10 | Training Ribbon | Relax Ribbon | 0x20 | Skillful Battler Ribbon | Snooze Ribbon | 0x40 | Expert Battler Ribbon | Smile Ribbon | 0x80 | Effort Ribbon | Gorgeous Ribbon |
Ribbon Set 2
Flag Value | 0x32 | 0x33 | 0x01 | Royal Ribbon | Earth Ribbon | 0x02 | Gorgeous Royal Ribbon | World Ribbon | 0x04 | Artist Ribbon | Classic Ribbon | 0x08 | Footprint Ribbon | Premier Ribbon | 0x10 | Record Ribbon | Event Ribbon | 0x20 | Legend Ribbon | Birthday Ribbon | 0x40 | Country Ribbon | Special Ribbon | 0x80 | National Ribbon | Souvenir Ribbon |
Ribbon Set 3
Flag Value | 0x34 | 0x01 | Wishing Ribbon | 0x02 | Battle Champion Ribbon | 0x04 | Regional Champion Ribbon | 0x08 | National Champion Ribbon | 0x10 | World Champion Ribbon | 0x20 | None | 0x40 | None | 0x80 | Hoenn Champion Ribbon |
Ribbon Set 4
Flag Value | 0x35 | 0x01 | Contest Star Ribbon | 0x02 | Coolness Master Ribbon | 0x04 | Beauty Master Ribbon | 0x08 | Cuteness Master Ribbon | 0x10 | Cleverness Master Ribbon | 0x20 | Toughness Master Ribbon |
Pokémon Data
The 6th generation games use a different system to handle pokemon data in-game. Previously, a pokémon's data (the equivalent of a pkm file) was passed directly into functions that would act upon it to pull out information that would be used by the game engine. Gen 6 uses a higher-level class called pml::pokepara::Accessor that stores multiple pieces of information that describe a pokémon. This class's object size is 14 bytes.
Accessor class
Offset | Type | Description | 0x0 | u32 | vtable pointer | 0x4 | u32 | Is pokemon in party (set to 1 if so) | 0x8 | Poke* | Pointer to this pokémon's data | 0xC | bool | Is pokemon data encrypted | 0xD | bool | Encrypt pokémon data |
|