本帖最后由 AUFS 于 2010-12-27 16:30 编辑
AdlibRegister('_MD5CHK',1000)为每秒执行一次检测#NoTrayIcon
#AutoIt3Wrapper_plugin_funcs = MD5Hash
$how = IniRead(@ScriptDir & "\md5.ini","qq93632200","检测方式","")
$spath = IniRead(@ScriptDir & "\md5.ini","qq93632200","原路径","")
$dpath = IniRead(@ScriptDir & "\md5.ini","qq93632200","检测路径","")
$md5 = IniRead(@ScriptDir & "\md5.ini","qq93632200","MD5值","")
$howdo = IniRead(@ScriptDir & "\md5.ini","qq93632200","执行方式","")
$wpath = IniRead(@ScriptDir & "\md5.ini","qq93632200","报警路径","")
AdlibRegister('_MD5CHK',1000)
While 1
Sleep(200)
WEnd
Func _MD5Chk()
If $how = 1 Then
chkfiles()
ElseIf $how = 2 Then
chkmd5()
Else
If $how = 3 Then
getmd5()
Else
MsgBox(48,"错误","检测方式参数设置错误" & @CRLF & "请重新设置!!")
exit
EndIf
EndIf
EndFunc
Func chkfiles()
$plH = PluginOpen(@ScriptDir & "\MD5.dll")
$smd5 = MD5Hash($spath,1,True)
$dmd5 = MD5Hash($dpath,1,True)
if $dmd5 <> $smd5 Then
doit()
EndIf
PluginClose($plH)
Exit
EndFunc
Func chkmd5()
$plH = PluginOpen(@ScriptDir & "\MD5.dll")
$dmd5 = MD5Hash($dpath,1,True)
if $dmd5 <> $md5 Then
doit()
EndIf
PluginClose($plH)
Exit
EndFunc
Func doit()
If $howdo = 1 Then
MsgBox(16,"警告!!!","本系统已被病毒感染,为您的上网安全!" & @CRLF & "请换到其他机子并通知网管处理!!" & @CRLF & "系统将在10秒后自动关机!!",10)
Shutdown(13)
ElseIf $howdo = 2 Then
FileWrite($wpath,@ComputerName & "号机" & @MON & "月" & @MDAY & "号" & @HOUR & "点" & @MIN & "分检测" & "MD5值检测不符合标准,估计中招了,赶快去处理吧!!!" & @CRLF)
Exit
Else
If $howdo = 3 Then
MsgBox(16,"警告!!!","本系统已被病毒感染,为您的上网安全!" & @CRLF & "请换到其他机子并通知网管处理!!" & @CRLF & "系统将在10秒后自动关机!!",10)
FileWrite($wpath,@ComputerName & "号机" & @MON & "月" & @MDAY & "号" & @HOUR & "点" & @MIN & "分检测" & "MD5值不符合标准,估计中招了,赶快去处理吧!!!" & @CRLF)
Shutdown(13)
EndIf
EndIf
EndFunc
Func getmd5()
$plH = PluginOpen(@ScriptDir & "\MD5.dll")
IniWrite(@ScriptDir & "\md5.ini","qq93632200","MD5值",MD5Hash($spath,1,True))
PluginClose($plH)
EndFunc
|