Jump to content

add a password to my script


Noobcube
 Share

Recommended Posts

i have a script

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$AL = GUICreate("AL Accounts", 115, 410, 193, 125)
GUISetBkColor(0xFFFFFF)
$Button1 = GUICtrlCreateButton("Zerker", 8, 24, 97, 25, 0)
$Button2 = GUICtrlCreateButton("Ele", 8, 56, 97, 25, 0)
$Button3 = GUICtrlCreateButton("Archer 1", 8, 88, 97, 25, 0)
$Button4 = GUICtrlCreateButton("Archer 2", 8, 120, 97, 25, 0)
$Button5 = GUICtrlCreateButton("Ranger 1", 8, 152, 97, 25, 0)
$Button6 = GUICtrlCreateButton("Ranger 2", 8, 184, 97, 25, 0)
$Button7 = GUICtrlCreateButton("Sorc", 8, 216, 97, 25, 0)
$Button8 = GUICtrlCreateButton("Mage", 8, 248, 97, 25, 0)
$Button9 = GUICtrlCreateButton("Pinks", 8, 280, 97, 25, 0)
$Button10 = GUICtrlCreateButton("**********", 8, 312, 97, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            msgbox(0, "Zerker Account", "Username: *******, Password

etc

but before it will open, i want it to need a password becuase it contains passwords for things, i wondered if something like

$password = inputbox("Password", "Enter Password", "")

if

$password = thisisthepassword #

run(Info.exe")

if not

exit

as you can tell i dunno how to do it , just wondered if anyone can help, or is it not possible?

Thanks

Edited by Noobcube
Link to comment
Share on other sites

ya can do this.

$input = InputBox("Passord", "","" , "*")
$pass = "password"

if @error = 0 Then
    If $input = $pass Then
        msgbox(0, "Test", "Correct");add a function here
    Else 
        Exit
    EndIf
EndIf
if @error = 1 Then
    Exit
EndIf

just put in the word "password" into the input box.

Edited by Rental
Link to comment
Share on other sites

Hi,

I made this '_StringEncrypt()' example for you.

Hope it helps ^^,

#include <String.au3>
#include <EditConstants.au3>
Global $Level = 2 ;1 - 10
Global $Pass = "autoit" ;Can be anything. For more information read '_StringEncrypt()' in the Helpfile.

_Check()
_Password()
_Main()

Func _Check()
    If FileExists(@ScriptDir & "\Saved Password.ini") And IniRead(@ScriptDir & "\Saved Password.ini", "Password", "Pass", "Not Found") <> "Not Found" Then
        $GetPassword = InputBox("* Password *", "Please enter the password", "", "*", 200, 130)
        $Read_Pass = IniRead(@ScriptDir & "\Saved Password.ini", "Password", "Pass", "Not Found")
        If _StringEncrypt(0, $Read_Pass, $Pass, $Level) == $GetPassword Then
            MsgBox(64, "* Succes *", "Password Correct.")
            _Main()
        Else
            MsgBox(16, "* ERROR *", "Wrong Password!")
            Exit
        EndIf
    EndIf
EndFunc

Func _Password()
    $GUI = GUICreate("* Set Password*", 170, 65, -1, -1)
    $Label = GUICtrlCreateLabel("Password:", 10, 10)
    $Input = GUICtrlCreateInput("", 65, 7, 100, "", $ES_PASSWORD)
    $Button = GUICtrlCreateButton("Set Password!", 10, 35, 150)
    
    GUISetState()
    While 1
        $nMsg = GUIGetMsg()
        Select
        Case $nMsg = -3
            Exit
        Case $nMsg = $Button
            $ReadPassword = GUICtrlRead($Input)
            $Encrypt = _StringEncrypt(1, $ReadPassword, $Pass, $Level)
            IniWrite(@ScriptDir & "\Saved Password.ini", "Password", "Pass", $Encrypt)
            MsgBox(64, "* Succes *", "Password Succesfully Set!")
            Exit
        EndSelect
    WEnd
EndFunc

Func _Main()
    $GUI = GUICreate("* Succes *", 170, 45, -1, -1)
    $Label = GUICtrlCreateLabel("Hi, and Welcome!" & @CRLF & "You entered the right password!", 10, 10)
    
    GUISetState()
    While 1
        $nMsg = GUIGetMsg()
        Select
        Case $nMsg = -3
            Exit
        EndSelect
    WEnd
EndFunc

AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

why the hell not its general knowledge, autoit comes with a decompiler when you have installed it that you can run and enter the autoit exe that you want to decompile and then the place you want the au3 file to be saved, although the creator of the script can compile the exe with options so that you are unable to get the source code without a password to decompile the exe.

either way, if you want to see the source just ask the user.

Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right.

Link to comment
Share on other sites

No the compiler is just for older AutoIt Exes. The new compiler as no Decompiler anymore.

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

No the compiler is just for older AutoIt Exes. The new compiler as no Decompiler anymore.

( just hacked ones no one should use )

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

I've written a totally secure Login UDF here: Login UDF

If you actually need to store passwords I've also written a password manager.

Encrypts passwords/data.

Auto-Login feature for websites.

Hotkeys.

Uses the entered password in encryption. So if it is 'decompiled', the hacker still doesn't have what he needs to get into your data.

Ect ect...

It's in my sig.

Feel completely free to take and use ANY of the code in either two of the scripts. :mellow:

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...