Hey everyone new here and to vb.net so first off Id like to say HI
So heres my problem I have written a gui for a security tool that checks password strenght (john the ripper). I am having a problem outputting the resulting output to a textbox. Now I think it may lie in my threading not sure.
heres the code
heres the code for the program to run
Heres where the thread is supposed to read the output.
Now I know theres something wrong it does print some text but seems to die or waits till it ends. Sorry if this is a simple thing I am missing this is my first appilication
thanks for your help
bax
So heres my problem I have written a gui for a security tool that checks password strenght (john the ripper). I am having a problem outputting the resulting output to a textbox. Now I think it may lie in my threading not sure.
heres the code
heres the code for the program to run
Public Sub run()
If multirun = 1 Then
multijob()
Else
FileOpen(1, "john.ini", OpenMode.Output)
PrintLine(1, txt1.Text & rules & Txt3.Text)
FileClose(1)
If txtsalt.Text = String.Empty And chk1.Checked = True Then
MsgBox("Salt box is checked and empty!")
ElseIf chksingl.Checked = True Then
inputText = "john -si " & txtpass.Text
ElseIf Chkdouble.Checked = True Then
inputText = "john -external:double " & txtpass.Text
ElseIf chk1.CheckState = 1 Then
inputText = "john -w:" & txtword.Text & " -rules -salts:" & txtsalt.Text & " " & txtpass.Text
ElseIf chk1.CheckState = CheckState.Unchecked And chksingl.Checked = False And Chkdouble.Checked = False Then
inputText = "john -w:" & txtword.Text & " -rules " & txtpass.Text
End If
txt2.AppendText("John The Ripper Has Started" & System.Environment.NewLine)
End If
Readlines()
End Sub
Heres where the thread is supposed to read the output.
Private Sub Readlines()
myProcess.StartInfo.FileName = "cmd.exe"
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.CreateNoWindow = True
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.StartInfo.RedirectStandardError = True
myProcess.StartInfo.RedirectStandardInput = True
myProcess.Start()
myProcess.StandardInput.WriteLine(inputText)
myProcess.StandardInput.WriteLine("exit")
cmd1.Enabled = False
Do While Not myProcess.HasExited
line = myProcess.StandardOutput.ReadLine & System.Environment.NewLine
If Not line.StartsWith("Microsoft") Xor line.StartsWith("(C)") Then
If line.Chars(0) = Chr(13) Then
line = line.Replace(Chr(13), Chr(0))
Else
txt2.AppendText(line)
End If
End If
Loop
myProcess.StandardInput.Close()
myProcess.Close()
cmd1.Enabled = True
Exit Sub
End Sub
Now I know theres something wrong it does print some text but seems to die or waits till it ends. Sorry if this is a simple thing I am missing this is my first appilication
thanks for your help
bax