My first thought was "I wonder how windows knows the file version information". Is this stored
  1. in extended attributes
  2. in the registry
  3. in the file itself

I doubt that this is stored in extended attributes, because I believe that this works on file systems that do not support extended attributes. DLLs have version information stored in the file itself, so to function, the method must be able to look inside the DLL. I expect the same to be true of EXE files.

Now, if you move to Linux, how do they store information? Check these links

http://www.linuxjournal.com/article/1059
http://en.wikipedia.org/wiki/Executa...inkable_Format
http://developers.sun.com/solaris/articles/elf.html
http://www.ibm.com/developerworks/li.../l-shlibs.html