<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.cloudmodding.com/oot/CRC/history?feed=atom</id>
		<title>CRC - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.cloudmodding.com/oot/CRC/history?feed=atom"/>
		<link rel="alternate" type="text/html" href="https://wiki.cloudmodding.com/oot/CRC/history"/>
		<updated>2026-05-16T03:52:02Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.cloudmodding.com/woot/index.php?title=CRC&amp;diff=4191&amp;oldid=prev</id>
		<title>Mzxrules: /* Example C# Code */ pretty</title>
		<link rel="alternate" type="text/html" href="https://wiki.cloudmodding.com/woot/index.php?title=CRC&amp;diff=4191&amp;oldid=prev"/>
				<updated>2015-11-07T00:00:13Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Example C# Code: &lt;/span&gt; pretty&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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 style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 00:00, 7 November 2015&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-l19&quot; &gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Example C# Code ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Example C# Code ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;pre&lt;/del&gt;&amp;gt;public static void Write(Stream sw)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&lt;/ins&gt;&amp;gt;public static void Write(Stream sw)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; 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='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; uint[] crc = new uint[2];&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; uint[] crc = new uint[2];&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-l59&quot; &gt;Line 59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 60:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; br.Write(crc[1]);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; br.Write(crc[1]);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; 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='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;pre&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Documentation]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Documentation]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mzxrules</name></author>	</entry>

	<entry>
		<id>https://wiki.cloudmodding.com/woot/index.php?title=CRC&amp;diff=4142&amp;oldid=prev</id>
		<title>Mzxrules: Created page with &quot;The CRC is a special value used to verify the rom's data.  == How it works == On system boot, the rom performs a calculation that I don't understand. It checks the state of 0x...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.cloudmodding.com/woot/index.php?title=CRC&amp;diff=4142&amp;oldid=prev"/>
				<updated>2015-11-02T09:18:03Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;The CRC is a special value used to verify the rom&amp;#039;s data.  == How it works == On system boot, the rom performs a calculation that I don&amp;#039;t understand. It checks the state of 0x...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The CRC is a special value used to verify the rom's data.&lt;br /&gt;
&lt;br /&gt;
== How it works ==&lt;br /&gt;
On system boot, the rom performs a calculation that I don't understand. It checks the state of 0x100000 bytes, starting at 0x1000 into the rom. Because of this, the CRC must be recalculated and written to the [[makerom]] header whenever the following files are modified: &lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File&lt;br /&gt;
|-&lt;br /&gt;
| [[boot]]&lt;br /&gt;
|-&lt;br /&gt;
| [[dmadata]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Audiobank]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Audioseq]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Audiotable]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Example C# Code ==&lt;br /&gt;
&amp;lt;pre&amp;gt;public static void Write(Stream sw)&lt;br /&gt;
{&lt;br /&gt;
    uint[] crc = new uint[2];&lt;br /&gt;
    byte[] data = new byte[0x00101000];&lt;br /&gt;
    &lt;br /&gt;
    uint d, r, t1, t2, t3, t4, t5, t6 = 0xDF26F436;&lt;br /&gt;
&lt;br /&gt;
    t1 = t2 = t3 = t4 = t5 = t6;&lt;br /&gt;
&lt;br /&gt;
    sw.Position = 0; &lt;br /&gt;
    sw.Read(data, 0, 0x00101000);&lt;br /&gt;
&lt;br /&gt;
    for (int i = 0x00001000; i &amp;lt; 0x00101000; i += 4)&lt;br /&gt;
    {&lt;br /&gt;
        d = (uint)((data[i] &amp;lt;&amp;lt; 24) | (data[i + 1] &amp;lt;&amp;lt; 16) | (data[i + 2] &amp;lt;&amp;lt; 8) | data[i + 3]);&lt;br /&gt;
        if ((t6 + d) &amp;lt; t6) t4++;&lt;br /&gt;
        t6 += d;&lt;br /&gt;
        t3 ^= d;&lt;br /&gt;
        r = (d &amp;lt;&amp;lt; (int)(d &amp;amp; 0x1F)) | (d &amp;gt;&amp;gt; (32 - (int)(d &amp;amp; 0x1F)));&lt;br /&gt;
        t5 += r;&lt;br /&gt;
        if (t2 &amp;gt; d) t2 ^= r;&lt;br /&gt;
        else t2 ^= t6 ^ d;&lt;br /&gt;
        t1 += (uint)((data[0x00000750 + (i &amp;amp; 0xFF)] &amp;lt;&amp;lt; 24) | (data[0x00000751 + (i &amp;amp; 0xFF)] &amp;lt;&amp;lt; 16) |&lt;br /&gt;
              (data[0x00000752 + (i &amp;amp; 0xFF)] &amp;lt;&amp;lt; 8) | data[0x00000753 + (i &amp;amp; 0xFF)]) ^ d;&lt;br /&gt;
    }&lt;br /&gt;
    crc[0] = t6 ^ t4 ^ t3;&lt;br /&gt;
    crc[1] = t5 ^ t2 ^ t1;&lt;br /&gt;
&lt;br /&gt;
    if (BitConverter.IsLittleEndian)&lt;br /&gt;
    {&lt;br /&gt;
        crc[0] = (crc[0] &amp;gt;&amp;gt; 24) | ((crc[0] &amp;gt;&amp;gt; 8) &amp;amp; 0xFF00) | ((crc[0] &amp;lt;&amp;lt; 8) &amp;amp; 0xFF0000) | ((crc[0] &amp;lt;&amp;lt; 24) &amp;amp; 0xFF000000);&lt;br /&gt;
        crc[1] = (crc[1] &amp;gt;&amp;gt; 24) | ((crc[1] &amp;gt;&amp;gt; 8) &amp;amp; 0xFF00) | ((crc[1] &amp;lt;&amp;lt; 8) &amp;amp; 0xFF0000) | ((crc[1] &amp;lt;&amp;lt; 24) &amp;amp; 0xFF000000);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    //Seek to 0x10 from rom start&lt;br /&gt;
    sw.Position = 0x10;&lt;br /&gt;
    BinaryWriter br = new BinaryWriter(sw);&lt;br /&gt;
    br.Write(crc[0]);&lt;br /&gt;
    br.Write(crc[1]);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Mzxrules</name></author>	</entry>

	</feed>