Fix Hash for files of size n * 9728000 bytes
Status: Beta
Brought to you by:
uberdork
comparing hashes with emule, some files differ.
in eMule0.46c-Sources.zip:
File "KnownFile.cpp" line 454
The lasthash ist added even if the remaining blocksize is 0
The Patch here will make this tool generate the same hashes
as emule, AOM, ed2k.c from: http://www.sdalu.com/software/
mldonkley uses the way 0.4.0 generates it hashes.
edonkey-tool-hash < 0.4.0 will crash for this problem
files.
Logged In: YES
user_id=181729
test:
dd if=/dev/zero of=zero.img bs=9728000 count=2
dd if=/dev/zero of=more.img bs=9729000 count=2
with this patch:
$ edonkey-tool-hash -v *.img
hashing file : more.img
partial hash block 0: d7def262a127cd79096a108e7a9fc138
partial hash block 1: d7def262a127cd79096a108e7a9fc138
partial hash block 2: df58e4e45238ce2bd2e0844b3fe3fc4a
ed2k://|file|more.img|19457800|26a1d9db7cf34b42878c287673e0f02e|
hashing file : zero.img
partial hash block 0: d7def262a127cd79096a108e7a9fc138
partial hash block 1: d7def262a127cd79096a108e7a9fc138
partial hash block 2: 31d6cfe0d16ae931b73c59d7e0c089c0
ed2k://|file|zero.img|19456000|114b21c63a74b6ca922291a11177dd5c|
other tools:
$ ./ed2k *.img
|d7def262a127cd79096a108e7a9fc138|/
|d7def262a127cd79096a108e7a9fc138|/
|df58e4e45238ce2bd2e0844b3fe3fc4a|/
ED2K (more.img) = 26a1d9db7cf34b42878c287673e0f02e
|d7def262a127cd79096a108e7a9fc138|/
|d7def262a127cd79096a108e7a9fc138|/
|31d6cfe0d16ae931b73c59d7e0c089c0|/
ED2K (zero.img) = 114b21c63a74b6ca922291a11177dd5c
Logged In: YES
user_id=181729
The patch wworked fine under FreeBSD 4.11
But with FreeBSD 5.4 mumap fails.
This updated patch works around it.
Logged In: YES
user_id=181729
with clean hash:
* edonkey2000 v1.4.3
* mldonkey-2.5.30.17
* HashCalc Version 2.01
* edonkey-tool-hash-0.4.0
with hashing a zero sized block
* fsum 2.51
* emule 0.46c
* AOM 0.5.5.239
* webaom v1.13
* ed2k (Stephane D'Alu) 1.4
So the hashes of thsi tool conforms matches the behaviour
it was designed for without this patch.