CODICE
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.6.1
Author: =KiNg_P@Y€=
QUESTA LIBRERIA PERMETTERE DI GENERARE STRINGHE A CASO...
I COMANDI SONO SEMPLICI:
GenRandom($m,$min,$max,$m2 = 0,$s = 0)
$m = Tipo di caratteri con il quale verrà formata la stringa.
$m = 0 (lattere numeri e simboli)
$m = 1 (lettere e numeri)
$m = 2 (lettere)
$m = 3 (numeri)
$min = Numero minimo di caratteri di linghezza.
$max = Numero massimo di caratteri di lunghezza.
$m2 = Specifiche della stringa creata.
$m2 = 0 (misto fra carettari in stampato e in minuscolo)
$m2 = 1 (caratteri in stampato)
$m3 = 2 (caratteri in minuscolo)
$s = Eseguire o meno un controllo per verificare che la scringa generata non sia uguale a un'altra generata in precedenza.
$s = 0 (non verrà controllato)
$s = 1 (verrà controllato) [creerà un file string.log]
{AVRAI IN RISPOSTA UNA STRINGA RANDOM CON LE SPECIFICHE CHE HAI SCIELTO}
Usa resetsec() per resettare il sistema di sicurezza per evitare che al riavvio del programma non usi più le stringhe usate prima.
{AVRAI IN RISPOSTA 1 SE E STATO ELIMINATO CORRETTAMENTE O 0 SE NON E' ANDATO A BUON FINE}
Usa infol() per ricevere tutti i dettagli riguardante il file log del sistema di sicurezza.
{AVRAI IN RISPOSTA UN "N 231,0,8kb" SE IL FILE LOG ESISTE ALTRIMENTI UN False SE NON EISTE}
Usa Found($name) per verificare se una stringa e stata generata (con sicurezza attiva).
$name= "sdhjk" (stringa da cercare)
{AVRAI IN RISPOSTA O IL NUMERO DELLA RIGA IN CUI SI TROVA LA STRINGA O UN False IN CASO DI ESITO DI RECERCA NEGATIVO}
#ce ----------------------------------------------------------------------------
#include <File.au3>
#RequireAdmin
$allc='1"2"3"4"5"6"7"8"9"0"ì"!"£"$"%"&"/"(")"="?"^"Q"W"E"R"T"Y"U"I"O"P"é"*"A"S"D"F"G"H"J"K"L"ç"°"§"<">"X"C"V"B"N"M";":"_","."-"ò"à"ù"è"+"@"#"{"}"["]'
$len='A"B"C"D"E"F"G"H"I"L"M"N"O"P"Q"R"S"T"U"V"Z"X"Y"K"W"J"1"2"3"4"5"6"7"8"9"0'
$letter='A"B"C"D"E"F"G"H"I"L"M"N"O"P"Q"R"S"T"U"V"Z"X"Y"K"W"J'
$num='1"2"3"4"5"6"7"8"9"0'
Func GenRandom($m,$min,$max,$m2 = 0,$s = 0)
while 1
$tot=""
$long=Random($min,$max,1)
if $m = 0 Then ;se 0 lettere numeri e simboli
$st=StringSplit($allc,'"')
$maxi=$st[0]
$tot=""
if $m2 = 0 Then ;se 0 = misto misto
For $n = 1 to $long step +1
$mom=$tot
if random(1,2,1) = 1 Then
$tot=$mom&StringLower($st[Random(1,$maxi,1)])
Else
$tot=$mom&$st[Random(1,$maxi,1)]
EndIf
Next
ElseIf $m2 = 1 Then;se 1 = misto stampato
For $n = 1 to $long step +1
$mom=$tot
$tot=$mom&$st[Random(1,$maxi,1)]
Next
ElseIf $m2 = 2 Then;se 2 = misto piccolo
For $n = 1 to $long step +1
$mom=$tot
$tot=$mom&StringLower($st[Random(1,$maxi,1)])
Next
EndIf
ElseIf $m = 1 Then ;se 1 lettere e numeri
$st=StringSplit($len,'"')
$maxi=$st[0]
$tot=""
if $m2 = 0 Then ;se 0 = misto misto
For $n = 1 to $long step +1
$mom=$tot
if random(1,2,1) = 1 Then
$tot=$mom&StringLower($st[Random(1,$maxi,1)])
Else
$tot=$mom&$st[Random(1,$maxi,1)]
EndIf
Next
ElseIf $m2 = 1 Then;se 1 = misto stampato
For $n = 1 to $long step +1
$mom=$tot
$tot=$mom&$st[Random(1,$maxi,1)]
Next
ElseIf $m2 = 2 Then;se 2 = misto piccolo
For $n = 1 to $long step +1
$mom=$tot
$tot=$mom&StringLower($st[Random(1,$maxi,1)])
Next
EndIf
ElseIf $m = 2 Then ;se 2 solo lettere
$st=StringSplit($letter,'"')
$maxi=$st[0]
$tot=""
if $m2 = 0 Then ;se 0 = misto misto
For $n = 1 to $long step +1
$mom=$tot
if random(1,2,1) = 1 Then
$tot=$mom&StringLower($st[Random(1,$maxi,1)])
Else
$tot=$mom&$st[Random(1,$maxi,1)]
EndIf
Next
ElseIf $m2 = 1 Then;se 1 = misto stampato
For $n = 1 to $long step +1
$mom=$tot
$tot=$mom&$st[Random(1,$maxi,1)]
Next
ElseIf $m2 = 2 Then;se 2 = misto piccolo
For $n = 1 to $long step +1
$mom=$tot
$tot=$mom&StringLower($st[Random(1,$maxi,1)])
Next
EndIf
ElseIf $m = 3 Then ;se 3 solo numeri
$st=StringSplit($num,'"')
$maxi=$st[0]
$tot=""
For $n = 1 to $long step +1
$mom=$tot
$tot=$mom&$st[Random(1,$maxi,1)]
Next
EndIf
if $s = 0 Then ;se il sistema di sicurezza è 'disarmato' = fine
ExitLoop
Else ;se è armato controlla
$line=_FileCountLines('string.log')
$n=1
$sict='no'
Do
if $tot = FileReadLine('string.log',$n) Then
$sict = 'si'
$n=Execute($line+4)
;MsgBox(0,'trovato',$tot)
Else
$n+=1
$sict='no'
EndIf
Until $n > $line
EndIf
if $sict = 'si' Then
Else
FileWrite('string.log',$tot&@CRLF)
;$tested+=1
ExitLoop
EndIf
; EndIf
WEnd
;MsgBox(0,$long,$tot,1)
;ToolTip($tot)
;Sleep(200)
Return $tot
EndFunc
Func resetsec()
$del=FileDelete('string.log')
Return $del
EndFunc
func infol()
if FileExists ('string.log') Then
$line=_FileCountLines('string.log')
$size=FileGetSize('string.log')
Return "N: "&$line&","&Execute($size/1000)&"kb"
Else
Return 'False'
EndIf
EndFunc
Func Found($name)
$line=_FileCountLines('string.log')
$n=1
$sict='no'
Do
if $name = FileReadLine('string.log',$n) Then
$sict = 'si'
$l=$n
$n=Execute($line+4)
Else
$n+=1
$sict='no'
EndIf
Until $n > $line
if $sict = 'si' Then
Return $l
Else
Return 'False'
EndIf
EndFunc