The mystery of the zero byte image

This is kinda a sequel to the mystery of the missing HTML challenge but very different. I believe this will only work on Windows XP on a NTFS filesystem.

Follow the steps to recreate:

  1. Open up the command prompt. You can do this by going to Start -> Run. Type in "cmd".
  2. First thing to do is simply to create a text file using Notepad. In the command prompt, type "notepad test.txt". Notepad will ask you whether you wish to create test.txt. Click yes. Type in "3.141592" and save the file.
  3. If you look at the file in Windows Explorer or command prompt, you will see that it is 8 bytes.
  4. Now we need an image. Save the Google logo to your hard drive in the same folder as test.txt. Call it test.gif. Windows Explorer and the command prompt should report the test.gif file being 8,558 bytes large.
  5. Now we need to embed the image into the text file we created. Type in "type test.gif > test.txt:rw".
  6. Delete test.gif since it is now embedded in the text file.
  7. Using Windows Explorer or the Command Prompt, ensure that test.txt is still 8 bytes.
  8. An image couldn’t have possibly been embedded in the file you may ask. Don’t believe it? Type in "mspaint test.txt:rw". Microsoft Paint should now open up with the logo you embedded into test.txt.

So where have the 8,558 bytes disappeared? How can we store a 8,558 byte image in a 8 byte text file? How has the 8,558 byte image effectively become zero bytes?

Let me know if you’ve worked it out but please refrain from posting the solution for several days so others can try and work it out. 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>