$MD5 = InputBox("ค่า MD5 ไวรัส","กรุณาระบุค่า MD5 ที่ต้องการ","","",250,120)
$FileCount = 0
$var = DriveGetDrive("all")
if $MD5 <> "" Then
For $i = 1 to $var[0]
If DriveStatus($var[$i]) <> "NOTREADY" Then ScanFolder($var[$i])
Next
MsgBox(0,"Done","Folder Scan Complete. Scanned " & $FileCount & " Files")
EndIf
Func ScanFolder($SourceFolder)
Local $Search
Local $File
Local $FileAttributes
Local $FullFilePath
$Search = FileFindFirstFile($SourceFolder & "\*.*")
While 1
If $Search = -1 Then
ExitLoop
EndIf
$File = FileFindNextFile($Search)
If @error Then ExitLoop
$FullFilePath = $SourceFolder & "\" & $File
$FileAttributes = FileGetAttrib($FullFilePath)
If StringInStr($FileAttributes,"D") Then
ScanFolder($FullFilePath)
Else
if FileGetSize($FullFilePath) < 3000000 Then
ToolTip($FullFilePath,200,300,"กำลังทำการ Scan",2)
if md51($FullFilePath) = $MD5 then
if md51($FullFilePath) <> "0" Then
LogFile($FullFilePath)
FileSetAttrib($FullFilePath,"-rsh")
FileDelete($FullFilePath)
EndIf
EndIf
EndIf
EndIf
WEnd
FileClose($Search)
EndFunc
Func LogFile($FileName)
FileWriteLine(@ScriptDir & "\รายชื่อไวรัสที่ลบ.txt",$FileName)
$FileCount += 1
ToolTip($FileName,0,0)
EndFunc
Func MD51($N)
Dim $MD5Plugin
Dim $FileMD5
$MD5Plugin = PluginOpen(@ScriptDir & "\MD5Hash.dll")
$FileMD5 = MD5Hash($N,1,True)
Return $FileMD5
EndFunc
$FileCount = 0
$var = DriveGetDrive("all")
if $MD5 <> "" Then
For $i = 1 to $var[0]
If DriveStatus($var[$i]) <> "NOTREADY" Then ScanFolder($var[$i])
Next
MsgBox(0,"Done","Folder Scan Complete. Scanned " & $FileCount & " Files")
EndIf
Func ScanFolder($SourceFolder)
Local $Search
Local $File
Local $FileAttributes
Local $FullFilePath
$Search = FileFindFirstFile($SourceFolder & "\*.*")
While 1
If $Search = -1 Then
ExitLoop
EndIf
$File = FileFindNextFile($Search)
If @error Then ExitLoop
$FullFilePath = $SourceFolder & "\" & $File
$FileAttributes = FileGetAttrib($FullFilePath)
If StringInStr($FileAttributes,"D") Then
ScanFolder($FullFilePath)
Else
if FileGetSize($FullFilePath) < 3000000 Then
ToolTip($FullFilePath,200,300,"กำลังทำการ Scan",2)
if md51($FullFilePath) = $MD5 then
if md51($FullFilePath) <> "0" Then
LogFile($FullFilePath)
FileSetAttrib($FullFilePath,"-rsh")
FileDelete($FullFilePath)
EndIf
EndIf
EndIf
EndIf
WEnd
FileClose($Search)
EndFunc
Func LogFile($FileName)
FileWriteLine(@ScriptDir & "\รายชื่อไวรัสที่ลบ.txt",$FileName)
$FileCount += 1
ToolTip($FileName,0,0)
EndFunc
Func MD51($N)
Dim $MD5Plugin
Dim $FileMD5
$MD5Plugin = PluginOpen(@ScriptDir & "\MD5Hash.dll")
$FileMD5 = MD5Hash($N,1,True)
Return $FileMD5
EndFunc