<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://disgaea.rustedlogic.net/index.php?action=history&amp;feed=atom&amp;title=LZS_format</id>
		<title>LZS format - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://disgaea.rustedlogic.net/index.php?action=history&amp;feed=atom&amp;title=LZS_format"/>
		<link rel="alternate" type="text/html" href="https://disgaea.rustedlogic.net/index.php?title=LZS_format&amp;action=history"/>
		<updated>2026-04-14T05:46:33Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>https://disgaea.rustedlogic.net/index.php?title=LZS_format&amp;diff=99&amp;oldid=prev</id>
		<title>FireFly: This is not markdown</title>
		<link rel="alternate" type="text/html" href="https://disgaea.rustedlogic.net/index.php?title=LZS_format&amp;diff=99&amp;oldid=prev"/>
				<updated>2017-02-26T17:48:59Z</updated>
		
		<summary type="html">&lt;p&gt;This is not markdown&lt;/p&gt;
&lt;table class=&#039;diff diff-contentalign-left&#039;&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;tr style=&#039;vertical-align: top;&#039; lang=&#039;en&#039;&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 17:48, 26 February 2017&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-l61&quot; &gt;Line 61:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 61:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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=&#039;diff-marker&#039;&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=&#039;diff-marker&#039;&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;The header is followed by &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;`&lt;/del&gt;header.count&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;` &lt;/del&gt;file entries.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;The header is followed by &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;header.count&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039; &lt;/ins&gt;file entries.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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=&#039;diff-marker&#039;&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=&#039;diff-marker&#039;&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;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;lt;pre&amp;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-l70&quot; &gt;Line 70:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 70:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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=&#039;diff-marker&#039;&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=&#039;diff-marker&#039;&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;After this comes the file data. The first file runs from this point for &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;`&lt;/del&gt;entries[0].end_offset&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;` &lt;/del&gt;bytes.&amp;#160; That is, all of the &amp;#039;&amp;#039;end_offset&amp;#039;&amp;#039;s are counted starting from after the file metadata table.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;After this comes the file data. The first file runs from this point for &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;entries[0].end_offset&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039; &lt;/ins&gt;bytes.&amp;#160; That is, all of the &amp;#039;&amp;#039;end_offset&amp;#039;&amp;#039;s are counted starting from after the file metadata table.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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=&#039;diff-marker&#039;&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=&#039;diff-marker&#039;&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:File formats]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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:File formats]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>FireFly</name></author>	</entry>

	<entry>
		<id>https://disgaea.rustedlogic.net/index.php?title=LZS_format&amp;diff=98&amp;oldid=prev</id>
		<title>FireFly: Point out lack of relation to LZS/LZSS</title>
		<link rel="alternate" type="text/html" href="https://disgaea.rustedlogic.net/index.php?title=LZS_format&amp;diff=98&amp;oldid=prev"/>
				<updated>2017-02-26T17:47:16Z</updated>
		
		<summary type="html">&lt;p&gt;Point out lack of relation to LZS/LZSS&lt;/p&gt;
&lt;table class=&#039;diff diff-contentalign-left&#039;&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;tr style=&#039;vertical-align: top;&#039; lang=&#039;en&#039;&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 17:47, 26 February 2017&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=&#039;diff-marker&#039;&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;The &amp;#039;&amp;#039;&amp;#039;LZS format&amp;#039;&amp;#039;&amp;#039; appears to be a compression format used for compressed archives. Here, both the compression and the underlying archive format are described.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;The &amp;#039;&amp;#039;&amp;#039;LZS format&amp;#039;&amp;#039;&amp;#039; appears to be a compression format used for compressed archives. Here, both the compression and the underlying archive format are described.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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=&#039;diff-marker&#039;&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=&#039;diff-marker&#039;&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;It appears in at least Disgaea 2 PC.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Somewhat confusingly, it appears to not use either of [https://en.wikipedia.org/wiki/Lempel–Ziv–Stac LZS] or [https://en.wikipedia.org/wiki/Lempel–Ziv–Storer–Szymanski LZSS] compression, despite the name.&lt;/ins&gt;&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=&#039;diff-marker&#039;&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=&#039;diff-marker&#039;&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;It appears in at least &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;Disgaea 2 PC&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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=&#039;diff-marker&#039;&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=&#039;diff-marker&#039;&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;== Magic ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;== Magic ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>FireFly</name></author>	</entry>

	<entry>
		<id>https://disgaea.rustedlogic.net/index.php?title=LZS_format&amp;diff=97&amp;oldid=prev</id>
		<title>FireFly: Document LZS archives as found in D2PC</title>
		<link rel="alternate" type="text/html" href="https://disgaea.rustedlogic.net/index.php?title=LZS_format&amp;diff=97&amp;oldid=prev"/>
				<updated>2017-02-26T17:45:26Z</updated>
		
		<summary type="html">&lt;p&gt;Document LZS archives as found in D2PC&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;LZS format&amp;#039;&amp;#039;&amp;#039; appears to be a compression format used for compressed archives. Here, both the compression and the underlying archive format are described.&lt;br /&gt;
&lt;br /&gt;
It appears in at least Disgaea 2 PC.&lt;br /&gt;
&lt;br /&gt;
== Magic ==&lt;br /&gt;
The file starts with a &amp;lt;code&amp;gt;char magic[4]&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;&amp;quot;dat\0&amp;quot;&amp;#039;&amp;#039;, not part of the compressed data.&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
LZ77-based compression (that is, has literal data and backreferences, the latter referring back to a portion of data that has already been output but occurs again).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct header {&lt;br /&gt;
  u32 compressed_size;    // including this 12-byte header&lt;br /&gt;
  u32 decompressed_size;&lt;br /&gt;
  u32 marker;             // marker used to denote backrefs in the compressed data. 0x00-0xFF.&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This header is followed by the compressed data, which consists of literal bytes (copied straight to output) or backrefs. Backrefs are encoded as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct backref { u8 marker, dist, count; };&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
representing that &amp;#039;&amp;#039;count&amp;#039;&amp;#039; bytes should be copied from &amp;#039;&amp;#039;dist&amp;#039;&amp;#039; back into the output history.  If &amp;#039;&amp;#039;dist &amp;gt; marker&amp;#039;&amp;#039;, then 1 should be subtracted from it.&lt;br /&gt;
&lt;br /&gt;
Why this extra complication? Because two &amp;#039;&amp;#039;marker&amp;#039;&amp;#039; bytes in a row denote an escaped literal &amp;#039;&amp;#039;marker&amp;#039;&amp;#039; byte.  Thus, a decompression loop looks something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
while (read_ctr &amp;lt; header.compressed_size - sizeof(struct header)) {&lt;br /&gt;
  u8 v = READ();&lt;br /&gt;
  if (v == header.marker) {&lt;br /&gt;
    u8 dist = READ();&lt;br /&gt;
    if (dist == header.marker) {&lt;br /&gt;
      WRITE(header.marker);  // marker repeated twice = an escaped marker byte&lt;br /&gt;
    } else {&lt;br /&gt;
      u8 count = READ();&lt;br /&gt;
      if (dist &amp;gt; header.marker) dist--;&lt;br /&gt;
      for (size_t i = 0; i &amp;lt; count; i++) WRITE(HISTORY(dist));&lt;br /&gt;
    }&lt;br /&gt;
  } else {&lt;br /&gt;
    WRITE(v);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step, &amp;#039;&amp;#039;header.decompressed_size&amp;#039;&amp;#039; bytes should have been written.&lt;br /&gt;
&lt;br /&gt;
== Archive format ==&lt;br /&gt;
The underlying archive consists of a header with the number of files, a table of offsets and filenames, and file data; nothing weird here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct header {&lt;br /&gt;
  u32 count;  // #files in the archive&lt;br /&gt;
  u32 unk1;   // 0&lt;br /&gt;
  u32 unk2;   // 0&lt;br /&gt;
  u32 unk3;   // 0&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The header is followed by `header.count` file entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct file_entry {&lt;br /&gt;
  u32 end_offset;&lt;br /&gt;
  char filename[0x1C];&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this comes the file data. The first file runs from this point for `entries[0].end_offset` bytes.  That is, all of the &amp;#039;&amp;#039;end_offset&amp;#039;&amp;#039;s are counted starting from after the file metadata table.&lt;br /&gt;
&lt;br /&gt;
[[Category:File formats]]&lt;/div&gt;</summary>
		<author><name>FireFly</name></author>	</entry>

	</feed>