[RESOLVED] Lil Help for PassBreaker
Creating a simple password Breaker Need help with the readline function.
Current problem: It will run, if i hold enter, and very slowly. If i take out the readline it will execute at perfect speed, but will never end as it can not come to an end.
Here is the full program, un-commented as it is pretty self explanatory.
Thank you
Josh
Re: Lil Help for PassBreaker
Code:
Module Module1
Dim first As String
Dim second As String
Dim third As String
Dim fourth As String
Dim fifth As String
Dim fail As Integer
Sub Main()
Call PassBreak()
Console.WriteLine(fail & " Failed attempts.")
Console.ReadKey()
End Sub
Sub PassBreak()
Dim alphabet(35)
alphabet(0) = "1"
alphabet(1) = "1"
alphabet(2) = "2"
alphabet(3) = "3"
alphabet(4) = "4"
alphabet(5) = "5"
alphabet(6) = "6"
alphabet(7) = "7"
alphabet(8) = "8"
alphabet(9) = "9"
alphabet(10) = "a"
alphabet(11) = "b"
alphabet(12) = "c"
alphabet(13) = "d"
alphabet(14) = "e"
alphabet(15) = "f"
alphabet(16) = "g"
alphabet(17) = "h"
alphabet(18) = "i"
alphabet(19) = "j"
alphabet(20) = "k"
alphabet(21) = "l"
alphabet(22) = "m"
alphabet(23) = "n"
alphabet(24) = "o"
alphabet(25) = "p"
alphabet(26) = "q"
alphabet(27) = "r"
alphabet(28) = "s"
alphabet(29) = "t"
alphabet(30) = "u"
alphabet(31) = "v"
alphabet(32) = "w"
alphabet(33) = "x"
alphabet(34) = "y"
alphabet(35) = "z"
Console.WriteLine("enter password")
Dim password As String = Console.ReadLine.ToLower
Console.Write("currently at: ")
Console.WriteLine()
For start As Integer = 1 To 7
For i As Integer = 0 To 35
first = (alphabet(i))
For ii As Integer = 0 To 35
second = (alphabet(ii))
For iii As Integer = 0 To 35
third = (alphabet(iii))
For iiii As Integer = 0 To 35
fourth = (alphabet(iiii))
For v As Integer = 0 To 35
fifth = (alphabet(v))
Console.Write(first & second & third & fourth & fifth)
If Console.ReadLine = password Then
Console.WriteLine("well done me")
Exit Sub
Else : fail += 1
End If
Next
Next
Next
Next
Next
Next
End Sub
View of loop w/o indent
For start As Integer = 1 To 7
For i As Integer = 0 To 35
first = (alphabet(i))
For ii As Integer = 0 To 35
second = (alphabet(ii))
For iii As Integer = 0 To 35
third = (alphabet(iii))
For iiii As Integer = 0 To 35
fourth = (alphabet(iiii))
For v As Integer = 0 To 35
fifth = (alphabet(v))
Console.Write(first & second & third & fourth & fifth)
If Console.ReadLine = password Then
Console.WriteLine("well done me")
Exit Sub
Else : fail += 1
End If
Next
Next
Next
Next
Next
Next
End Sub
Re: Lil Help for PassBreaker
Can provide comments if needed.
Re: Lil Help for PassBreaker
kay fixed it using a variable, but would still be nice to know if there was a different work around.
Code:
For v As Integer = 0 To 35
fifth = (alphabet(v))
Console.WriteLine(first & second & third & fourth & fifth)
answer = first & second & third & fourth & fifth
If answer = password Then
Console.WriteLine("well done me")
Exit Sub
Else : fail += 1
Re: Lil Help for PassBreaker
took out wl, to guess a 5 letter "zzzzz" pass, it took 60million attempts >.>
Re: Lil Help for PassBreaker
Quote:
Originally Posted by
Joshlad
kay fixed it using a variable, but would still be nice to know if there was a different work around.
I'm confused. You consider variables a work-around? A work-around for what? As far as I can tell, previously for each password postulated by the program, it would be printed to the screen and the user would have to type it back in?
Re: Lil Help for PassBreaker
Well i just changed it to write each letter into a variable, instead of reading it from the console line.