Jump to content



Photo

Duplicate Files Finder - MD5 Hash CheckSum


  • Please log in to reply
39 replies to this topic

#1 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 03 December 2007 - 12:06 PM

Duplicate Files Finder - MD5 Hash CheckSum

Someone in the support forum was pointing to the Xstandard MD5 Hash COM object.

For those of you who don't know what a MD5 Hash CheckSum is :

In cryptography, MD5 (Message-Digest algorithm 5) is a widely used cryptographic hash function with a 128-bit hash value. As an Internet standard (RFC 1321), MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of files. An MD5 hash is typically expressed as a 32-character hexadecimal number.

MD5 was designed by Ron Rivest in 1991 to replace an earlier hash function, MD4. In 1996, a flaw was found with the design of MD5[citation needed]; while it was not a clearly fatal weakness, cryptographers began recommending the use of other algorithms, such as SHA-1 (which has since been found vulnerable itself). In 2004, more serious flaws were discovered making further use of the algorithm for security purposes questionable.

From Wikipedia, the free encyclopedia

Well this would be an example on how to use the CheckSum to find duplicated files or Scripts on your system :

Download here XStandard - MD5 Com Object

This small application is my first using the new syntax of 3.2.9.10.

It contains most of the extensive functionality that AU3 has to offer :
- DLLCalls
- SQL
- In Memory Database
- COM object
- RegisterMsg
- Native AU3 functions
- ...

DFF1.jpg DFF2.jpg

Attached File  DuplicateFiles_MD5_SQL_New.au3   19.45K   1444 downloads

Au3 - 3.2.13.13 version and higher

Attached File  DuplicateFiles_MD5_SQL_New.au3   19.56K   943 downloads

The speed of the application is more than reasonable.
It even scans your server if needed.

Enjoy finding duplicate scripts, audio, zip, exe, ... files

Enjoy !!

regards,

ptrex

Edited by ptrex, 14 September 2012 - 09:01 AM.






#2 speedy6

speedy6

    Wayfarer

  • Active Members
  • Pip
  • 90 posts

Posted 03 December 2007 - 03:05 PM

I get an error on _GUICtrlListViewSetColumnWidth...
How com?

#3 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 03 December 2007 - 03:39 PM

@speedy6

This function seems to be removed in the newer versions of AU3.

You can just comment out these lines.

I will see of there is function that replaces this.

This is the one according to the new naming conventions.


Thanks

regards

ptrex

Edited by ptrex, 03 December 2007 - 03:43 PM.


#4 speedy6

speedy6

    Wayfarer

  • Active Members
  • Pip
  • 90 posts

Posted 03 December 2007 - 05:08 PM

And what do i have to do with a COM error?
(i get it when i start the program)

#5 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 03 December 2007 - 07:21 PM

@speedy6

If you tell me the error I don't have to guess ?!

regards

ptrex

#6 speedy6

speedy6

    Wayfarer

  • Active Members
  • Pip
  • 90 posts

Posted 03 December 2007 - 11:15 PM

err.windrescription: Ongeldige klassereeks
Err.number is: 800401F3
err.scriptline is: 10
err.lastdllerror is: 0

#7 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 04 December 2007 - 11:08 AM

@speedy6

This means that you have not registered the MD5 Object on your system.


Regards / Groeten,

ptrex

#8 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 27 December 2007 - 09:57 PM

@all

Added a new update in the first post.

Enjoy fighting the digital pollution !!


Regards,

ptrex

#9 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 30 December 2007 - 09:52 PM

@all

Corrected a bug in the export function :
- Corrected the CSV delimiter.
- Optimized export query.

New version posted in first post.

#10 gseller

gseller

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,057 posts

Posted 14 January 2008 - 05:36 PM

ptrex... I just found this, Very NICE!! I downloaded the XMD5.dll and added these lines to your IsObj($oMD5) to autosetup the dll.. Thanks so much for sharing..

If Not IsObj($oMD5) Then FileInstall(@ScriptDir&"\x-md5\XMD5.dll", @SystemDir & "\XMD5.dll", 0) RunWait(@ComSpec & " /c regsvr32 /s XMD5.dll", @SystemDir, @SW_HIDE) MsgBox(48,"Error","You don't have the MD5 COM object installed on !! We are installing it now.")  ;Exit EndIf


#11 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 15 January 2008 - 10:02 AM

@gesller

Thanks for the compliment and additions to the script.

In the meantime I have complete a version, that has no dependency on an EXTERNAL COM DLL.

It has all the hash functionaluty included in AU3.
Runs really as fast, if not faster than the previous version.

I run it to scan my networks servers (remotely). And I am amazed to see how many GB on duplicate data is around.
But unfortunately it is not open source. :D

Regards,

ptrex

#12 gseller

gseller

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,057 posts

Posted 15 January 2008 - 03:57 PM

ptrex...
Ahhh, Bummer... :D Oh well, if you ever decide you want to share we would love to see the code...
I still like this one too..

#13 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,727 posts

Posted 16 January 2008 - 01:57 AM

Hi,

I get this:

C:\Downloads\AutoIt-Skripte\Entwicklung\ForumTests\MD5Duplicates.au3 (244) : ==> Error in expression.:
$oDict1_key = $oMD5.GetCheckSumFromFile($aFilesList[$n])
$oDict1_key = ^ ERROR

You also have to check your includes. My script says you needn't Array.au3 and String.au3.

So long,

Mega
Scripts & functions Organize Includes Let Scite organize the include files *newYahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication)_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

#14 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 16 January 2008 - 10:12 AM

@Xenobiologist

I don't know what kind of errors you get ?

On my machine Running:(3.2.9.14) (and others on which I tested it) it runs like a charm.

2. conditions
- You should use the version Running:(3.2.9.10) and higher.
- You should have the MD5 Object registered on your machine to run the Application.

Regards

ptrex

#15 Polyphem

Polyphem

    Adventurer

  • Active Members
  • PipPip
  • 125 posts

Posted 28 April 2008 - 01:53 PM

Looks really nice, but sadly I', getting a

Fatal Error
AVector []: Out of Bounds

on this one using 3.2.10.0. Has anyone an idea?

Cheers
This post will be edited again by Polyphem: Tomorrow, 11:55 AM

#16 James

James

    jbrooksuk

  • MVPs
  • 9,468 posts

Posted 28 April 2008 - 01:57 PM

Just a guess here but... I guess ptrex here likes SQL :D

Very nice! I can't wait to use it at home!

#17 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 28 April 2008 - 03:26 PM

@Polyphem

You need to have the SQLite DLL avaiable on the machine that runs the code.
Best way is to have the DLL somewhere in the Windows root folder.

This will solve your problem.


@JamesB

I guess ptrex here likes SQL


Indead !!

Since almost anything is accessible through SQL these day.
And it won't be long before the OS will support native SQL.

So you better get used to it. :D

regards,

ptrex

#18 Polyphem

Polyphem

    Adventurer

  • Active Members
  • PipPip
  • 125 posts

Posted 28 April 2008 - 04:40 PM

You need to have the SQLite DLL avaiable on the machine that runs the code.


Hmmmm, thinking about all the SQLite function calls in the script... I just can't explain why I have though about that :)... guess I assumed that SQLite is already part of AutoIt's pre-installed UDF's :D.... thanks for your quick response :D ...

Cheers
Poly
This post will be edited again by Polyphem: Tomorrow, 11:55 AM

#19 Polyphem

Polyphem

    Adventurer

  • Active Members
  • PipPip
  • 125 posts

Posted 28 April 2008 - 05:28 PM

Hmmmm, sorry to bother again :D.... installed md5 and sqllite... now the program works fine for me... except that there seems to be a problem with the passing of the values from one listview to the other (see screen attached)... I'll try to dig into the code myself...

Clipboard01.jpg

Cheers




UPDATE:
Ups, just took me 20 seconds :D.... replace all occurrences of

_GUICtrlListView_DeleteAllItems ($ListView1)
with
_GUICtrlListView_DeleteAllItems (GUICtrlGetHandle($ListView1))

and

_GUICtrlListView_DeleteAllItems ($ListView2)
with
_GUICtrlListView_DeleteAllItems (GUICtrlGetHandle($ListView2))

and

_GUICtrlListView_DeleteItem($ListView2,$Index)
with
_GUICtrlListView_DeleteItem(GUICtrlGetHandle($ListView2),$Index)

Thats it
Btw, did I already say thank you for this great piece of code? Thank you :)...

Cheers

Edited by Polyphem, 28 April 2008 - 05:38 PM.

This post will be edited again by Polyphem: Tomorrow, 11:55 AM

#20 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 28 April 2008 - 07:32 PM

@Polyphem

You are welcome.

All depends of course on the version of AU3 you use.

Regards

ptrex




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users