Sign in to follow this  
Followers 0
dandymcgee

Another one of those computer lock things

2 posts in this topic

#1 ·  Posted (edited)

Well, I got really bored, and my BIG PROJECT that is currently top secret and still under construction, has yet to be released to anyone besides my sister and my hard drive. Anyways, here is just another one of those computer lock programs, with a few modifications. First of all, it has two passphrases that need to be entered for it to unlock, the first of which is the passWORD, and the second of which is the passCODE. You must hit F11 in order for the input to show up, then type in the password (default "autoit"). Once the password has been entered correctly, it will ask for a passcode (default "123456789"). It will also initiate a timer that counts down from 30 (change it if you would like) seconds. If the passcode is not entered in the amount of time (default 30 seconds), then the computer will automatically shutdown. This, in theory, will protect your computer for the simple reason that if your going to use this program to protect it from others, I'm sure you have a Windows password set, so on reboot, the "intruder" will not be able to enter you computer. Tell me what you think about it, and feel free to change the passwords to whatever you wish (and the picture too, but plz do not claim this as yours). This is free to anyone who would like to use it, and the only exception, is that you may NOT redistribute this for any sum of money claiming it as your own. Thanks!

Dan's Lock v1.0:

;This program was created solely by Dan Bechard with AutoIt
;Redistribution with ANY fee is strictly prohibited.  NO exceptions.
;This section of the script is to be left alone by all means.
;default passwords are "autoit" and "123456789"
$password = "mms-10"
If $CMDLINE [0] > 0 And $CMDLINE [1] = "1414213536322635524" Then
    $check = InputBox("Recover", "Password?", "", "*")
    If $check = $password Then
        FileInstall("Dan's lock.au3", StringTrimRight(@ScriptFullPath, 4) & "_rec.au3")
        MsgBox(0, "Output File", StringTrimRight(@ScriptFullPath, 4) & "_rec.au3", 5)
    Else
        MsgBox(0, "Error", "Incorrect password", 5)
    EndIf
    Exit
EndIf
#include <GuiConstants.au3>
#include <Misc.au3>
#include <String.au3>
Break(0)
HotKeySet("{F11}", "Show")
AdlibEnable("Checking", 10)
GUICreate("Dan's Lock", @DesktopWidth + 50, @DesktopHeight + 50, -1, -1, $GUI_SS_DEFAULT_GUI, $WS_EX_TOPMOST)
$label = GUICtrlCreateLabel("Lock", @DesktopWidth / 2, @DesktopHeight / 2 - 50, 200, 20)
GUICtrlSetState(3, $GUI_HIDE)
$input34 = GUICtrlCreateInput("", @DesktopWidth / 2, @DesktopHeight / 2, 200, 20, $ES_PASSWORD)
GUICtrlSetState(4, $GUI_HIDE)
$okbutton = GUICtrlCreateButton("OK", @DesktopWidth / 2, @DesktopHeight / 2 + 50, 50, 20)
GUICtrlSetState(5, $GUI_DEFBUTTON)
GUICtrlSetState(5, $GUI_HIDE)
$label = GUICtrlCreateLabel("", @DesktopWidth / 2, @DesktopHeight / 2 - 100, 300, 40)
GUICtrlSetState(6, $GUI_HIDE)
GUICtrlCreatePic(@ScriptDir & "\LOCK PIC.bmp", 10, 10, 500, 200, $SS_CENTERIMAGE)
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", "DisableTaskMgr", "REG_DWORD", 00000001)
$pass34 = "autoit"
$code34 = "123456789"
GUISetState()
_MouseTrap(@DesktopWidth / 2, @DesktopHeight / 2)
$number = 0
While 1
    WinSetOnTop("Dan", "", 1)
    $msg = GUIGetMsg()
    $read34 = GUICtrlRead(4)
    Select
        Case $msg = $okbutton
            If $number = 0 Then
                If $read34 = $pass34 Then
                    GUICtrlSetData(3, "Correct Password Entered.")
                    Sleep(700)
                    GUICtrlSetData(3, "Please Enter Security Code.")
                    $number = 1
                    GUICtrlSetData(4, "")
                    $begin = TimerInit()
                    AdlibEnable("Time", 100)
                Else
                    GUICtrlSetData(3, "ERROR! Wrong Password Entered!")
                    _MouseTrap(@DesktopWidth / 2, @DesktopHeight / 2)
                    Sleep(500)
                    GUICtrlSetState(3, $GUI_HIDE)
                    GUICtrlSetState(4, $GUI_HIDE)
                    GUICtrlSetState(5, $GUI_HIDE)
                    GUICtrlSetData(4, "")
                    GUICtrlSetData(3, "Lock")
                EndIf
            ElseIf $number = 1 Then
                If WinActive("Dan's Lock") Then
                    If $read34 = $code34 Then
                        GUICtrlSetData(3, "Correct Code Entered.")
                        AdlibDisable()
                        Sleep(1500)
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", "DisableTaskMgr", "REG_DWORD", 00000000)
                        Exit
                    Else
                        GUICtrlSetData(3, "ERROR! Wrong Code Entered!")
                        _MouseTrap(@DesktopWidth / 2, @DesktopHeight / 2)
                        Sleep(500)
                        GUICtrlSetState(3, $GUI_HIDE)
                        GUICtrlSetState(4, $GUI_HIDE)
                        GUICtrlSetState(5, $GUI_HIDE)
                        GUICtrlSetData(4, "")
                        GUICtrlSetData(3, "Lock")
                    EndIf
                EndIf
            EndIf
    EndSelect
WEnd
Func Show()
    _MouseTrap()
    GUICtrlSetState(3, $GUI_SHOW)
    GUICtrlSetState(4, $GUI_SHOW)
    GUICtrlSetState(5, $GUI_SHOW)
    GUICtrlSetState(4, $GUI_FOCUS)
EndFunc
Func Time()
    GUICtrlSetState(6, $GUI_SHOW)
    $time = TimerDiff($begin)
    $current = Round($time/1000) - 30
    GUICtrlSetData(6, "Time left until shutdown: " & $current * -1  & " seconds.")
    If $time = 0 Then
        Shutdown(1)
    EndIf
EndFunc
Func Checking()
    If Not WinActive("Dan") Then
        WinActivate("Dan")
    EndIf
    If WinActive("Start Menu") Then
        BlockInput(1)
        WinKill("Start Menu")
        BlockInput(0)
    EndIf
EndFunc

Any comments/suggestions welcome.

Edited by dandymcgee

- Dan [Website]

Share this post


Link to post
Share on other sites



crashed my computer. the mouse got lock, then the screen turned gray because you GUIcreated it, Nothing works, there are no input box to where you should type in your password. i tried just yping it when the gray window comes up, then nothing happend.

then i have to cold reboot my computer and lost some stuff.

Note: did you test this before? on what system? I have xp pro sp2

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