views:

90

answers:

3

I have a online file: http://dl_dir.qq.com/qqfile/tm/TM2009Beta_chs.exe ,please donot download it, i want to determine the software version whether is changed, so i want more information about it. for example, using python,i can get this:

import urllib2,urllib
req = urllib2.Request('http://dl_dir.qq.com/qqfile/tm/TM2009Beta_chs.exe')        
response = urllib2.urlopen(req)
print response.info()
print response.geturl()

Content-Length: 16868680
Server: qqdlsrv(1.84 for linux)
Connection: close
Content-Disposition: attachment; filename=TM2009Beta_chs.exe
Accept-Ranges: bytes
Content-Type: application/octet-stream

http://dl_dir.qq.com/qqfile/tm/TM2009Beta_chs.exe

Can you get more imformation to let me determine the software version is changed?

+2  A: 

You can get all kinds of information about an EXE Windows file if you download it (the easy way, by running external utilities on it, or up to a point the hard way, via APIs and your own code simulating those utilities) -- a lot depends on what info was put into it when it was built. Without downloading, you can get only the info the server is giving you, which in this case seems pretty scarce -- I can't believe that server's configured to NOT tell you latest modified date &c. In your shoes, I'd see what can be done on the server side to remedy that dearth of info, so you don't have to download the EXE just to find out more!

Alex Martelli
+4  A: 
  1. Download the first thousand bytes or so of the file using the range header.

  2. Use pefile to parse the PE header and extract version information.

  3. With the data, extract useful information such as the time date stamp and other goodies that let you find changes in files without reading the whole thing.

Unknown
+2  A: 

Configure your server to provide a Last-Modified header, and use If-Modified-Since in your request.

bdonlan