| riki107 |
| | Here we go! Eccomi con la versione 2.0.0 2.0.1 di S.P.U.T.0 , il mio personalissimo programma di protezione del pc Non è un antivirus, non è un criptatore, ma allora "chi schifiu è?" (direbbero dalle mia parti XD) S.P.U.T.0 (anche SPUTO, per comodità) sta per Sistema Protettivo Ultimo - Tentativo 0 (non mi ero mai cimentato in questo tipo di progetto ) Ecco le funzioni di questo codice: CODICE - Una volta avviato, S.P.U.T.0 controllerà se il programma è al primo avvio, aggiungendo un paio di file e cartelle; - Il programma non si basa su finestre, ma è completamente gestibile dall'icona situata vicino l'orologio; - Una volta impostata la password e avviata la protezione, il programma oscurerà lo scherma e comparirà un pop-up per avvisare l'utente che S.P.U.T.0 è in esecuzione; - Durante la protezione, il mouse sarà bloccato al centro dello schermo, il tasto con il logo di Windows non funzionerà e il menù start e il task manager saranno inaccessibili; (Nota: se si forza la chiusura di S.P.U.T.0 con un programma esterno, il menù Start e i tasti Windows rimarranno disabilitati: aprire di nuovo S.P.U.T.0 per riabilitarli) - Una volta premuto il tasto SHIFT sentirete un suono: da quel momento si ha a disposizione del tempo (attualmente 20 secondi, in seguito sarà definibile dall'utente) per digitare la password; - Se la password è corretta, si sentiranno due suoni, comparirà un pop-up e la protezione verrà disattivata; - Se la password è sbagliata, si sentirà un suono grave e lo schermo si oscurerà di nuovo (per ritentare, premere di nuovo SHIFT) - Se la password non viene immessa entro un tot di tempo (attualmente 20 secondi, in seguito sarà definibile dall'utente), si sentirà una sequenza di suoni, e per riprovare bisognerà ri-premere SHIFT; Changelog V. 2.0.0: CODICE - Riogranizzato l'inserimento della password, ora invisibile; - Fixati due bug (Task Manager e apertura menù Start); - Inseriti suoni e pop-ups; - Disabilitato l'uso del menu Start e dei tasti Windows durante la protezione; Bug attualmente conosciuti: 0 (Diamine ) -> 1 -> 0 ( ) - Sicurezza della protezione, in fase di correzione D: Corretta (2.0.1) - Pressione SHIFT destro Corretto (2.0.1) Progetti per la prossima versione: CODICE - Popup suggerimento (x/y char) e testo inserito ; - Cambiare icona durante protezione ;
Aggiunta Menu Opzioni: - Opzione Tempo per password (Per ora 20 sec.) - Opzione Abilita/Disabilita Suoni :) - Opzione Abilita/Disabilita Pop-up :) - Opzioni "Reset Totale" e "Reset Password" - Opzione "Minimizza finestre durante protezione" - Opzione "Esecuzione automatica" Codice: CODICE #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=wmploc_815.ico #AutoIt3Wrapper_Res_Comment=Sistema Protettivo Ultimo - Tentativo 0 #AutoIt3Wrapper_Res_Fileversion=0.2.0.1 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_Language=1040 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------------------- | | | Nome programma: S.P.U.T.0 | | | | ovvero | | | | Sistema Protettivo Ultimo - Tentativo 0 | | | | Data di inizio progetto: 30 aprile 2013, 21.08.29 | | | | Autore: Riccardo Salerno | | | | Obiettivo: Creare un sistema di protezione del pc abbastanza comodo ed efficente | | | #ce ----------------------------------------------------------------------------------------
#cs ------------------------------------------------------------------------------------------------ | Aggiunti nella V.2: | | - Pass invisibile, si sente un suono una volta premuto Shift; | | - Blocco tasto Start (se si forza la chiusura, riaprire S.P.U.T.0 per abilitare) | | - Blocco tasti Win (idem come sopra) (Spesso crasha per questo a fine protezione) | | - Suoni lollosi XD | | - Pop-ups ^_^ | #ce ------------------------------------------------------------------------------------------------
; Stra-importante: Aggiungere uno script esterno chiamato services.exe sempre attivo, tale che se il programma crasha lo riavvia, ; se il programma viene chiuso forzatamente allora lo riapre e lo mette in stato protezione, ; se il pc viene riavviato all'avvio successivo parte con la protezione, ...
#cs -------------------------------------------------------- | Da aggiungere: | | | | - Popup suggerimento (x/y car) e testo inserito | | - Cambiare icona durante protezione | | - Singleton | | | Menu Opzioni: | | | | - Opzione Tempo per password (Per ora 20 sec.) | | - Opzione Abilita/Disabilita Suoni :) | | - Opzione Abilita/Disabilita Pop-up :) | | - Opzioni "Reset Totale" e "Reset Password" | | - Opzione "Minimizza finestre durante protezione" | | - Opzione "Esecuzione automatica" | | | #ce --------------------------------------------------------
#include "BlockInputEx.au3" #include "(De)Cript Math.au3" #include <Misc.au3> #include "Notify.au3" #include <Security.au3> #include <SendMessage.au3>
Opt("WinTitleMatchMode", 4) Opt("TrayMenuMode", 3)
TraySetIcon("C:\WINDOWS\system32\wmploc.dll", -66) TraySetToolTip("S.P.U.T.0 (Sistema Protettivo Ultimo - Tentativo 0)")
Global $keys[3] = ["A0", "5B", "5C"] ; LEFT SHIFT, LEFT WIN, RIGHT WIN Global $dll = "user32.dll"
Global $sec = False Global $new = False Global $Type = ""
Global $sAccount = @UserName Global $tSID = _Security__GetAccountSid($sAccount) Global $sStringSID = _Security__SidToStringSid($tSID) Global $Fp = @UserProfileDir & "\{" & $sStringSID & "}\S.P.U.T.0\lock.k" ; File con pass
$MenuItem1 = TrayCreateItem("Avvia") $MenuItem2 = TrayCreateItem("Cambia password") TrayCreateItem("") $Help = TrayCreateItem("Help") $MenuItem3 = TrayCreateItem("About") TrayCreateItem("") $MenuItem4 = TrayCreateItem("Esci") TraySetState()
AdlibRegister("_Warning", 250)
_Lol()
Func _Lol()
If Not FileExists($Fp) And Not FileExists($Fp & ".mC") Then _FirstRun()
While 1 $nMsg = TrayGetMsg() Switch $nMsg Case $MenuItem1 _Avvia() Case $MenuItem2 _ChangePass() Case $Help _Help() Case $MenuItem3 _About() Case $MenuItem4 _Esci() EndSwitch WEnd
EndFunc
Func _Avvia()
While 1
If FileRead($Fp) = "" And Not FileExists($Fp & ".mC") Then $CheckP = MsgBox(4, "S.P.U.T.0 - Attezione", "Non hai ancora impostato una password." & @CRLF & "Per attivare la protezione è necessario impostarne una." & @CRLF & "Vuoi procedere ora?") If $CheckP = 6 Then $new = True _SetPass() Return Else Return EndIf Else _Start() EndIf
WEnd
EndFunc ;==>_Avvia
Func _Start()
$sec = True $TI = 0 $TP = 0
FileSetAttrib($Fp & ".mC", "-H") _mDecript($Fp & ".mC")
Dim $Read = FileRead($Fp)
_mCript($Fp) FileSetAttrib($Fp & ".mC", "+H")
_SendMessage(WinGetHandle("ClassName=Progman"), 274, 61808, 2) ; Spegne lo schermo
_Notify_Locate(0) $ProtectYou = _Notify_Show(@ScriptFullPath, "S.P.U.T.0 ti sta proteggendo (:", "Premere SHIFT per inserire la password", 0, 0) _Notify_Set(Default)
Global $TP = TimerInit()
Local $Detect[1] $TotTime = 10*1000
Global $Detected = ""
Dim $Min[48]=[' ','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','è','+',',','-','.','ù','ò','\',"'",'ì',"à"] Dim $Max[48]=[' ','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','=','!','"','£','$','%','&','/','(',')','é','*',';','_',':','§','ç','|','?','^','°'] Dim $Sp1S[48]=['','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','[',']','','','','','@','','','','#'] Dim $Sp2CS[48]=['','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','{','}','','','','','','','','',''] Dim $Hex[48]=['20','41','42','43','44','45','46','47','48','49','4A','4B','4C','4D','4E','4F','50','51','52','53','54','55','56','57','58','59','5A','30','31','32','33','34','35','36','37','38','39','BA','BB','BC','BD','BE','BF','C0','DC','DB','DD','DE']
$StringPass = StringSplit($Read, "") ReDim $Detect[$StringPass[0]]
While 1 If _IsPressed("10", $dll) Then ; Tutti gli SHIFT While _IsPressed("10", $dll) = 1 WEnd _Sound("Pass") $TI = TimerInit() $v = 0 While 1 If TimerDiff($TI) < $TotTime Then If $Detect[$StringPass[0]-1] = "" Then For $x = 0 To 47 If (_IsPressed("10", $dll) And (_IsPressed("11", $dll) And _IsPressed("12", $dll))) And _IsPressed($Hex[$x], $dll) Then While _IsPressed($Hex[$x], $dll) = 1 WEnd $Detect[$v] = $Sp2CS[$x] If $Detect[$v] <> "" Then $v += 1 ElseIf (_IsPressed("11", $dll) And _IsPressed("12", $dll)) And _IsPressed($Hex[$x], $dll) Then While _IsPressed($Hex[$x], $dll) = 1 WEnd $Detect[$v] = $Sp1S[$x] If $Detect[$v] <> "" Then $v += 1 ElseIf (_IsPressed("10", $dll)) And _IsPressed($Hex[$x], $dll) Then While _IsPressed($Hex[$x], $dll) = 1 WEnd $Detect[$v] = $Max[$x] $v += 1 ElseIf _IsPressed($Hex[$x], $dll) Then While _IsPressed($Hex[$x], $dll) = 1 WEnd $Detect[$v] = $Min[$x] $v += 1 EndIf Next
Else
$d = 0
Do $Detected = $Detected & $Detect[$d] $d += 1 Until $d = $StringPass[0]
If $Detected = $Read Then _Notify_Hide($ProtectYou) _Unlock() Else _Notify_Hide($ProtectYou) _Sound("Wrong") _Start() EndIf EndIf Else _Sound("Time Up") ExitLoop EndIf WEnd EndIf WEnd
EndFunc ;==>_Start
Func _Unlock()
$sec = False _Sound("Done") _Notify_Show(@ScriptFullPath, "S.P.U.T.0", "S.P.U.T.0 ti ha protetto per "&Round(TimerDiff($TP)/1000)&" secondi. (:", 5, 1) _Lol()
EndFunc ;==>_Unlock
Func _FirstRun()
TrayTip("Benvenuto in S.P.U.T.0!", "Ciao " & $sAccount & "!" & @CRLF & "Cliccami per accedere alle opzioni!", 4)
DirCreate(@UserProfileDir & "\{" & $sStringSID & "}\S.P.U.T.0\") FileOpen(@UserProfileDir & "\{" & $sStringSID & "}\S.P.U.T.0\lock.k", 1) FileClose(@UserProfileDir & "\{" & $sStringSID & "}\S.P.U.T.0\lock.k") FileSetAttrib(@UserProfileDir & "\{" & $sStringSID & "}\", "+H", 1)
Sleep(1000)
If FileRead($Fp) = "" And Not FileExists($Fp & ".mC") Then
$CheckP2 = MsgBox(4, "S.P.U.T.0 - Attezione", "Devi impostare una password per rendere efficente la protezione." & @CRLF & "Vuoi procedere ora?")
If $CheckP2 = 6 Then _SetPass() Return Else Return EndIf EndIf
EndFunc ;==>_FirstRun
Func _SetPass()
$Set1 = InputBox("Imposta password", "Imposta una password per rendere efficente la protezione.", "", "+M") If @error = 1 Then Return $Set2 = InputBox("Imposta password", "Per sicurezza, reinserisci la password appena immessa.", "", "+M") If @error = 1 Then Return
If $Set1 <> $Set2 Then $sErMsg = MsgBox(4, "S.P.U.T.0 - Errore", "Attenzione! Le due password non coincidono." & @CRLF & "Vuoi riprovare?") If $sErMsg = 6 Then _SetPass() Else Return EndIf Else $Op = FileOpen($Fp, 1) FileWrite($Op, $Set1) FileClose($Op) Sleep(1000) FileSetAttrib($Fp, "-H") _mCript($Fp) FileSetAttrib($Fp & ".mC", "+H") If $new = True Then $new = False _Avvia() Else _Lol() EndIf EndIf
EndFunc ;==>_SetPass
Func _ChangePass()
If FileRead($Fp & ".mC") = "" And Not FileExists($Fp & ".mC") Then
$CheckP1 = MsgBox(4, "S.P.U.T.0 - Attezione", "Non hai ancora impostato una password." & @CRLF & "Vuoi procedere ora?") If $CheckP1 = 6 Then _SetPass() Return Else Return EndIf Else $Set0 = InputBox("Imposta password", "Inserisci la vecchia password.", "", "+M") If @error = 1 Then Return $Set1 = InputBox("Imposta password", "Imposta una nuova password.", "", "+M") If @error = 1 Then Return $Set2 = InputBox("Imposta password", "Per sicurezza, reinserisci la password appena immessa.", "", "+M") If @error = 1 Then Return
If $Set1 <> $Set2 Then $sErMsg = MsgBox(4, "S.P.U.T.0 - Errore", "Attenzione! Le due nuove password non coincidono." & @CRLF & "Vuoi riprovare?") If $sErMsg = 6 Then _ChangePass() Return Else Return EndIf Else FileSetAttrib($Fp & ".mC", "-H") _mDecript($Fp & ".mC") If $Set0 <> FileRead($Fp) Then _mCript($Fp) FileSetAttrib($Fp & ".mC", "+H") $erPASScheck = MsgBox(4, "S.P.U.T.0 - Errore", "Attenzione! Password errata!" & @CRLF & "Vuoi riprovare?") If $erPASScheck = 6 Then _ChangePass() Return Else Return EndIf Else $opn = FileOpen($Fp, 2) FileWrite($opn, $Set1) FileClose($opn) _mCript($Fp) FileSetAttrib($Fp & ".mC", "+H") Return EndIf EndIf
EndIf EndFunc ;==>_ChangePass
Func _Help()
Local $m1 = 'Utilizzare S.P.U.T.0 è semplicissimo:'&@CRLF&@CRLF&'- Una volta premuto "Avvia", lo schermo si oscurerà'&@CRLF Local $m2 = '- Mouvendo il mouse tornerà visibile'&@CRLF&'- Premuto il tasto SHIFT, si deve immettere la password'&@CRLF Local $m3 = '- Una volta inserita la protezione verrà disattivata'&@CRLF&@CRLF MsgBox(0, "S.P.U.T.0 - Help", $m1&$m2&$m3&'Per info o malfunzionamenti, contattami via e-mail: rikisale@gmail.com') Return
EndFunc ;==>_Help
Func _About()
MsgBox(0, "S.P.U.T.0 - About", "Creato da Riccardo Salerno"&@CRLF&"rikisale@gmail.com"&@CRLF&@CRLF&"Vieni a trovarmi anche su"&@CRLF&"www.autoit.forumcommunity.net") Return
EndFunc ;==>_About
Func _Esci()
$ex = MsgBox(4, "S.P.U.T.0 - Chiusura", "Vuoi veramente uscire?") If $ex = 6 Then _MouseTrap() AdlibUnRegister("_Warning") Exit EndIf
EndFunc ;==>_Esci
Func _Warning()
$MGP = MouseGetPos()
If $sec = True Then
If $MGP[0] < ((@DesktopWidth / 2) - (1 / 2)) Or $MGP[0] > ((@DesktopWidth / 2) + (1 / 2)) Or $MGP[1] < ((@DesktopHeight / 2) - (1 / 2)) Or $MGP[1] > ((@DesktopHeight / 2) + (1 / 2)) Then _MouseTrap((@DesktopWidth / 2) - (1 / 2), (@DesktopHeight / 2) - (1 / 2), (@DesktopWidth / 2) + (1 / 2), (@DesktopHeight / 2) + (1 / 2)) EndIf
If ControlCommand("classname=Shell_TrayWnd", "", "Button1", "IsEnabled", "") = 1 Then ControlDisable ("classname=Shell_TrayWnd", "", "Button1") ; Disabilita Start _BlockInputEx (1, "", "0x"&$keys[1]&"|0x"&$keys[2]&"|0x73") ; Blocca i tasti WIN & F4 EndIf
If ProcessExists("taskmgr.exe") Then ProcessClose("taskmgr.exe") EndIf
ElseIf $sec = False Then
If $MGP[0] < ((@DesktopWidth / 2) - (1 / 2)) Or $MGP[0] > ((@DesktopWidth / 2) + (1 / 2)) Or $MGP[1] < ((@DesktopHeight / 2) - (1 / 2)) Or $MGP[1] > (( @DesktopHeight / 2) + (1 / 2)) Then _MouseTrap() EndIf
If ControlCommand("classname=Shell_TrayWnd", "", "Button1", "IsEnabled", "") = 0 Then ControlEnable ("classname=Shell_TrayWnd", "", "Button1") ; Abilita Start _BlockInputEx (0) ; Sblocca i tasti WIN EndIf
EndIf
EndFunc ;==>_Warning
Func _Sound($Type)
Switch $Type
Case "Done" Beep(540, 100) Beep(1450, 350)
Case "Wrong" Beep(150, 275)
Case "Time Up" Beep(700, 150) Sleep(20) Beep(660, 150) Sleep(20) Beep(620, 150) Sleep(20) Beep(580, 150) Sleep(20) Beep(535, 500) Sleep(100) Beep(510, 600)
Case "Pass" Beep (800, 100) Beep (700, 100)
EndSwitch
EndFunc ;==>_Sound (Sì, lo so, le 3 zone dei commenti sono venute da schifo, ma nel mio sono perfette, giuro ) Codice + UDFs + Icona + EseguibileVia ai commenti! Peace and love ( and B > 0 ) Edited by riki107 - 5/6/2013, 20:40
| | |
| |
|