BinaryWorks.it Official Forum
BinaryWorks.it Official Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 eXtreme Movie Manager (Rel. 7), No More Updates
 Suggestions / New Features
 MD4 Calculation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

spudthedestroyer
Starting Member

15 Posts

Posted - 29 Jul 2004 :  10:09:55  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I may have requested this before, but I was wondering if it was possible to include MD4 hash calculation? I use emule most of the time and that uses the format:
ed2k://|file|FILENAME|FILESIZEBYTES|MD4HASHHERE|/

There are some open source programs on emule-project.net in C code on hashing ed2k links under downloads.

I think this is the MD4 hashing part:
class CAddFileThread : public CWinThread
{
	DECLARE_DYNCREATE(CAddFileThread)
protected:
	CAddFileThread();
public:
	virtual BOOL InitInstance();
	virtual int	Run();
	void	SetValues(LPCTSTR directory, LPCTSTR filename);

private:
	CString			 m_strDirectory;
	CString			 m_strFilename;
};


// constants for MD4Transform
#define S11 3
#define S12 7
#define S13 11
#define S14 19
#define S21 3
#define S22 5
#define S23 9
#define S24 13
#define S31 3
#define S32 9
#define S33 11
#define S34 15

// basic MD4 functions
#define MD4_F(x, y, z) (((x) & (y)) | ((~x) & (z)))
#define MD4_G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
#define MD4_H(x, y, z) ((x) ^ (y) ^ (z))

// rotates x left n bits
// 15-April-2003 Sony: use MSVC intrinsic to save a few cycles
#ifdef _MSC_VER
#pragma intrinsic(_rotl)
#define MD4_ROTATE_LEFT(x, n) _rotl((x), (n))
#else
#define MD4_ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
#endif

// partial transformations
#define MD4_FF(a, b, c, d, x, s) \
{ \
  (a) += MD4_F((b), (c), (d)) + (x); \
  (a) = MD4_ROTATE_LEFT((a), (s)); \
}

#define MD4_GG(a, b, c, d, x, s) \
{ \
  (a) += MD4_G((b), (c), (d)) + (x) + (uint32)0x5A827999; \
  (a) = MD4_ROTATE_LEFT((a), (s)); \
}

#define MD4_HH(a, b, c, d, x, s) \
{ \
  (a) += MD4_H((b), (c), (d)) + (x) + (uint32)0x6ED9EBA1; \
  (a) = MD4_ROTATE_LEFT((a), (s)); \
}

static void MD4Transform(uint32 Hash[4], uint32 x[16]);

spudthedestroyer
Starting Member

15 Posts

Posted - 11 Jan 2005 :  17:21:54  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Just wondering if this would be possible at all. ATM, I'm using Ed2k HASH Gui v0.3 to do this manually when archiving, so it would really speed things up
Go to Top of Page

Alessio Viti
Forum Admin

Italy
9171 Posts

Posted - 11 Jan 2005 :  19:55:36  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi!

I really don't know if I can add it. Inside XMM there is the MD5 hash now. I will take a look.

Alessio
Go to Top of Page

spudthedestroyer
Starting Member

15 Posts

Posted - 17 Jan 2005 :  00:50:11  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
well I would be forever indebted to you if your able to do it! It would be almost perfect with that feature!
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
BinaryWorks.it Official Forum © Binaryworks.it Go To Top Of Page
Generated in 0.09 sec. Powered By: Snitz Forums 2000 Version 3.4.07