aboutsummaryrefslogtreecommitdiffstats
path: root/net-p2p/ed2k/files
diff options
context:
space:
mode:
authordinoex <dinoex@FreeBSD.org>2005-11-20 20:20:55 +0800
committerdinoex <dinoex@FreeBSD.org>2005-11-20 20:20:55 +0800
commit52603dfc96131fe8ff197053939452df4f1f29a8 (patch)
tree531cee76921ac2057a6d1087bce80b30ea63c374 /net-p2p/ed2k/files
parentbf17c5c1024324219897cd8bc961c124712fb642 (diff)
downloadfreebsd-ports-gnome-52603dfc96131fe8ff197053939452df4f1f29a8.tar.gz
freebsd-ports-gnome-52603dfc96131fe8ff197053939452df4f1f29a8.tar.zst
freebsd-ports-gnome-52603dfc96131fe8ff197053939452df4f1f29a8.zip
This tool takes files and calculates the final 'eEmule' hashes for
then. It also spits out the complete ed2k:// link in the end. Note: This hashes differ from 'eDonkey/mldonkey' hashes when the size of a files is a mutiple of 9728000 Bytes. WWW: http://www.sdalu.com/software/tools.shtml
Diffstat (limited to 'net-p2p/ed2k/files')
-rw-r--r--net-p2p/ed2k/files/patch-ed2k.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/net-p2p/ed2k/files/patch-ed2k.c b/net-p2p/ed2k/files/patch-ed2k.c
new file mode 100644
index 000000000000..c9efde43b755
--- /dev/null
+++ b/net-p2p/ed2k/files/patch-ed2k.c
@@ -0,0 +1,65 @@
+--- ed2k.c.orig Sun Jun 13 19:47:20 2004
++++ ed2k.c Wed Nov 9 07:55:38 2005
+@@ -32,7 +32,7 @@
+ #include <sys/stat.h>
+
+ /* #define OFF_CONV "%ld" /* off_t is long (Linux) */
+-/* #define OFF_CONF "%lld" /* off_t is long long (FreeBSD) */
++#define OFF_CONV "%lld" /* off_t is long long (FreeBSD) */
+
+ #ifndef OFF_CONV
+ # warning "You should define OFF_CONV (see the file)"
+@@ -47,16 +47,27 @@
+
+ typedef unsigned char md4_t[16];
+
++#if defined(WITH_RSA)
++
+ typedef struct {
+- u_int32_t state[4];
+- u_int32_t count[2];
+- unsigned char buffer[64];
++ u_int32_t state[4];
++ u_int32_t count[2];
++ unsigned char buffer[64];
+ } md4_ctx_t;
+
+ void md4_init(md4_ctx_t *);
+ void md4_update(md4_ctx_t *, unsigned char *, unsigned int);
+ void md4_finish(md4_ctx_t *, md4_t);
+
++#else
++
++#include <md4.h>
++#define md4_ctx_t MD4_CTX
++#define md4_init MD4Init
++#define md4_update MD4Update
++#define md4_finish(a,b) MD4Final(b,a)
++
++#endif
+
+ static char *progname;
+
+@@ -86,7 +97,7 @@
+ }
+
+
+-static __inline__ char hdigit(q) {
++static __inline__ char hdigit(unsigned char q) {
+ return ((q >= 10) ? 'W' : '0') + q;
+ }
+
+@@ -181,6 +192,7 @@
+ }
+
+
++#if defined(WITH_RSA)
+
+ /*==> RSA Data Security, Inc. MD4 Message-Digest Algorithm =============*/
+
+@@ -323,3 +335,5 @@
+ md4_update (context, bits, 8);
+ md4_encode (digest, context->state, 16);
+ }
++
++#endif