#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.12.0
Author: myName
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
#include <Crypt.au3>
#include <File.au3>
#include <Array.au3>
#include <GUIConstantsEx.au3>
_Crypt_Startup() ; To optimize performance start the crypt library.
Local $hGUI = GUICreate("GTA V - File Checker", 540, 600)
Local $idCheckButton = GUICtrlCreateButton("Starte Check", 20, 20, 85, 25)
Local $idCloseButton = GUICtrlCreateButton("Beenden", 130, 20, 85, 25)
; Display the GUI.
GUISetState(@SW_SHOW, $hGUI)
; Loop until the user exits.
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $idCloseButton
ExitLoop
Case $idCheckButton
DoCheck()
EndSwitch
WEnd
; Delete the previous GUI and all controls.
GUIDelete($hGUI)
Exit
Func DoCheck()
Local $idMylist = GUICtrlCreateListView("Datei |Status", 20, 60, 500, 520)
Local $idStatus = GUICtrlCreateLabel("Prüfe Dateien - bitte warten", 245,25)
Global $path = @ScriptDir & "\"
Global $arrFiles = 0
$result = ""
FileInstall(".\SHA1checkTable_full.csv", @ScriptDir & "\SHA1checkTable_full.csv")
_FileReadToArray($path & "SHA1checkTable_full.csv",$arrFiles, 0, ",")
MsgBox("","",UBound($arrFiles) & " Dateien werden geprüft - weiter mit OK")
For $i = 0 To UBound($arrFiles) -1
$CurrentFile = $path & $arrFiles[$i][0]
$CorrectHash = $arrFiles[$i][1]
If FileExists($CurrentFile) Then
$Hash = _Crypt_HashFile($CurrentFile, $CALG_SHA1)
If $Hash = "0x" & $CorrectHash Then
GUICtrlCreateListViewItem($CurrentFile & "|" & "Hash korrekt!", $idMylist)
Else
If $arrFiles[$i][0] = "GTAVLauncher.exe" And $Hash = "0x398cec42e611bedd195c8de65af700cf6ac9bf7b" Then
GUICtrlCreateListViewItem($CurrentFile & "|" & "Hash korrekt! (Day 0 Patch)", $idMylist)
Else
GUICtrlCreateListViewItem($CurrentFile & "|" & "Hash NICHT korrekt!", $idMylist)
EndIf
EndIf
Else
GUICtrlCreateListViewItem($CurrentFile & "|" & "nicht vorhanden", $idMylist)
EndIf
Next
GUICtrlSetData ($idStatus, "Fertig!")
_Crypt_Shutdown() ; Shutdown the crypt library.
EndFunc