Jump to content

Lock (password protect) programs


Recommended Posts

Hi there

Before I start coding the whole thing myself, I just wanted to find out if anyone has done something similar to this:

Take any Windows program an put a Password protection wrapper around it with AutoIt. The AutiIt script would be generic, and read the program info from a (possibly disguised) INI file. The actual target program executable could be renamed and possibly encrypted/disabled in some way. When someone tries to run the program, the AutoIt would be run instead, and prompt for a password. If the password is correct, the script renames/enables the program and runs it, waiting in the background. When the program ends, the script would re-apply the password protection.

I know that I could do something similar with a self-extracting zip file, but doing it with AutoIt would make it more flexible...

Edited by Exjoburger
Link to comment
Share on other sites

Hi there

Before I start coding the whole thing myself, I just wanted to find out if anyone has done something similar to this:

Take any Windows program an put a Password protection wrapper around it with AutoIt. The AutiIt script would be generic, and read the program info from a (possibly disguised) INI file. The actual target program executable could be renamed and possibly encrypted/disabled in some way. When someone tries to run the program, the AutoIt would be run instead, and prompt for a password. If the password is correct, the script renames/enables the program and runs it, waiting in the background. When the program ends, the script would re-apply the password protection.

I know that I could do something similar with a self-extracting zip file, but doing it with AutoIt would make it more flexible...

<{POST_SNAPBACK}>

the easiest way to do this i think would be to make use of FileInstall(). use it to include the executable into your compiled script. you can have your script ask for a password, and then upon success run the included executable, and on fail, delete the removed executable. you will probably want to make sure to disable the tray icon etc to avoid user intervention. also you may want to employ other encryption/decryption in you checks to avoid real time debugging, or atleast make it harder. FileInstall() is well documented in the help file, and there are numerous posts on the other areas i've mentioned on the forums.
Link to comment
Share on other sites

Hi there

Before I start coding the whole thing myself, I just wanted to find out if anyone has done something similar to this:

there is a lot of shareware/freeware available for that purpose.

google: windows exe password protection

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

there is a lot of shareware/freeware available for that purpose.

google: windows exe password protection

Cheers

Kurt

<{POST_SNAPBACK}>

that doesn't sound like you /dev... Autoit can do the trick 8)

@Exjoburger

here's a program I wrote for my Toy BOX

and here's the code

#include "GUIConstants.au3"

Dim $QT_web = "www.XPCleanMenu.HostRocket.com", $NoKey = ""

$Key = "test"

;install pics
    $Toy_Logo = @TempDir & "\Toy2-logo.jpg"
    FileInstall("C:\XPClean-web\Settings\XPClean-pics\Toy-box2-jpg.jpg", $Toy_Logo)
    $Logo_icon = @TempDir & "\XPClean-Icon.ico"
    FileInstall("C:\XPClean-web\Settings\XPClean-pics\XPClean-Main-Pic-Icon.ico", $Logo_icon)
    $Sound_clk = @TempDir & "\Sound_clk.wav"
    FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\Clickerx.wav", $Sound_clk)
    $Sound_grp = @TempDir & "\Sound_grp.wav"
    FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\Group_open.wav", $Sound_grp)
    $Sound_bar = @TempDir & "\Sound_bar.wav"
    FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\xpinfbar.wav", $Sound_bar)
    $Sound_lnk = @TempDir & "\Sound_lnk.wav"
    FileInstall("C:\XPClean-web\Settings\XPClean-pics\Sounds\Notify.wav", $Sound_lnk)

; install program
    $Program_1 = @TempDir & "\Program.exe"
    FileInstall( @ProgramFilesDir & "\QTasc\XPClean\XPClean-Menu.exe", $Program_1)

;Set GUI
    $Toy_win = GuiCreate(" QTasc - Toy BOX", 329,145)
    GUISetIcon($Logo_icon)
;GUISetBkColor(0x0066FF);0x0066FF); 0x00ff00)
    $Icon_1 = GUICtrlCreatePic($Toy_Logo, 245, 2, 75, 140)
    GUICtrlSetCursor(-1, 0)
    GUICtrlSetTip(-1, "Click here - to Donate Now!!")
    
;Create 2 buttons
    $button_1 = GUICtrlCreateButton("A&ccept", 30, 110, 80, 25)
    GUICtrlSetState(-1,$GUI_DEFBUTTON)
    $button_2 = GUICtrlCreateButton("C&ancel", 130, 110, 80, 25)

;create labels
    $label_1 = GUICtrlCreateLabel( "Please enter your Validation Key", 18, 20, 250, 20)
    GUICtrlSetFont(-1, 9, 650)
    $label_2 = GUICtrlCreateLabel( "(The number given on your $1,000.00 Donation)", 15, 40, 250, 20)
    GUICtrlSetState(-1,$GUI_DISABLE)
;create text input
    $text = GUICtrlCreateInput("Welcome to the Toy BOX,  by QTasc", 20, 70, 200, 20)
    GUICtrlSetState(-1,$GUI_FOCUS)
;Show the GUI
    GuiSetState (@SW_SHOW)
    SoundPlay ($Sound_lnk,1)

;sets tray icon
    opt("TrayMenuMode", 1)  ; Default tray menu items (Script Paused/Exit) will not be shown.
    opt("TrayOnEventMode", 1)
;TraySetClick (16); right click
    
    $donate_tray = TrayCreateItem ("Make a Donation Now!!")
    TrayItemSetOnEvent (-1, "Set_Donate")
    TrayCreateItem ("")
    $upgrade_tray = TrayCreateItem ("Check New Releases")
    TrayItemSetOnEvent (-1, "Set_Update")
    TrayCreateItem ("")
    $about_tray = TrayCreateItem ("About QTasc")
    TrayItemSetOnEvent (-1, "Set_QT")
    TrayCreateItem ("")
    $exit_tray = TrayCreateItem ("Exit  QTasc - Toy BOX")
    TrayItemSetOnEvent (-1, "Set_Exit")
    
    TraySetState ()


While 1 
    $msg = GuiGetMsg()
    Select
        case $msg = $Icon_1
            Call("Set_Donate")
        case $msg = $button_2 Or $msg = $GUI_EVENT_CLOSE
            Call("Set_Exit")
        case $msg = $button_1
            SoundPlay ($Sound_clk,1)
            $msg1 = GuictrlRead($text)
            If $msg1 = $Key Then
                Msgbox(64, "Validation Key", "Thank you!.. for your Donation!   " & @CRLF & @CRLF & "The  Toy BOX  will now close   ", 7)
                Run($Program_1)
                Call("Set_Exit")
            Else
                Msgbox(64, "Validation Key", "The Validation key was not correct!   ", 7)
                $NoKey = $NoKey + 1
                If $NoKey >= 3 Then
                    Call("Set_Donate")
                    $NoKey = ""
                EndIf
            EndIf
    EndSelect
WEnd

Exit

; ------------------------------------ Functions ----------------------------------------------

Func Set_Update()
    SoundPlay ($Sound_clk,1)
    Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe " & $QT_web)
    WinWaitActive("")
EndFunc

Func Set_QT()
    SoundPlay ($Sound_grp,1)
    $iMsgBoxAnswer = MsgBox(32, "Toy BOX ,  by   QTasc", "WHO IS,  QT APPRAISAL SERVICE CO ?" & @CRLF & "" & @CRLF & "We are a Real Estate Appraisal Company based in Riverside, California. " & @CRLF & "" & @CRLF & "Thank you." & @CRLF & "" & @CRLF & "", 60)
    Select
        Case $iMsgBoxAnswer = -1;Timeout
        EndSelect
    SoundPlay ($Sound_grp,1)
EndFunc 

Func Set_Exit()
    SoundPlay ($Sound_lnk,1)
    Exit
EndFunc  

Func Set_Donate()
    SoundPlay ($Sound_grp,1)
    $PID = Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe https://www.paypal.com/xclick/business=xpcleanmenu@aol.com&no_shipping=1&item_name=XPClean-Menu+Donation")
    WinWaitActive("")
EndFunc

Just change it a little for your use

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

that doesn't sound like you /dev... Autoit can do the trick 8)

well, sometimes I'm bored to reinvent the wheel ;)

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

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