#include <Crypt.au3>
If Not @Compiled Then Exit MsgBox(64, 'Info', 'Запускайте только скомпилированный скрипт!')
If $CmdLine[0] Then
FileMove(@ScriptFullPath, $CmdLine[1], 1)
Exit
EndIf
OnAutoItExitRegister('_NewMD5')
HotKeySet('{Esc}', '_Exit')
MsgBox(64, 'MD5', Hex(_Crypt_HashFile(@ScriptFullPath, $CALG_MD5)))
While 1
ToolTip(StringFormat('%02d:%02d:%02d\nEsc - выход', @HOUR, @MIN, @SEC), 0, 0)
Sleep(1000)
WEnd
Func _NewMD5()
Local $h_File, $s_Read, $s_End = 'AU3!EA06'
$h_File = FileOpen(@ScriptFullPath, 0)
$s_Read = FileRead($h_File)
FileClose($h_File)
$h_File = FileOpen(@TempDir & '\' & @ScriptName, 2)
FileWrite($h_File, StringLeft($s_Read, StringInStr($s_Read, $s_End, 1, -1) + 8) & Random())
FileClose($h_File)
Run('"' & @TempDir & '\' & @ScriptName & '" "' & @ScriptFullPath & '"')
EndFunc ;==>_NewMD5
Func _Exit()
Exit
EndFunc ;==>_Exit