Difference between revisions of "Pikmin 2 save file"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
(Created page with "[Todo: Figure out how to decrypt save files for the NPC version]</br> [Todo: Check if this info applies to the US/J version of Pikmin 2 on GC] The following info was taken f...")
 
Line 1: Line 1:
[Todo: Figure out how to decrypt save files for the NPC version]</br>
+
Data about the ''Pikmin 2'' save file format. The following info was taken from the PAL version of ''Pikmin 2'' based on a .gci save taken from Dolphin.
[Todo: Check if this info applies to the US/J version of Pikmin 2 on GC]
 
  
 +
{{todo|Figure out how to decrypt save files for the NPC version}}
 +
{{todo|Check if this info applies to the US/J version of Pikmin 2 on GC}}
  
The following info was taken from the PAL version of Pikmin 2 based on a .gci save taken from dolphin.
+
The save file contains save data for each of the 3 save slot used in-game. The data of such a save slot starts with the 8 byte string <code>PlVa0003<code> and is 0xC000 bytes (49152 bytes in decimal) long. Directly after the string follows a byte which has the slot number of the save (<code>0x00</code> for first slot, <code>0x01</code> for second, <code>0x02</code> for third). The last 4 bytes of the slot data contain the checksum calculated for the preceding slot data. The checksum is calculated according to this method: http://hitmen.c02.at/files/yagcd/yagcd/chap12.html#sec12.5
 
 
 
 
Save file contains save data for each of the 3 save slot used ingame. The data of such a save slot starts with the 8 byte string PlVa0003 and is 0xC000 bytes (49152 bytes in decimal) long. Directly after the string follows a byte which has the slot number of the save (0x00 for first slot, 0x01 for second, 0x02 for third). The last 4 bytes of the slot data contain the checksum calculated for the preceeding slot data. The checksum is calculated according to this method: http://hitmen.c02.at/files/yagcd/yagcd/chap12.html#sec12.5
 
  
 
Addresses of interest relative to the start of the string:
 
Addresses of interest relative to the start of the string:
  
0x14 - 4 byte integer representing the day count shown on the file select screen (might not be permanent, i.e. overwritten when you end a day normally)
+
{| class="wikitable sortable"
 
+
! Address || Size || Description
 +
|-
 +
| <code>0x14</code> || 4 bytes
 +
| Integer representing the day count shown on the file select screen (might not be permanent, i.e. overwritten when you end a day normally.)
 +
|}
  
 +
The following Python script (requires Python >3.4) assists with calculating the checksum for the data in a save slot: https://gist.github.com/RenolY2/e0d93dde832b63f9197ef60861f22d89 Not recalculating and fixing the checksum results in the game detecting the modified save slot as being corrupted (but if you have any unmodified save slots, those will still work fine).
  
Following Python script (requires python >3.4) assists with calculating the checksum for the data in a save slot: https://gist.github.com/RenolY2/e0d93dde832b63f9197ef60861f22d89 Not recalculating and fixing the checksum results in the game detecting the modified save slot as being corrupted (but if you have any unmodified save slots, those will still work fine).  
+
Very careful editing might allow you to fool the corruption detection without having to recalculate the value: Due to the checksum being an additive one, {{unsure|if you increase one value by 1 and decrease a different value by 1, the checksum should still remain valid.}}
  
Very careful editing might allow you to fool the corruption detection without having to recalculate the value: Due to the checksum being an additive one, if you increase one value by 1 and decrease a different value by 1, the checksum should still remain valid. [This method needs testing, currently unconfirmed if it works]
+
[[Category:Pikmin 2]]
 +
[[Category:File formats]]

Revision as of 17:45, 21 January 2017

Data about the Pikmin 2 save file format. The following info was taken from the PAL version of Pikmin 2 based on a .gci save taken from Dolphin.


To do: Figure out how to decrypt save files for the NPC version

To do: Check if this info applies to the US/J version of Pikmin 2 on GC

The save file contains save data for each of the 3 save slot used in-game. The data of such a save slot starts with the 8 byte string PlVa0003 and is 0xC000 bytes (49152 bytes in decimal) long. Directly after the string follows a byte which has the slot number of the save (0x00 for first slot, 0x01 for second, 0x02 for third). The last 4 bytes of the slot data contain the checksum calculated for the preceding slot data. The checksum is calculated according to this method: http://hitmen.c02.at/files/yagcd/yagcd/chap12.html#sec12.5

Addresses of interest relative to the start of the string:

Address Size Description
0x14 4 bytes Integer representing the day count shown on the file select screen (might not be permanent, i.e. overwritten when you end a day normally.)

The following Python script (requires Python >3.4) assists with calculating the checksum for the data in a save slot: https://gist.github.com/RenolY2/e0d93dde832b63f9197ef60861f22d89 Not recalculating and fixing the checksum results in the game detecting the modified save slot as being corrupted (but if you have any unmodified save slots, those will still work fine).

Very careful editing might allow you to fool the corruption detection without having to recalculate the value: Due to the checksum being an additive one, if you increase one value by 1 and decrease a different value by 1, the checksum should still remain valid.[unsure]