<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>yoru-sulfur</author><text>What will really blow your mind is that you can cat a png and a zip together and the resulting file is both a valid png that looks identical to the image and a zip that contains the same contents as the archive.</text><parent_chain><item><author>fendy3002</author><text>The fact that merging zip files with cat and do not produce error is amazing by itself. Now we&amp;#x27;ll wait until someone find &amp;#x2F; use a way to distribute hidden files using this method.</text></item><item><author>GrumpySloth</author><text>&lt;i&gt;&amp;gt; How do you read a zip file?&lt;/i&gt;&lt;p&gt;&lt;i&gt;&amp;gt; This is undefined by the spec.&lt;/i&gt;&lt;p&gt;&lt;i&gt;&amp;gt; There are 2 obvious ways.&lt;/i&gt;&lt;p&gt;&lt;i&gt;&amp;gt; 1. Scan from the front, when you see an id for a record do the appropriate thing.&lt;/i&gt;&lt;p&gt;&lt;i&gt;&amp;gt; 2. Scan from the back, find the end-of-central-directory-record and then use it to read through the central directory, only looking at things the central directory references.&lt;/i&gt;&lt;p&gt;I was recently bitten by this at work. I got a zip from someone and couldn&amp;#x27;t find inside the files that were supposed to be there. I asked a colleague, and they sent me a screenshot showing that the files were there, and that they didn&amp;#x27;t see the set of files that I saw. I listed the content of the zip using the &amp;quot;unzip -l&amp;quot; command. They used the engrampa GUI. At that point I looked at the hexdump of the file. What caught my eye was that I saw the zip magic number near the end of the zip, which was odd. The magic number was also present at the beginning of the file. At this point I suspected that someone used cat(1) to concatenate two zips together. I checked it with dd(1), extracting the sequence of bytes before the second occurrence of the zip magic number and the remainder into two separate files. And sure enough at that point both &amp;quot;unzip -l&amp;quot; and &amp;quot;engrampa&amp;quot; showed the same set of files, and both could show both zips correctly. Turns out engrampa was reading the file forwards, whereas unzip was reading the file backwards.</text></item></parent_chain></comment><story><title>Zip – How not to design a file format</title><url>https://games.greggman.com/game/zip-rant/</url></story>
<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>cesarb</author><text>&amp;gt; Now we&amp;#x27;ll wait until someone find &amp;#x2F; use a way to distribute hidden files using this method.&lt;p&gt;You mean like the GIFAR attack (&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;GIFAR&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;GIFAR&lt;/a&gt;)?</text><parent_chain><item><author>fendy3002</author><text>The fact that merging zip files with cat and do not produce error is amazing by itself. Now we&amp;#x27;ll wait until someone find &amp;#x2F; use a way to distribute hidden files using this method.</text></item><item><author>GrumpySloth</author><text>&lt;i&gt;&amp;gt; How do you read a zip file?&lt;/i&gt;&lt;p&gt;&lt;i&gt;&amp;gt; This is undefined by the spec.&lt;/i&gt;&lt;p&gt;&lt;i&gt;&amp;gt; There are 2 obvious ways.&lt;/i&gt;&lt;p&gt;&lt;i&gt;&amp;gt; 1. Scan from the front, when you see an id for a record do the appropriate thing.&lt;/i&gt;&lt;p&gt;&lt;i&gt;&amp;gt; 2. Scan from the back, find the end-of-central-directory-record and then use it to read through the central directory, only looking at things the central directory references.&lt;/i&gt;&lt;p&gt;I was recently bitten by this at work. I got a zip from someone and couldn&amp;#x27;t find inside the files that were supposed to be there. I asked a colleague, and they sent me a screenshot showing that the files were there, and that they didn&amp;#x27;t see the set of files that I saw. I listed the content of the zip using the &amp;quot;unzip -l&amp;quot; command. They used the engrampa GUI. At that point I looked at the hexdump of the file. What caught my eye was that I saw the zip magic number near the end of the zip, which was odd. The magic number was also present at the beginning of the file. At this point I suspected that someone used cat(1) to concatenate two zips together. I checked it with dd(1), extracting the sequence of bytes before the second occurrence of the zip magic number and the remainder into two separate files. And sure enough at that point both &amp;quot;unzip -l&amp;quot; and &amp;quot;engrampa&amp;quot; showed the same set of files, and both could show both zips correctly. Turns out engrampa was reading the file forwards, whereas unzip was reading the file backwards.</text></item></parent_chain></comment><story><title>Zip – How not to design a file format</title><url>https://games.greggman.com/game/zip-rant/</url></story>