PKM File Fields: Difference between revisions
No edit summary |
No edit summary |
||
Line 57: | Line 57: | ||
17- tough contest | 17- tough contest | ||
18- sheen contest | 18- sheen contest | ||
------------------------------------sinnoh ribbons | |||
19- Sinnoh Champ Ribbon | 19- Sinnoh Champ Ribbon | ||
1A- Ability Ribbon | 1A- Ability Ribbon | ||
Line 85: | Line 86: | ||
33- Classic Ribbon | 33- Classic Ribbon | ||
34- Premier Ribbon | 34- Premier Ribbon | ||
---------------------------------------- | |||
35- | 35- | ||
36- move1 | 36- move1 | ||
Line 107: | Line 108: | ||
4b- spe iv | 4b- spe iv | ||
4c- is_egg | 4c- is_egg | ||
4d- hoenn | 4d- is_nicknamed | ||
4e- | --------------------------------------hoenn ribbons | ||
4f- | 4e- Cool Ribbon | ||
4f- Cool Ribbon Super | |||
50- Cool Ribbon Hyper | |||
51- Cool Ribbon Master | |||
52- Beauty Ribbon | |||
53- Beauty Ribbon Super | |||
54- Beauty Ribbon Hyper | |||
55- Beauty Ribbon Master | |||
56- Cute Ribbon | |||
57- Cute Ribbon Super | |||
58- Cute Ribbon Hyper | |||
59- Cute Ribbon Master | |||
5a- Smart Ribbon | |||
5b- Smart Ribbon Super | |||
5c- Smart Ribbon Hyper | |||
5d- Smart Ribbon Master | |||
5e- Tough Ribbon | |||
5f- Tough Ribbon Super | |||
60- Tough Ribbon Hyper | |||
61- Tough Ribbon Master | |||
62- Champion Ribbon | |||
63- Winning Ribbon | |||
64- Victory Ribbon | |||
65- Artist Ribbon | |||
66- Effort Ribbon | |||
67- Marine Ribbon | |||
68- Land Ribbon | |||
69- Sky Ribbon | |||
6a- Country Ribbon | |||
6b- National Ribbon | |||
6c- Earth Ribbon | |||
6d- World Ribbon | |||
----------------------------------------- | |||
6e- gender(0 male, 1 female) | 6e- gender(0 male, 1 female) | ||
6f- form | 6f- form | ||
70- nature | 70- nature | ||
71- has dw abil | 71- has dw abil | ||
72- N's pokemon | |||
73- | |||
97- pokerus | 97- pokerus | ||
98- poke ball | 98- poke ball | ||
</pre> | </pre> |
Revision as of 03:36, 21 September 2012
PKM files have been ripped from saved and traded online for roughly the last 5 years or so by players. Pulling them out of games is very easy and makes trading or giving out pokemon to friends a simple task. When GameFreak needs to get or set specific data for a pokemon, they do it using a switch statement and a series of fields. They do it like so:
typedef enum{
PID,
field2,
field3,
field4,
checksum,
species,
item,
tidsid,
exp,
happiness,
-and so forth-
} PKMField;
When they need to write data to the pkm file, they use this function:
void setPKMStat(void* pPKM, PKMField field, int data)
and when they need to retrieve data from a PKM file, they use this:
PKMField getPKMStat(void* pPKM, PKMField field, int data)
(data is basically always 0 in the "get" function)
The switch statements for these functions are large. In gen 3 they used 2 switches, one for party data and one for box data. In gens 4 and 5 they switched to a single massive switch that can retrieve anything. In B2W2 a PKM file has 179 fields. In BW PKM files had 175 fields.
The following is a partial list of field values for these functions: (all are in hexadecimal)
0- pid 1- unused short 2- unused short 3- unused short 4- checksum 5- species 6- item 7- tidsid 8- exp 9- happiness a- abil b- markings c- region d- hp ev e- atk ev f- def ev 10- spa ev 11- spd ev 12- spe ev 13- cool contest 14- beauty contest 15- cute contest 16- smart contest 17- tough contest 18- sheen contest ------------------------------------sinnoh ribbons 19- Sinnoh Champ Ribbon 1A- Ability Ribbon 1B- Great Ability Ribbon 1C- Double Ability Ribbon 1D- Multi Ability Ribbon 1E- Pair Ability Ribbon 1F- World Ability Ribbon 20- Alert Ribbon 21- Shock Ribbon 22- Downcast Ribbon 23- Careless Ribbon 24- Relax Ribbon 25- Snooze Ribbon 26- Smile Ribbon 27- Gorgeous Ribbon 28- Royal Ribbon 29- Gorgeous Royal Ribbon 2a- Footprint Ribbon 2b- Record Ribbon 2c- History Ribbon 2d- Legend Ribbon 2e- Red Ribbon 2f- Green Ribbon 30- Blue Ribbon 31- Festival Ribbon 32- Carnival Ribbon 33- Classic Ribbon 34- Premier Ribbon ---------------------------------------- 35- 36- move1 37- move2 38- move3 39- move4 3a- move1 pp 3b- move2 pp 3c- move3 pp 3d- move4 pp 3e- move1 pp up 3f- move2 pp up 40- move3 pp up 41- move4 pp up 46- hp iv 47- atk iv 48- def iv 49- spa iv 4a- spd iv 4b- spe iv 4c- is_egg 4d- is_nicknamed --------------------------------------hoenn ribbons 4e- Cool Ribbon 4f- Cool Ribbon Super 50- Cool Ribbon Hyper 51- Cool Ribbon Master 52- Beauty Ribbon 53- Beauty Ribbon Super 54- Beauty Ribbon Hyper 55- Beauty Ribbon Master 56- Cute Ribbon 57- Cute Ribbon Super 58- Cute Ribbon Hyper 59- Cute Ribbon Master 5a- Smart Ribbon 5b- Smart Ribbon Super 5c- Smart Ribbon Hyper 5d- Smart Ribbon Master 5e- Tough Ribbon 5f- Tough Ribbon Super 60- Tough Ribbon Hyper 61- Tough Ribbon Master 62- Champion Ribbon 63- Winning Ribbon 64- Victory Ribbon 65- Artist Ribbon 66- Effort Ribbon 67- Marine Ribbon 68- Land Ribbon 69- Sky Ribbon 6a- Country Ribbon 6b- National Ribbon 6c- Earth Ribbon 6d- World Ribbon ----------------------------------------- 6e- gender(0 male, 1 female) 6f- form 70- nature 71- has dw abil 72- N's pokemon 73- 97- pokerus 98- poke ball