<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mariogalaxy.org/w/index.php?action=history&amp;feed=atom&amp;title=GameData</id>
	<title>GameData - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mariogalaxy.org/w/index.php?action=history&amp;feed=atom&amp;title=GameData"/>
	<link rel="alternate" type="text/html" href="https://mariogalaxy.org/w/index.php?title=GameData&amp;action=history"/>
	<updated>2026-05-13T14:09:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://mariogalaxy.org/w/index.php?title=GameData&amp;diff=169&amp;oldid=prev</id>
		<title>GalaxyMaster: some fixes</title>
		<link rel="alternate" type="text/html" href="https://mariogalaxy.org/w/index.php?title=GameData&amp;diff=169&amp;oldid=prev"/>
		<updated>2023-02-21T09:27:32Z</updated>

		<summary type="html">&lt;p&gt;some fixes&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:27, 21 February 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;game Super Mario Galaxy saves player &lt;/del&gt;data into a file &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;called &lt;/del&gt;GameData.bin stored within the game&#039;s &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Savegame Files|savegame]]&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;games save progress &lt;/ins&gt;data into a file &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;named &#039;&#039;&lt;/ins&gt;GameData.bin&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039; &lt;/ins&gt;stored within the game&#039;s &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;NAND save. Most of the functions that handle save game functionality also have &#039;&#039;GameData&#039;&#039; in the name&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The GameData.bin file consists of a header, followed by an index and some data sections.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The GameData.bin file consists of a header, followed by an index and some data sections.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l35&quot;&gt;Line 35:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 35:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The checksum is calculated as follows, with buf pointing to offset 0x04 in the file, and len being the length of GameData.bin minus 0x04:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The checksum is calculated as follows, with buf pointing to offset 0x04 in the file, and len being the length of GameData.bin minus 0x04:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source &lt;/del&gt;lang=&quot;c&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight &lt;/ins&gt;lang=&quot;c&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;uint32_t generate_checksum(void *buf, int len)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;uint32_t generate_checksum(void *buf, int len)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l49&quot;&gt;Line 49:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 49:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     return (c2 &amp;amp; 0xFFFF) | ((c1 &amp;amp; 0xFFFF) &amp;lt;&amp;lt; 16);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     return (c2 &amp;amp; 0xFFFF) | ((c1 &amp;amp; 0xFFFF) &amp;lt;&amp;lt; 16);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Index ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Index ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>GalaxyMaster</name></author>
	</entry>
	<entry>
		<id>https://mariogalaxy.org/w/index.php?title=GameData&amp;diff=167&amp;oldid=prev</id>
		<title>GalaxyMaster: import page from https://wiibrew.org/wiki/Super_Mario_Galaxy_savefile</title>
		<link rel="alternate" type="text/html" href="https://mariogalaxy.org/w/index.php?title=GameData&amp;diff=167&amp;oldid=prev"/>
		<updated>2023-02-21T07:40:05Z</updated>

		<summary type="html">&lt;p&gt;import page from https://wiibrew.org/wiki/Super_Mario_Galaxy_savefile&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The game Super Mario Galaxy saves player data into a file called GameData.bin stored within the game&amp;#039;s [[Savegame Files|savegame]].&lt;br /&gt;
&lt;br /&gt;
The GameData.bin file consists of a header, followed by an index and some data sections.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color: #ddd;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #cdc;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Start&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ccd;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;End&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ccc;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Length&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #dcc;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|- style=&amp;quot;background-color: #ddd;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ded;&amp;quot; | 0x000&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #dde;&amp;quot; | 0x003&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;&amp;quot; | 4&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #edd;&amp;quot; | Checksum&lt;br /&gt;
|- style=&amp;quot;background-color: #ddd;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ded;&amp;quot; | 0x004&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #dde;&amp;quot; | 0x007&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;&amp;quot; | 4&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #edd;&amp;quot; | ?? Version = 2&lt;br /&gt;
|- style=&amp;quot;background-color: #ddd;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ded;&amp;quot; | 0x008&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #dde;&amp;quot; | 0x00B&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;&amp;quot; | 4&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #edd;&amp;quot; | number of entries&lt;br /&gt;
|- style=&amp;quot;background-color: #ddd;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ded;&amp;quot; | 0x00C&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #dde;&amp;quot; | 0x00F&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;&amp;quot; | 4&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #edd;&amp;quot; | size of GameData.bin&lt;br /&gt;
|- style=&amp;quot;background-color: #ddd;&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The checksum is calculated as follows, with buf pointing to offset 0x04 in the file, and len being the length of GameData.bin minus 0x04:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
uint32_t generate_checksum(void *buf, int len)&lt;br /&gt;
{&lt;br /&gt;
    uint16_t *data = (uint16_t*)buf;&lt;br /&gt;
    uint32_t c1 = 0, c2 = 0;&lt;br /&gt;
&lt;br /&gt;
    for (int i = 0; i &amp;lt; len / sizeof(uint16_t); i++)&lt;br /&gt;
    {&lt;br /&gt;
        c1 = (c1 + data[i]) &amp;amp; 0xFFFF;&lt;br /&gt;
        c2 = (c2 + ~data[i]) &amp;amp; 0xFFFF;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return (c2 &amp;amp; 0xFFFF) | ((c1 &amp;amp; 0xFFFF) &amp;lt;&amp;lt; 16);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Index ===&lt;br /&gt;
&lt;br /&gt;
The index has as many entries as specified in the header. Index entries are stored consecutively.&lt;br /&gt;
The format of an index entry is specified in the following table.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color: #ddd;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #cdc;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Start&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ccd;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;End&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ccc;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Length&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #dcc;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|- style=&amp;quot;background-color: #ddd;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ded;&amp;quot; | 0x000&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #dde;&amp;quot; | 0x00B&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;&amp;quot; | 12&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #edd;&amp;quot; | entry name, null padded (i.e. &amp;#039;mario1&amp;#039;, &amp;#039;luigi1&amp;#039;, ...)&lt;br /&gt;
|- style=&amp;quot;background-color: #ddd;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ded;&amp;quot; | 0x00C&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #dde;&amp;quot; | 0x00F&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;&amp;quot; | 4&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #edd;&amp;quot; | offset of entry data in GameData.bin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Data ===&lt;br /&gt;
&lt;br /&gt;
There are at least 4 types of data entries:&lt;br /&gt;
* Player data is stored in PLAY data entries&lt;br /&gt;
** &amp;#039;mario%1d&amp;#039; and &amp;#039;luigi%1d&amp;#039; entries have a length of 0xF80 bytes&lt;br /&gt;
* Configuration data is stored in CONF data entries&lt;br /&gt;
** &amp;#039;config%1d&amp;#039; entries have a length of 0x60 bytes&lt;br /&gt;
* System configuration is stored in SYSC data entries (there is usually only one SYSC data entry)&lt;br /&gt;
** &amp;#039;sysconf&amp;#039; entries have a length of 0x80 bytes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color: #ddd;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #cdc;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Start&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ccd;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;End&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ccc;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Length&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #dcc;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|- style=&amp;quot;background-color: #ddd;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ded;&amp;quot; | 0x000&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #dde;&amp;quot; | 0x003&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;&amp;quot; | 4&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #edd;&amp;quot; | ?? entry type code (0x01010000=SYSC, 0x01030000=CONF, 0x01060000=PLAY)&lt;br /&gt;
|- style=&amp;quot;background-color: #ddd;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ded;&amp;quot; | 0x004&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #dde;&amp;quot; | 0x007&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;&amp;quot; | 4&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #edd;&amp;quot; | entry type name (&amp;#039;SYSC&amp;#039;, &amp;#039;CONF&amp;#039;, &amp;#039;PLAY&amp;#039;)&lt;br /&gt;
|- style=&amp;quot;background-color: #ddd;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ded;&amp;quot; | ...&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #dde;&amp;quot; | ...&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #ddd;&amp;quot; | ...&lt;br /&gt;
| style=&amp;quot;border: 1px solid #ccc; padding: 0.2em; background-color: #edd;&amp;quot; | ...&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:File formats]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Vulnerabilities ==&lt;br /&gt;
Super Mario Galaxy (and its sequel, Super Mario Galaxy 2) are known to have an unexploitable vulnerability in parsing GameData.bin. The entire file is loaded into memory at once, and after being verified for integrity (checksum, version, etc.), its index entries are extracted. The game keeps an in-memory template of an empty savefile, with the index entries being copied into the template. A function is used (on both GameData.bin and the template) to get the data pointer and length of an entry.&lt;br /&gt;
&lt;br /&gt;
This function calculates the length of an index entry by subtracting the current entry&amp;#039;s offset from the next entry&amp;#039;s offset. Unfortunately, the length from GameData.bin is not used for the memcpy() into the template: the length from the template is used. However, once the memcpy() completes, the game checks if the amount of data specified by GameData.bin is less than the amount copied. This is done by checking whether template_size - reported_size &amp;gt; 0. It is possible to make reported_size negative (&amp;gt;= 0x80000000), which would cause that check to return true. If true, it memset()s that amount of 0 bytes after the copied data.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the layout of the heap and the fact that it is all 0 bytes makes this vulnerability apparently useless.&lt;/div&gt;</summary>
		<author><name>GalaxyMaster</name></author>
	</entry>
</feed>