Jump to content

Help here in login system close and open my progran


Recommended Posts

i tryed to adpter this login box but after system login and ok my program dont open GUI only ok for dialogboxby login box plz anyone help me

;;================================================================================
;;INCLUDES
;;================================================================================
#include <INet.au3>
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>

;;================================================================================
;;VARIABEL DEFINITION
;;================================================================================
$WebFileLoc = "xxxx/login.php";Put the link to the login file here.

;;================================================================================
;;GUI CREATION
;;================================================================================
$Login = GUICreate("Login",220,100)                                                         ; //Create the login window
$User = GUICtrlCreateInput("Username",10,10)                                                ; //Create the Username Input
$Pass = GUICtrlCreateInput("Password",10,40,-1,-1,$ES_PASSWORD)                             ; //Create the Password Input
$OKbutton = GUICtrlCreateButton("Login",110,70,100)                                         ; //Create the Login Button
$Exit = GUICtrlCreateButton("Exit",10,70,100)                                               ; //Create the Exit Button
GUISetState()                                                                               ; //Display the GUI

;;================================================================================
;;LOGIN LOOP
;;================================================================================
While 1                                                                                     ; //Initialize loop
    $msg = GUIGetMsg()                                                                      ; //Recive Input
    Select
        Case $msg = $GUI_EVENT_CLOSE or $msg = $Exit                                        ; //If the Exit or Close button is clicked, close the app.
            MsgBox(0, "TERMINADO", "Bye")                                                   ; //Say goodbye
            Exit                                                                            ; //Exit the Application
        Case $msg = $OKbutton                                                               ; //If the Login button is clicked goto the login function
            _login()
    EndSelect
WEnd

;;================================================================================
;;_login()
;;================================================================================
func _login()
$UsernameInput = GUICtrlRead($User)                                                         ; //Get the username from the Input
$PasswordInput = GUICtrlRead($Pass)                                                         ; //Get the password from the Input
if $UsernameInput = "" or $PasswordInput = "" Then                                          ; //Check if the user forgot to put in username and/or password_
    MsgBox(0,"ERROR","Por favor ponha uma senha e  usuario")                                ;         -> Then Print this error 
Else
    $WEBdata = _INetGetSource($WebFileLoc &'?user=' & $UsernameInput & '&pass=' & $PasswordInput); //Get the data from the PHP file
    
    if $WEBdata = "02" Then                         ; //Check for Error outputs_
        MsgBox(0,"Error","Desculpe" & @lf & "Usuario e senha incorreta ou cadastre-se");->Display error output
    ElseIf $WEBdata ="0102" Then        
        MsgBox(0,"Error","Desculpe" & @lf & "Senha incorreta")              ;->Display error output
    Else                                                                                            
        msgbox(0,"Welcome","Welcome" & @lf & "data = " & StringTrimRight($WEBdata,2))       ; //Login Sucessfull. Post data.
    EndIf
EndIf
EndFunc;--> _login()
dim $appname = "MU Packet Sniffer"
dim $packetget, $i = 0
dim $collect_data
global $oPktX
dim $bytelength = -54
dim $timeframe
dim $valuesOwn[35]
dim $hexoffset = 256/60
dim $hexoffsetMin = 256/(60*24)
dim $number = 0
dim $transyn = 1
;;================================================================================
;;GUI Creation
;;================================================================================
GUICreate($appname, 730, 260)
;;SetPrivilege("SeDebugPrivilege", 1)
;ControlS
$Button_1 = GUICtrlCreateButton ("Start Capture",  170, 230, 100)
$Button_2 = GUICtrlCreateButton ("Stop Capture",  390, 230, 100)
$Button_3 = GUICtrlCreateButton ("Clear",  280, 230, 100)
$ontop= GUICtrlCreateCheckbox ("On Top", 5, 220, 120, 18)
$trans= GUICtrlCreateCheckbox ("Transparent", 5, 240, 80, 18)
$listview = GUICtrlCreateListView ("NR|SIZE|DATA          |",8,10,713,110)
GUICtrlSetFont (-1,8, 400, "", "Lucida Console")
_GUICtrlListViewSetColumnWidth ( $listview, 0, 27 )
_GUICtrlListViewSetColumnWidth ( $listview, 1, 39 )
_GUICtrlListViewSetColumnWidth ( $listview, 2, 624 )
;info
$captions = GUICtrlCreateLabel ("01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34",  82, 121,700)
GUICtrlSetFont (-1,8, 400, "", "Lucida Console")
GUICtrlSetColor(-1,0x8888888)
GUICtrlCreateLabel("", 1, 130, 800, 3,BitOr($SS_CENTER ,$SS_SUNKEN))
GUICtrlCreateLabel("", 1, 145, 800, 3,BitOr($SS_CENTER ,$SS_SUNKEN))
GUICtrlCreateLabel("", 440, 147, 3, 80,BitOr($SS_CENTER ,$SS_SUNKEN))
$lastinput = GUICtrlCreateLabel ("last input:",  10, 135,700,10)
GUICtrlSetFont (-1,8, 400, "", "Lucida Console")
$packetsrecived = GUICtrlCreateLabel ("Packets Recived:",  10, 150,190)
GUICtrlSetFont (-1,8, 400, "", "Lucida Console")
;data
GUISetState ()
packetget()
;;================================================================================
;;Packetget
;;================================================================================
func packetget()
While 1
$msg = GUIGetMsg()
Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_1
        $packetget = 1
    Case $msg = $Button_3
        _GUICtrlListViewDeleteAllItems ( $listview )
        $number = 0
    EndSelect
        if GUICtrlRead($trans) = 4 Then
        if $transyn = 1 Then
            WinSetTrans( $appname, "", 255)
            $transyn = 0
        EndIf
    Else
        if $transyn = 0 Then
            WinSetTrans( $appname, "", 200)
            $transyn = 1
        EndIf
    EndIf
    if GUICtrlRead($ontop) = 1 Then
        WinSetOnTop($appname, "", 1)
    Else
        WinSetOnTop($appname, "", 0)
    EndIf
if $packetget = 1 Then
    
    $oPktX = ObjCreate("PktX.PacketX")
    If Not IsObj($oPktX) Then MsgBox(0, "ERROR", "No Object")
        $EventObject = ObjEvent($oPktX, "PacketX_")
    For $i = 1 To $oPktX.Adapters.Count
Next
$oPktX.Adapter = $oPktX.Adapters ($oPktX.Adapters.Count)
$oPktX.Start
while $packetget 
; Script generated by AutoBuilder 0.6 Prototype

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 323,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))


GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---
= 1
    Sleep(10)
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_2
        $oPktX.stop
        $oPktX = 0
        $packetget = 0
    Case $msg = $Button_3
        _GUICtrlListViewDeleteAllItems ( $listview )
        $number = 0
    EndSelect
        if GUICtrlRead($trans) = 4 Then
        if $transyn = 1 Then
            WinSetTrans( $appname, "", 255)
            $transyn = 0
        EndIf
    Else
        if $transyn = 0 Then
            WinSetTrans( $appname, "", 200)
            $transyn = 1
        EndIf
    EndIf
    if GUICtrlRead($ontop) = 1 Then
        WinSetOnTop($appname, "", 1)
    Else
        WinSetOnTop($appname, "", 0)
    EndIf
WEnd
EndIf
Wend
EndFunc


;;================================================================================
;;Packet Filter
;;================================================================================
Func PacketX_OnPacket($oPacket)

    For $bByte In $oPacket.Data
        $bytelength = $bytelength + 1
        if $bytelength > 0 Then
            $i = $i + 1
            if $bytelength < 35 Then
            $valuesOwn[$i] = Hex($bByte,2)
            EndIf
            $collect_data = $collect_data & Hex($bByte,2) & " "
        EndIf
    Next
    if $valuesOwn[01] = "C1"  Then
        $number = $number + 1
            GuiCtrlCreateListViewItem($number & "|" & $bytelength & "|" & $collect_data & "|",$listview)
            GUICtrlSetData($lastinput,"Last input: " &$collect_data)
            GUICtrlSetData($packetsrecived, "Packets Recived: " & $number)
        EndIf
        if $valuesOwn[01] = "C2"  Then
        $number = $number + 1
            GuiCtrlCreateListViewItem($number & "|" & $bytelength & "|" & $collect_data & "|",$listview)
            GUICtrlSetData($lastinput,"Last input: " &$collect_data)
            GUICtrlSetData($packetsrecived, "Packets Recived: " & $number)
        EndIf
        if $valuesOwn[01] = "C3"  Then
        $number = $number + 1
            GuiCtrlCreateListViewItem($number & "|" & $bytelength & "|" & $collect_data & "|",$listview)
            GUICtrlSetData($lastinput,"Last input: " &$collect_data)
            GUICtrlSetData($packetsrecived, "Packets Recived: " & $number)
        EndIf
        $i = 0
    $collect_data = ""
    $bytelength = -54

EndFunc ;==>PacketX_OnPacket
Edited by renanzin
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...