<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://fileformats.archiveteam.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://fileformats.archiveteam.org/index.php?action=history&amp;feed=atom&amp;title=User%3AEffect2%2FreadRMPP.c</id>
		<title>User:Effect2/readRMPP.c - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://fileformats.archiveteam.org/index.php?action=history&amp;feed=atom&amp;title=User%3AEffect2%2FreadRMPP.c"/>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/index.php?title=User:Effect2/readRMPP.c&amp;action=history"/>
		<updated>2026-04-23T22:30:29Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.2</generator>

	<entry>
		<id>http://fileformats.archiveteam.org/index.php?title=User:Effect2/readRMPP.c&amp;diff=33527&amp;oldid=prev</id>
		<title>Effect2: Fixed the nowiki tag usage</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/index.php?title=User:Effect2/readRMPP.c&amp;diff=33527&amp;oldid=prev"/>
				<updated>2019-09-29T13:42:28Z</updated>
		
		<summary type="html">&lt;p&gt;Fixed the nowiki tag usage&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 13:42, 29 September 2019&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&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='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;&amp;lt;nowiki&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;// &amp;quot;Effect2&amp;quot; at fileformats.archiveteam.org. CC0 (http://creativecommons.org/about/cc0).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;// &amp;quot;Effect2&amp;quot; at fileformats.archiveteam.org. CC0 (http://creativecommons.org/about/cc0).&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Effect2</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/index.php?title=User:Effect2/readRMPP.c&amp;diff=33526&amp;oldid=prev</id>
		<title>Effect2: Changed per the recent talk page message - compatibility with uppercase FourCCs</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/index.php?title=User:Effect2/readRMPP.c&amp;diff=33526&amp;oldid=prev"/>
				<updated>2019-09-29T13:41:44Z</updated>
		
		<summary type="html">&lt;p&gt;Changed per the recent talk page message - compatibility with uppercase FourCCs&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 13:41, 29 September 2019&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&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='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;&amp;lt;nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;nowiki&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;// &amp;quot;Effect2&amp;quot; at fileformats.archiveteam.org. CC0 (http://creativecommons.org/about/cc0).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;// &amp;quot;Effect2&amp;quot; at fileformats.archiveteam.org. CC0 (http://creativecommons.org/about/cc0).&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;	char type[4];&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;	char type[4];&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;	freadParanoid(type, 4, 1, stream);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;	freadParanoid(type, 4, 1, stream);&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;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;	assert(memcmp(&amp;quot;cftc&amp;quot;, type, 4) == 0);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;	assert(memcmp(&amp;quot;cftc&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;, type, 4) == 0 || memcmp(&amp;quot;CFTC&lt;/ins&gt;&amp;quot;, type, 4) == 0);&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: #eee; color:black; font-size: smaller;&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: #eee; color:black; font-size: smaller;&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;	uint32_t len = readint32_tFromStream(stream);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;	uint32_t len = readint32_tFromStream(stream);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 100:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 100:&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			FILE* outf = fopen(name, &amp;quot;w&amp;quot;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			FILE* outf = fopen(name, &amp;quot;w&amp;quot;);&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			fseek(f, entries[i].offset + 12, SEEK_SET);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			fseek(f, entries[i].offset + 12, SEEK_SET);&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;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			if (doFixDibs &amp;amp;&amp;amp; memcmp(tc, &amp;quot;dib &amp;quot;, 4) == 0) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			if (doFixDibs &amp;amp;&amp;amp; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(&lt;/ins&gt;memcmp(tc, &amp;quot;dib &amp;quot;, 4) == 0 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;|| memcmp(tc, &amp;quot;DIB &amp;quot;, 4) == 0)&lt;/ins&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;				fseek(f, 2, SEEK_CUR);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;				fseek(f, 2, SEEK_CUR);&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: #eee; color:black; font-size: smaller;&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Effect2</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/index.php?title=User:Effect2/readRMPP.c&amp;diff=31287&amp;oldid=prev</id>
		<title>Effect2: Fixed the fix</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/index.php?title=User:Effect2/readRMPP.c&amp;diff=31287&amp;oldid=prev"/>
				<updated>2019-04-27T02:42:19Z</updated>
		
		<summary type="html">&lt;p&gt;Fixed the fix&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 02:42, 27 April 2019&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 104:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 104:&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: #eee; color:black; font-size: smaller;&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: #eee; color:black; font-size: smaller;&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			uint8_t* raw = malloc(entries[i].length - 4);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			uint8_t* raw = malloc(entries[i].length - 4);&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;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			fread(raw, entries[i].length, 1, f);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			fread(raw, entries[i].length &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;- 4&lt;/ins&gt;, 1, f);&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;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			fwrite(raw, entries[i].length, 1, outf);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			fwrite(raw, entries[i].length &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;- 4&lt;/ins&gt;, 1, outf);&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			free(raw);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			free(raw);&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			fclose(outf);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			fclose(outf);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Effect2</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/index.php?title=User:Effect2/readRMPP.c&amp;diff=31286&amp;oldid=prev</id>
		<title>Effect2: Fixed a bug that caused sections being dumped to include the first 4 bytes of the next section</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/index.php?title=User:Effect2/readRMPP.c&amp;diff=31286&amp;oldid=prev"/>
				<updated>2019-04-27T02:40:31Z</updated>
		
		<summary type="html">&lt;p&gt;Fixed a bug that caused sections being dumped to include the first 4 bytes of the next section&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 02:40, 27 April 2019&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 103:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 103:&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;				fseek(f, 2, SEEK_CUR);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;				fseek(f, 2, SEEK_CUR);&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: #eee; color:black; font-size: smaller;&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: #eee; color:black; font-size: smaller;&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;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			uint8_t* raw = malloc(entries[i].length);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			uint8_t* raw = malloc(entries[i].length &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;- 4&lt;/ins&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			fread(raw, entries[i].length, 1, f);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			fread(raw, entries[i].length, 1, f);&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			fwrite(raw, entries[i].length, 1, outf);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;			fwrite(raw, entries[i].length, 1, outf);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Effect2</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/index.php?title=User:Effect2/readRMPP.c&amp;diff=31243&amp;oldid=prev</id>
		<title>Effect2: Created page with &quot; &lt;nowiki&gt; // &quot;Effect2&quot; at fileformats.archiveteam.org. CC0 (http://creativecommons.org/about/cc0).  #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include &lt;assert...&quot;</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/index.php?title=User:Effect2/readRMPP.c&amp;diff=31243&amp;oldid=prev"/>
				<updated>2019-04-22T05:01:28Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot; &amp;lt;nowiki&amp;gt; // &amp;quot;Effect2&amp;quot; at fileformats.archiveteam.org. CC0 (http://creativecommons.org/about/cc0).  #include &amp;lt;stdio.h&amp;gt; #include &amp;lt;stdlib.h&amp;gt; #include &amp;lt;string.h&amp;gt; #include &amp;lt;assert...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; &amp;lt;nowiki&amp;gt;&lt;br /&gt;
// &amp;quot;Effect2&amp;quot; at fileformats.archiveteam.org. CC0 (http://creativecommons.org/about/cc0).&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;assert.h&amp;gt;&lt;br /&gt;
#include &amp;lt;endian.h&amp;gt;&lt;br /&gt;
#include &amp;lt;inttypes.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
typedef struct {&lt;br /&gt;
	uint32_t typecode; // Always readable in ASCII, as far as has been observed&lt;br /&gt;
	uint32_t length;&lt;br /&gt;
	uint32_t seq;&lt;br /&gt;
	uint32_t offset;&lt;br /&gt;
} HeaderEntry;&lt;br /&gt;
&lt;br /&gt;
void freadParanoid(void *ptr, size_t size, size_t nmemb, FILE *stream) {&lt;br /&gt;
	assert(fread(ptr, size, nmemb, stream) == nmemb);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint32_t readint32_tFromStream(FILE* stream) { // Works for both int and uint, as endianness conversion doesn't care about that&lt;br /&gt;
	uint32_t orig;&lt;br /&gt;
	uint32_t i;&lt;br /&gt;
	freadParanoid(&amp;amp;orig, sizeof(int32_t), 1, stream);&lt;br /&gt;
	i = le32toh(orig);&lt;br /&gt;
	return i;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Assumes that the cursor is already in the right place.&lt;br /&gt;
long readcftc(FILE* stream, HeaderEntry** returnedEntries) {&lt;br /&gt;
	char type[4];&lt;br /&gt;
	freadParanoid(type, 4, 1, stream);&lt;br /&gt;
	assert(memcmp(&amp;quot;cftc&amp;quot;, type, 4) == 0);&lt;br /&gt;
	&lt;br /&gt;
	uint32_t len = readint32_tFromStream(stream);&lt;br /&gt;
	&lt;br /&gt;
	uint32_t seq = readint32_tFromStream(stream);&lt;br /&gt;
	assert(seq == 0);&lt;br /&gt;
	&lt;br /&gt;
	assert(len % 4 == 0);&lt;br /&gt;
	long numEntries = len / (4 * 4); // 4 fields of 4 bytes each&lt;br /&gt;
	HeaderEntry* entries = malloc(sizeof(HeaderEntry) * numEntries);&lt;br /&gt;
	long numActualEntries = 0;&lt;br /&gt;
	for (long i = 0; i &amp;lt; numEntries; i ++) {&lt;br /&gt;
		HeaderEntry entry;&lt;br /&gt;
		entry.typecode = readint32_tFromStream(stream);&lt;br /&gt;
		entry.length = readint32_tFromStream(stream);&lt;br /&gt;
		entry.seq = readint32_tFromStream(stream);&lt;br /&gt;
		entry.offset = readint32_tFromStream(stream);&lt;br /&gt;
		if (entry.typecode != 0) {&lt;br /&gt;
			entries[numActualEntries] = entry;&lt;br /&gt;
			numActualEntries ++;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	*returnedEntries = entries; // This will probably leave some (from samples, it's going to be much less than a kilobyte) of uninitialized memory in the array, but properly behaving code should never read into it&lt;br /&gt;
	return numActualEntries;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char** argv) {&lt;br /&gt;
	if (argc != 3) {&lt;br /&gt;
		printf(&amp;quot;Usage: [program] [command] [target file]\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;command can be a combination of:\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;    l - List sections in file\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;    d - Dump sections to the current directory, named offset.type\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;    f - when using d, Fix the dib sections by removing the 2 empty bytes at the start. Does not remove the space at the end of the file extension.\n&amp;quot;);&lt;br /&gt;
		return 0;&lt;br /&gt;
	}&lt;br /&gt;
	int doList = (strchr(argv[1], 'l') != NULL);&lt;br /&gt;
	int doDump = (strchr(argv[1], 'd') != NULL);&lt;br /&gt;
	int doFixDibs = (strchr(argv[1], 'f') != NULL);&lt;br /&gt;
	FILE* f = fopen(argv[2], &amp;quot;r&amp;quot;);&lt;br /&gt;
	if (f == NULL) {&lt;br /&gt;
		printf(&amp;quot;Could not open file, errno %d\n&amp;quot;, errno);&lt;br /&gt;
		return 2;&lt;br /&gt;
	}&lt;br /&gt;
	char magic[12];&lt;br /&gt;
	freadParanoid(magic, 12, 1, f);&lt;br /&gt;
	if (!(memcmp(magic, &amp;quot;RIFF &amp;quot;, 4) == 0 &amp;amp;&amp;amp; memcmp(magic + 8, &amp;quot;RMMP &amp;quot;, 4) == 0)) {&lt;br /&gt;
		printf(&amp;quot;Not an RMMP file\n&amp;quot;);&lt;br /&gt;
		fclose(f);&lt;br /&gt;
		return 2;&lt;br /&gt;
	}&lt;br /&gt;
	HeaderEntry* entries;&lt;br /&gt;
	long h = readcftc(f, &amp;amp;entries);&lt;br /&gt;
	if (doList) {&lt;br /&gt;
		printf(&amp;quot;File contains %d entries.\n&amp;quot;, h);&lt;br /&gt;
	}&lt;br /&gt;
	for (int i = 0; i &amp;lt; h; i ++) {&lt;br /&gt;
		char* tc = (char*) &amp;amp;(entries[i].typecode);&lt;br /&gt;
		if (doList) {&lt;br /&gt;
			printf(&amp;quot;%c%c%c%c : length: % 7d seq: % 5d offset: % 7d\n&amp;quot;, tc[0], tc[1], tc[2], tc[3], entries[i].length, entries[i].seq, entries[i].offset);&lt;br /&gt;
		}&lt;br /&gt;
		if (doDump) {&lt;br /&gt;
			fseek(f, entries[i].offset + 12, SEEK_SET);&lt;br /&gt;
			char* tc = (char*) &amp;amp;(entries[i].typecode);&lt;br /&gt;
			char name[30];&lt;br /&gt;
			snprintf(name, 30, &amp;quot;%d.%c%c%c%c&amp;quot;, entries[i].offset, tc[0], tc[1], tc[2], tc[3]);&lt;br /&gt;
			FILE* outf = fopen(name, &amp;quot;w&amp;quot;);&lt;br /&gt;
			fseek(f, entries[i].offset + 12, SEEK_SET);&lt;br /&gt;
			if (doFixDibs &amp;amp;&amp;amp; memcmp(tc, &amp;quot;dib &amp;quot;, 4) == 0) {&lt;br /&gt;
				fseek(f, 2, SEEK_CUR);&lt;br /&gt;
			}&lt;br /&gt;
			uint8_t* raw = malloc(entries[i].length);&lt;br /&gt;
			fread(raw, entries[i].length, 1, f);&lt;br /&gt;
			fwrite(raw, entries[i].length, 1, outf);&lt;br /&gt;
			free(raw);&lt;br /&gt;
			fclose(outf);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Effect2</name></author>	</entry>

	</feed>