Jump to content

ScanMD5


 Share

Recommended Posts

Hi, This code for scan all files with MD5:

#AutoIt3Wrapper_plugin_funcs = MD5Hash

global $n,$file,$a,$s,$m=1000

;$var = FileSelectFolder("Choose a folder.", "")
;$search = FileFindFirstFile($var &"\*.*")

$search = FileFindFirstFile("*.*")  



If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    
$plH = PluginOpen("MD5Hash.dll")
$a=MD5Hash($file, 1, True)

for $n=0 to $m step 1
    $s=$n+1
    $b=FileReadLine("FileMD5.ini",$s)
    if $b=$a Then
        MsgBox(16,"Virus",$file)
    EndIf
    If @error = -1 Then ExitLoop
Next
MsgBox(0, "Virus",$a)   


;$n=0
;While 1
;$n=$n+1
  ; $b=FileReadLine("..\FileMD5.ini",$n)
;if $b=$a Then
    ;MsgBox(16,"Virus","Attention",$file)
;EndIf
  ; If @error = -1 Then ExitLoop
    ;MsgBox(0, "Test MD5Hash.DLL",$a)
;$n=$n+0    
;Wend




PluginClose($plH)

WEnd

FileClose($search)

ScanMD5.zip

[center]I LOVE ALGERIA .... ;-)[/center]
Link to comment
Share on other sites

i had similar code, but main difference is that i used both dll and pure autoit md5.au3 udf to calculate md5 so that dll doesnt need to be present on host system :-) it becomes a standalone executable which will detect all files with a given md5 (specially useful when searching for virus variants ) also, my script used to search recursively on all folders under the given path.

when i get the gui built properly (if ever that happens!) i will post it.

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...