<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[.w3g parsen]]></title><description><![CDATA[<p>Hi!</p>
<p>Ich möchte .w3g files parsen. In einer Anleitung dazu hab ich zum Header dieser Dateien folgendes gefunden:</p>
<pre><code>offset | size/type | Description
-------+-----------+-----------------------------------------------------------
0x0000 | 28 chars  | zero terminated string &quot;Warcraft III recorded game\0x1A\0&quot;
0x001c |  1 dword  | fileoffset of first compressed data block (header size)
       |           |  0x40 for WarCraft III with patch &lt;= v1.06
       |           |  0x44 for WarCraft III patch &gt;= 1.07 and TFT replays
0x0020 |  1 dword  | overall size of compressed file
0x0024 |  1 dword  | replay header version:
       |           |  0x00 for WarCraft III with patch &lt;= 1.06
       |           |  0x01 for WarCraft III patch &gt;= 1.07 and TFT replays
0x0028 |  1 dword  | overall size of decompressed data (excluding header)
0x002c |  1 dword  | number of compressed data blocks in file
0x0030 |  n bytes  | SubHeader (see section 2.1 and 2.2)
</code></pre>
<p>Darauf hin hab ich mir eine Struct gebaut</p>
<pre><code class="language-cpp">struct Header
 {
     // FILEHEADER
     char[28] headline;
     dword fileoffset;
     dword sizeoffile;
     dword repheaderversion;
     dword sizeofdata;
     dword numcompresseddatablocks;
     byte subheader;
};
</code></pre>
<p>So: Dword, word, byte....wie läuft das genau mit denen? statt dword kann ich glaub ich einfach int verwenden, und für byte ein char[8]?</p>
<p>Und später, wenn ich diese Struktur hab, und anfange zu lesen, spring ich auf begin. und dann gehe ich wie genau vor? einzelne chars rauspicken und reinschreiben?</p>
<p>mfg XaTrIxX</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/210123/w3g-parsen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 05:38:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/210123.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 07 Apr 2008 15:01:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to .w3g parsen on Mon, 07 Apr 2008 15:01:06 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Ich möchte .w3g files parsen. In einer Anleitung dazu hab ich zum Header dieser Dateien folgendes gefunden:</p>
<pre><code>offset | size/type | Description
-------+-----------+-----------------------------------------------------------
0x0000 | 28 chars  | zero terminated string &quot;Warcraft III recorded game\0x1A\0&quot;
0x001c |  1 dword  | fileoffset of first compressed data block (header size)
       |           |  0x40 for WarCraft III with patch &lt;= v1.06
       |           |  0x44 for WarCraft III patch &gt;= 1.07 and TFT replays
0x0020 |  1 dword  | overall size of compressed file
0x0024 |  1 dword  | replay header version:
       |           |  0x00 for WarCraft III with patch &lt;= 1.06
       |           |  0x01 for WarCraft III patch &gt;= 1.07 and TFT replays
0x0028 |  1 dword  | overall size of decompressed data (excluding header)
0x002c |  1 dword  | number of compressed data blocks in file
0x0030 |  n bytes  | SubHeader (see section 2.1 and 2.2)
</code></pre>
<p>Darauf hin hab ich mir eine Struct gebaut</p>
<pre><code class="language-cpp">struct Header
 {
     // FILEHEADER
     char[28] headline;
     dword fileoffset;
     dword sizeoffile;
     dword repheaderversion;
     dword sizeofdata;
     dword numcompresseddatablocks;
     byte subheader;
};
</code></pre>
<p>So: Dword, word, byte....wie läuft das genau mit denen? statt dword kann ich glaub ich einfach int verwenden, und für byte ein char[8]?</p>
<p>Und später, wenn ich diese Struktur hab, und anfange zu lesen, spring ich auf begin. und dann gehe ich wie genau vor? einzelne chars rauspicken und reinschreiben?</p>
<p>mfg XaTrIxX</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1488001</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1488001</guid><dc:creator><![CDATA[XaTrIxX]]></dc:creator><pubDate>Mon, 07 Apr 2008 15:01:06 GMT</pubDate></item><item><title><![CDATA[Reply to .w3g parsen on Mon, 07 Apr 2008 15:12:56 GMT]]></title><description><![CDATA[<p>2. Kommt drauf an. Aber ein byte ist eher ein char als ein char[8] .</p>
<p>Weis' deinen Kompilator aber nch darauf hin, dass er die struct so in den Speicher laden soll, also #pragma pack(push,1) oder so.</p>
<p>1. Vermutlich</p>
<p>3. input.read((char*)header,sizeof(header));</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1488003</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1488003</guid><dc:creator><![CDATA[Sososo]]></dc:creator><pubDate>Mon, 07 Apr 2008 15:12:56 GMT</pubDate></item><item><title><![CDATA[Reply to .w3g parsen on Mon, 07 Apr 2008 15:15:56 GMT]]></title><description><![CDATA[<p>also beim anlegen dieses structs wie oben beschrieben hab ich massig kompilierfehler - klar er kennt die typen nicht.</p>
<p>und wenn ich sowas mach:</p>
<p>input.read((char*)header,sizeof(header));</p>
<p>woher weiß er dann, was zu welchem teil der struktur gehört?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1488005</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1488005</guid><dc:creator><![CDATA[XaTrIxX]]></dc:creator><pubDate>Mon, 07 Apr 2008 15:15:56 GMT</pubDate></item></channel></rss>