erickutcher / httpdownloader

HTTP(S) download manager that uses input/output completion ports (IOCP).
https://erickutcher.github.io/#HTTP_Downloader
571 stars 62 forks source link

Different Hash Values #114

Closed smaragdus closed 4 years ago

smaragdus commented 4 years ago

When I download these files:

from this website I get different file sizes and different hash values when I use HTTP Downloader, Free Download Manager and browser. When these files are downloaded with Free Download Manager and with browser the file sizes and the hash values match, while when these files are downloaded with HTTP Downloader the file sizes are bigger and accordingly the hash values do not match.

Hashes:

Name: RekSFV.v1.8.2.setup.exe
File Size: 1262488 Byte(s) (1.20 MB)
Modified Date: 2020-01-27 09:55
Version: 1.8.2.0
MD5: 6a1e7fbbbd73160b7a84c92cc9a32bfc
SHA1: c3218f8a8ae4754b48292ea4bed5a7e434666ab1
SHA256: 741113869baf125c236fdcc460523f909de6223d17f3fa2a7dd2a957fe9468f1
SHA384: be318c5d44c23f52449aef8005771d492324bb6cea15c0e79edf19c68ff3b062701b527365fe86e467de84208e2cd1b9
SHA512: 1894d6e8dcb2be1c67e8b1b89ef301335f01ed688822f733f09f6958d28b114ffab401228d86f8973187fe2f26274371eb025eb05aed7ff2562e911121235077
Name: RekSFV.v1.8.2.setup.exe
File Size: 1243871 Byte(s) (1.19 MB)
Modified Date: 2020-01-27 09:55
Version: 1.8.2.0
MD5: 5929fa61ad1fe60843ccf90da6ba12e6
SHA1: 3983d7b86a22a3f9a19a66665c04aecd18a45ad7
SHA256: 1ac323f9688fb1fdbf884db163a88ea8b30e240f1c758cdc9d2d557e9ad23a02
SHA384: 29945c8463f0923a2484d3649986fe9a1331188ee6c4c5f9d81f8bc181673dc56e08853075463bafbbd6a3b9932d950c
SHA512: e7e0dffe8fcc1e8d5704af6458b80cc9677f02454b7083e46275e31f052f910aa9f456dc0e167c322efc4700e54c440b405efcc879b17d4b37cc328253f5883f
Name: RekSFV.eb.v1.8.2.zip
File Size: 1107323 Byte(s) (1.06 MB)
Modified Date: 2020-01-27 09:55
MD5: 95ea3ef244728900f6fa90613b672d50
SHA1: 7585d3ba0543ff4ce8d92e887bb41cf999ba4d18
SHA256: f936bc98e58ca15074cbeee040d260f11fe8f9180c43654d8b9df1be055ba769
SHA384: f5500d0eb65b8b8c61f07ff57b9e58d3f8889308935819bd8683d2f5380e231769a20b402f7d6596dc54c0c1f54c3631
SHA512: f464a3c628276101c85d5c6316265025b0f1652da113875ec5ce130dfa74d025301bf6e91761afad36aaceddc6f5c7260f9c52a0fa0d309168e9c8d69b1033d7
Name: RekSFV.eb.v1.8.2.zip
File Size: 1088706 Byte(s) (1.04 MB)
Modified Date: 2020-01-27 09:55
MD5: 2997561c09ad919dc3f3f1d611cee3dd
SHA1: b943a56b23d78fdd410b1128f22f17849d7ce574
SHA256: 53fb6ed0d96a7d3bdbde6cfc780789fe108cb19b5a5fa43d85a49b6e80ee0d2c
SHA384: e32dfc7f463fecaffed79ca33550dfb97c5243579ee2dfff05436232426514ffe532454d0317030276bcd62d2bba8cc5
SHA512: e6d449c0c18266ed6b8af5193c1e4b724e598bf63b0eb8bf321772e4c4991c966d61b35189f7ff1f47d3a9557a052a1d2f175de6d8012668c969e1da9602e74b

The same applies for these files:

downloaded from the same website.

When these downloads are served by Free Download Manager and browser the file sizes and the hash values match. But when these downloads are served by HTTP Downloader the file sizes and the hash values do not match. Can you confirm that HTTP Downloader somehow modifies these downloads?

erickutcher commented 4 years ago

It's feeding some HTML content after the file. Very strange. I'll have to look at this over the weekend.

erickutcher commented 4 years ago

The PHP script that that site is using to serve the download is buggy. I'm not sure what it's doing exactly, but it's appending the download page immediately after the binary file. So the content-length header value that it reports is basically a lie. It then falls on the download manager to terminate the download once it reaches the correct file size. My program didn't do that so that's why it over-downloaded.

I've prevented it from saving the erroneous data. Hopefully the fix doesn't affect any other sites.

smaragdus commented 4 years ago

@erickutcher

Thank you for taking your time to investigate the issue.

erickutcher commented 4 years ago

A new version is up that corrects this.