AutoHotkey Community

It is currently May 27th, 2012, 12:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: August 29th, 2005, 5:00 pm 
Offline

Joined: June 6th, 2005, 11:22 pm
Posts: 63
Hello,
here is the DLL and the script to run it.
I just tested it with 27,2 gigs and 61584 files and needed 17 minutes on my machine ;-).
However that depends on the hard drive not the script or the dll.
Have fun :-).


Code:
FileSelectFile, Path
VarSetCapacity(md5sum, 32)
DllCall("MD5Lib.dll\hexMD5", "str", md5sum, "str", Path)
FileAppend, %md5sum%`t%Path%`r`n, H:\Programmieren\Textdokument.txt.MD5.txt


Code:
FileSelectFolder, Path
hModule := DllCall("LoadLibrary", "str", "MD5Lib.dll")  ; Avoids the need for DllCall() in the loop to load the library.
Loop, %Path%\*.*, , 1
{
   DllCall("MD5Lib.dll\hexMD5", "str", md5sum, "str", A_LoopFileFullPath)
   FileAppend, %md5sum%`t%A_LoopFileFullPath%`r`n, %Path%\MD5Sums.txt
}
DllCall("FreeLibrary", "UInt", hModule)  ; It is best to unload the DLL after using it (or before the script exits).


You can download the DLL from here.
http://www.autohotkey.net/~Teddy/MD5Lib.dll

And sorry I got logged out again the Post of the Guest with the same title can be deleted.
Thanks.

_________________
Die Großen haben den Überblick und die Kleinen den Durchblick.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2005, 1:20 am 
Offline

Joined: July 3rd, 2004, 1:03 pm
Posts: 121
Awesome. Good find.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 31st, 2005, 12:06 am 
Offline

Joined: June 6th, 2005, 11:22 pm
Posts: 63
Well, the DLL is the work of my dear brother.
He helped me out although he would like to have me using C++ for my projects and not a "crutch" like AHK.
But I tell him that AHK is a very good appetizer for beginners like me :-).
And of course it is by fare more comfortable to use for every day use !

_________________
Die Großen haben den Überblick und die Kleinen den Durchblick.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2006, 3:38 pm 
Thanks for this useful DLL ! :D
But I would like to use an AHK variable like this:

Code:
PATH=C:\Folder\File.ext
VarSetCapacity(md5sum, 32)
DllCall("MD5Lib.dll\hexMD5", "str", md5sum, "str", "%PATH%")
MsgBox %md5sum%


It seems to fail, and %md5sum% is empty.

I am sorry if I don't see the obviousness... I use AHK recently.

Thank you.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2006, 3:48 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
"%PATH%" should be simply PATH. For details about this, see Expressions in the help file.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2006, 1:29 pm 
Offline

Joined: July 6th, 2004, 10:07 am
Posts: 171
Location: Manchester, England.
@Teddy

Nice little Dll. As md5'ing lots of files usually takes a lot of time I decide to knock up a quick little gui with Progress etc. etc.
Here's the code. Might save somebody some time :lol:


Code:
;; ---------------------------------------------------------------------
;; -----------    A little gui using teddy's md5lib.dll    -------------
;; ---------------------------------------------------------------------

Gui, Add, Progress, x16 y40 w310 h10 c00aa00 -smooth vDoingIt,0
Gui, Add, Text, x16 y10 w210 h20,Teddy's MD5 Checksum calculator. 
Gui, Add, Button, x236 y10 w90 h20 gDoit,Load Files.
Gui, Add, Text, x16 y60 w310 h40 +Center vMessage, 
Gui, Show, x272 y114 h102 w343, Generated with SmartGUI Creator
Return

GuiClose:
ExitApp

Doit:
maxsize =0.0
currsize = 0.0
f_count = 0
st := a_tickcount
FileSelectFolder, Path
guicontrol,,message,Loading ..... ;; just in case there's lots
Loop, %Path%\*.*, , 1
{
MaxSize :=  MaxSize + A_LoopFileSize
F_count++
}
hModule := DllCall("LoadLibrary", "str", "MD5Lib.dll")
Loop, %Path%\*.*, , 1
{
CurrSize :=  CurrSize + A_LoopFileSize
   DllCall("MD5Lib\hexMD5", str, md5sum, str, A_LoopFileFullPath)
   FileAppend, %md5sum%`t%A_LoopFileFullPath%`n, %A_Desktop%\MD5Sums.txt
done := currsize/maxsize * 100
show := round(done)
guicontrol,,doingit,%show%
guicontrol,,Message,%show% `%
}
DllCall("FreeLibrary", "UInt", hModule)
en := (a_tickcount - st)/1000
guicontrol,,message,Finished Processing %f_count% Files ...`nIn %en% Seconds !
return




Thanx.
Dave

_________________
Simple ideas lie within reach, only of complex minds


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2006, 2:44 pm 
Offline

Joined: November 18th, 2005, 11:18 pm
Posts: 25
Location: Germany
Nice idea

thanks for posting it.... :D

_________________
greets Grendel


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 9th, 2006, 8:16 pm 
Offline

Joined: July 6th, 2004, 10:07 am
Posts: 171
Location: Manchester, England.
Hi, All

@teddy,

More out of curiosity, how easy (or difficult) would it be to do the same only reading in a string from memory ?? :?


Thanx
Dave.

_________________
Simple ideas lie within reach, only of complex minds


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Download
PostPosted: October 12th, 2008, 10:51 pm 
Offline

Joined: October 12th, 2008, 10:46 pm
Posts: 1
For me, dosn't work download of md5lib.dll can You please renew the location or send me the file? Thank You very much!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 14th, 2008, 2:56 pm 
Offline

Joined: January 15th, 2008, 1:46 pm
Posts: 28
Here you go:

http://www.xup.in/dl,10969651/MD5Lib.dll/


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2011, 11:39 pm 
When I use this code it doesn't give me MD5 sums, it gives me the file paths?
I really need this, any other way to do this than this old code?

Thanks a lot! :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2011, 8:07 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
You could try FileMD5()


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon, maul.esel, SKAN and 7 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group