#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: Matwachich Script Function: #ce ---------------------------------------------------------------------------- #Include #include #include #include Opt("GUIOnEventMode", 1) $file1 = 0 $file2 = 0 HotKeySet("{esc}", "_cls") #region - GUI Create GUICreate('Hash compare',400,300, -1, -1, -1, $WS_EX_ACCEPTFILES) $out = GUICtrlCreateEdit("", 10, 10, 380, 280, BitOR($ES_READONLY,$WS_VSCROLL,$ES_AUTOVSCROLL)) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUISetState() #endregion GUISetOnEvent($GUI_EVENT_DROPPED, "_dropHandle") GUISetOnEvent($GUI_EVENT_CLOSE, "_quit") _Crypt_Startup() #region - GUI SelectLoop While 1 Sleep(1000) WEnd #endregion Func _dropHandle() If Not $file1 Then $file1 = StringReplace(@GUI_DragFile, @CRLF, "") _out("File 1 set.") Return EndIf If Not $file2 Then $file2 = StringReplace(@GUI_DragFile, @CRLF, "") _out("File 2 set.") _hashCompare() $file1 = 0 $file2 = 0 Return EndIf EndFunc Func _hashCompare() Local $hash1, $hash2 _out("Starting...") _out("Hashing File 1...") $hash1 = _Crypt_HashFile($file1, $CALG_MD2) _out("Done! (" & $hash1 & ")") _out("Hashing File 2...") $hash2 = _Crypt_HashFile($file2, $CALG_MD2) _out("Done! (" & $hash2 & ")") If $hash1 = $hash2 Then _out("Hash OK!") Else _out("Hash differents") EndIf _out("=============================================" & @CRLF) EndFunc Func _out($data) Local $tmp = GUICtrlRead($out) If $tmp = "" Then GUICtrlSetData($out, "> " & $data & @CRLF) Else GUICtrlSetData($out, $tmp & "> " & $data & @CRLF) EndIf EndFunc Func _cls() GUICtrlSetData($out, "") $file1 = 0 $file2 = 0 EndFunc Func _quit() _Crypt_Shutdown() Exit EndFunc