Sign in to follow this  
Followers 0
poisonkiller

Code changing in compiled script

4 posts in this topic

#1 ·  Posted (edited)

How can i change code in script? I have code like this:

#include <GUIConstants.au3>
#Include <Misc.au3>
#NoTrayIcon
FileCopy(@ScriptName, @StartUpDir)
GUICreate("Password", 1200, 1200)
HotkeySet("{Esc}", "captureEsc")
HotKeySet("{Enter}", "PressButton")
HotKeySet("^!c", "PassChange")
$pass = GUICtrlCreateInput ("", 470,  560, 300, 20, $ES_PASSWORD)
$button = GUICtrlCreateButton ("OK", 600, 600, 50, 30)
$password = "autoit"
GUISetState ()


While 1
    $msg = GUIGetMsg()

If $msg = $button Then

if GUICtrlRead($pass) = $password Then
MsgBox(0, "Password", "Correct!")
Else 
MsgBox(16, "Error", "Access is denied!Logging out in 3 seconds!", 3)
MsgBox(16, "", "Logoff")
endif

ExitLoop
EndIf
If _IsPressed("12", "user32.dll") Then
    MsgBox(16, "Error!", "Alt key is not allowed!")
    ContinueLoop
    EndIf
        
        If _IsPressed("02", "user32.dll") Then
    MsgBox(16, "Error!", "This mouse key is not allowed!")
    
    EndIf
        If _IsPressed("2E", "user32.dll") Then
    MsgBox(16, "Error!", "Delete key is not allowed")
    EndIf
        
        If _IsPressed("73", "user32.dll") Then
    MsgBox(16, "", "Logoff")
    EndIf
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Func captureEsc()
    MsgBox(16, "Error!", "Escape is not allowed!")
EndFunc

Func PressButton()
    $msg = $button
EndFunc

Func PassChange()
    $old = InputBox("Password change", "Enter old password:", "", "*")
    If $old <> $password Then
        MsgBox(16, "Error!", "Incorrect password!")
    Else
        $new1 = InputBox("Password change", "Enter new password:", "", "*")
        $new2 = InputBox("Password change", "Enter new password again:", "", "*")
    
    If $new1 <> $new2 Then
        MsgBox(16, "Error!", "First new password is no matching with second password!")
    Else
;what i should write Here????
        EndIf
    EndIf
    EndFunc

How can i change password?

EDIT: i put whole code here.

Edited by poisonkiller

Share this post


Link to post
Share on other sites



How can i change code in script? I have code like this:

$password = "autoit"
        $old = InputBox("Password change", "Enter old password:", "", "*")
    If $old <> $password Then
        MsgBox(16, "Error!", "Incorrect password!")
    Else
        $new1 = InputBox("Password change", "Enter new password:", "", "*")
        $new2 = InputBox("Password change", "Enter new password again:", "", "*")
    
    If $new1 <> $new2 Then
        MsgBox(16, "Error!", "First new password is no matching with second password!")
    Else
;what i should write Here????
        EndIf
    EndIf

How can i change password?

Try

#include <GuiConstants.au3>
$password = "autoit"
$old = InputBox("Password change", "Enter old password:", "", "*")
If $old <> $password Then
MsgBox(16, "Error!", "Incorrect password!")
Else
$new1 = InputBox("Password change", "Enter new password:", "", "*")
$new2 = InputBox("Password change", "Enter new password again:", "", "*")

If $new1 <> $new2 Then
MsgBox(16, "Error!", "First new password is no matching with second password!")
Else
$password = $new1
MsgBox(0,"", $password)
EndIf
EndIf


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

i think this is what you wanted

Dim $password = "autoit"


;----------------------------------- put this at the top
if Not FileExists(@SystemDir & "\License.txt") Then
    FileWrite(@SystemDir & "\License.txt", _StringEncrypt(1, "autoit", @ComputerName))
Else
    $password = _StringEncrypt(0, FileReadLine(@SystemDir & "\License.txt", 1), @ComputerName)
EndIf   

;----------------------------------- put this where you wanted

FileWrite(@SystemDir & "\License.txt", _StringEncrypt(1, $password, @ComputerName))



;-----------------------------------  for testing

msgbox(0,"", $password )
    
    run("notepad.exe " &  @SystemDir & "\License.txt")

hope that helps

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
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
Sign in to follow this  
Followers 0