Sign in to follow this  
Followers 0
CodyBarrett

SCREEN FREEZE

32 posts in this topic

#1 ·  Posted (edited)

here is a simple desktop locker for Win XP Home... i havent tried on Vista and on Win XP Pro.. you can Lock the workstation EVEN when it is running.. and sometimes on PRO it can be exited withoutght the password (hardcoded for the sake of security)... but im using WIN XP Home right now and it works perfectly :D have fun you guys!!!

here is a mutating-password protected screenlocker

#NoTrayIcon
#include <GUICONSTANTS.AU3>
#include <WINDOWSCONSTANTS.AU3>
#include <STATICCONSTANTS.AU3>
#include <EDITCONSTANTS.AU3>
#include <MISC.AU3>
#Include <WinAPI.au3>
HotKeySet ('{ENTER}','_PSSWRD')
Opt ('GUIoneventmode', 1)
$GUIStyle = $WS_POPUP
$GUIStyleEx = $WS_EX_TOPMOST
$LabelStyle = BitOR ($SS_CENTER, $SS_CENTERIMAGE)
$Parent = WinGetHandle ('Program Manager','')
$GUI = GUICreate ('', @DesktopWidth, @DesktopHeight, -1, -1,$GUIStyle ,$GUIStyleEx, $Parent)
Global $x = 0, $y = 0, $Da = @DesktopWidth / 20, $Dx = $Da - 1, $Db = @DesktopHeight / 20, $Dy = $Db - 1, $Trans = 200,$xy1,$xy2,$xy3,$xy4,$Sleep = 0
Dim $Console[$Da][$Db], $Chr[62]
$i = 0
For $ii = 48 to 57
    $Chr[$i] = Chr ($ii)
    $i+=1
Next
For $ii = 65 To 90
    $Chr[$i] = Chr ($ii)
    $i+=1
Next
For $ii = 97 To 122
    $Chr[$i] = Chr ($ii)
    $i+=1
Next
For $i = 0 To $Dx
    For $ii = 0 To $Dy
        $Console[$i][$ii] = GUICtrlCreateLabel ('',$x, $y, 20, 20, $LabelStyle)
        GUICtrlSetBkColor (-1, 0x0)
        GUICtrlSetColor (-1, 0xFFFFFF)
        If $i < ($Da/2 - 6) Or $i > ($Da/2 + 5) Or $ii < ($Db/2 - 3) Or $ii > ($Db/2 + 2) Then
            GUICtrlSetData (-1,$Chr[Random (0,UBound ($Chr) - 1,1)])
        Else
            GUICtrlSetData (-1,Chr (149))
        EndIf
        $y += 20
    Next
    $y = 0
    $x += 20
Next
_Reset_PWSET ()
GUISetFont (10,-1,-1,'Tahoma',$GUI)
GUISetBkColor (0x00000, $GUI)
WinMove ($GUI, '', 0, 0)
$GUI2 = GUICreate ('', 200,60, -1, -1,$GUIStyle ,$GUIStyleEx, $GUI)
GUISetBkColor (0x00000,$GUI2)
$Input = GUICtrlCreateInput ('',0,0,200,60,BitOR ($ES_PASSWORD,$SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetLimit (-1,4)
GUICtrlSetBkColor (-1,0x00000)
GUICtrlSetFont (-1, 35-1,'','Tahoma')
GUICtrlSetColor (-1, 0xFFFFFF)
WinMove ($GUI2,'',@DesktopWidth / 2 - 100, @DesktopHeight / 2 - 30)
For $i = 255 To $Trans Step -0.5
    WinSetTrans ($GUI,'',$i)
    WinSetTrans ($GUI2,'',$i)
Next
WinSetTrans ($GUI2, '', 255)
GUISetState (@SW_SHOW,$GUI)
GUISetState (@SW_SHOW,$GUI2)
While 1
    If ProcessExists ('taskmgr.exe') Then ProcessClose ('taskmgr.exe')
    If Not WinActive ($GUI2,'') Then WinActivate ($GUI2,'')
    Do
        $x = Random (0, $Dx,1)
        $y = Random (0,$Dy,1)
    Until GUICtrlRead ($Console[$x][$y]) <> Chr (149) 
    GUICtrlSetData ($Console[$x][$y], $Chr[Random (0,UBound ($Chr) - 1,1)])
    $Sleep += 1
    If $Sleep >= 2000 Then _Reset_PWSET ()
    Sleep (10)
WEnd
Func _Reset_PWSET ()
    $Sleep = 0
    GUICtrlSetColor ($xy1, 0xFFFFFF)
    GUICtrlSetColor ($xy2, 0xFFFFFF)
    GUICtrlSetColor ($xy3, 0xFFFFFF)
    GUICtrlSetColor ($xy4, 0xFFFFFF)
            Do
            $x = Random (0, $Dx,1)
            $y = Random (0,$Dy,1)
        Until GUICtrlRead ($Console[$x][$y]) <> Chr (149)
    $xy1 = $Console[$x][$y]
        Do
            $x = Random (0, $Dx,1)
            $y = Random (0,$Dy,1)
        Until GUICtrlRead ($Console[$x][$y]) <> Chr (149) And $Console[$x][$y] <> $xy1
    $xy2 = $Console[$x][$y]
        Do
            $x = Random (0, $Dx,1)
            $y = Random (0,$Dy,1)
        Until GUICtrlRead ($Console[$x][$y]) <> Chr (149) And $Console[$x][$y] <> $xy1 And $Console[$x][$y] <> $xy2 
    $xy3 = $Console[$x][$y]
        Do
            $x = Random (0, $Dx,1)
            $y = Random (0,$Dy,1)
        Until GUICtrlRead ($Console[$x][$y]) <> Chr (149) And $Console[$x][$y] <> $xy1 And $Console[$x][$y] <> $xy2 And $Console[$x][$y] <> $xy3 
    $xy4 = $Console[$x][$y]
    GUICtrlSetColor ($xy1, 0xFF0000)
    GUICtrlSetColor ($xy2, 0xFF8000)
    GUICtrlSetColor ($xy3, 0xFFFF00)
    GUICtrlSetColor ($xy4, 0x00FF00)
EndFunc
Func _PSSWRD ()
    If GUICtrlRead ($Input) = '' Then Return
    $psswrd = GUICtrlRead ($xy1) & GUICtrlRead ($xy2) & GUICtrlRead ($xy3) & GUICtrlRead ($xy4)
    If GUICtrlRead ($Input) == $psswrd Then _Exit ()
    GUICtrlSetData ($Input,'')
    _Reset_PWSET ()
EndFunc
Func _Exit ()
    For $i = $Trans To 0 Step -5
        WinSetTrans ($GUI,'',$i)
        WinSetTrans ($GUI2,'',$i)
    Next
    Exit
EndFunc
Edited by CodyBarrett

Share this post


Link to post
Share on other sites



Very Nice Program, works on Vista 32-bit. Just for the reference of everyone else. To start the Program push Ctrl/Alt/Numpad+ and the default password is 10.1111.10 I wasn't able to get out of the program without logging off and back on. So it works on Vista!


"The true measure of a man is how he treats someone who can do him absolutely no good."

Share this post


Link to post
Share on other sites

im sorry i should have posted that haha thank you :D my bad UHHHH what else.. pass is hardcoded in CURRENTLY "10.1111.10" and yeah... uhh did you loze anything of value? if so i apologize and im still thinking of a better bothey and maybe traymenus.. and an INI taht is encrypted that will change the password... idk yet

Share this post


Link to post
Share on other sites

im sorry i should have posted that haha thank you :D my bad UHHHH what else.. pass is hardcoded in CURRENTLY "10.1111.10" and yeah... uhh did you loze anything of value? if so i apologize and im still thinking of a better bothey and maybe traymenus.. and an INI taht is encrypted that will change the password... idk yet

No, I didn't lose anything, I always make sure I have everything closed before running any scripts just in case. Also it is my own fault for running a script that locks your computer without first looking in the script for the password :o


"The true measure of a man is how he treats someone who can do him absolutely no good."

Share this post


Link to post
Share on other sites

haha im thinking about having a radom picture background that regenerates every 10 seconds... and password changes... but that would need an INI and unless encrpted inis arent very secure....

Share this post


Link to post
Share on other sites

Just a quick update, after a bit of further testing on Vista I did find that using {Windows Key} + D it brings the Taskbar up long enough to easily exit the script. Unfortunately the windows key can't be set to a dummy function.


"The true measure of a man is how he treats someone who can do him absolutely no good."

Share this post


Link to post
Share on other sites

Just a quick update, after a bit of further testing on Vista I did find that using {Windows Key} + D it brings the Taskbar up long enough to easily exit the script. Unfortunately the windows key can't be set to a dummy function.

This trick works on XP, too.

*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

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

damn.. :\ ill work on it..

EDIT

i have not been able to get the windows task manager up long enough to close this... it automatically closes it.. wierd how you guys can replicate this

Edited by CodyBarrett

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I think THIS:

If WinExists ('Windows Task Manager', '') Then WinKill ('Windows Task Manager', '')

Should replace with THIS:

If ProcessExists ("taskmgr.exe") Then ProcessClose ("taskmgr.exe")

It's will be useful for people who use the non-english version of Windows. Like me - I'm Russian :D

Edited by Crystall

Hello World!

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

We do not use the taskmanager, but the trayicon in the taskbar.

You should remove the tray icon, at least in locked mode. Otherwise you can use it to exit your Script after Win-D

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

Share this post


Link to post
Share on other sites

OH NOW i see how you guys exited it.. alright i edited the first post for the additions...

Share this post


Link to post
Share on other sites

Pretty nice..

Except one thing..

IF ppl got something to close annoying processes, you can use those programs.

AND if you're pretty fast, you'll be able to use these programs, just by opening an UPS flash

I'd made one of these programs, with autoit.. (Because someone found it fun to spam #{F1} and made my computer crash my "Help and support" windows -:D-')

Which with 2 click, did exit your screenlocker..

What i'm suggesting is, that you make another program starting when activating the screenlocker, and if it closes in one special way, then it just restarts it. :o

Share this post


Link to post
Share on other sites

\any ideas on how to start doing this? because i cant really go Processclose() because people (like yourself) would just make their own program and exit it....

Share this post


Link to post
Share on other sites

\any ideas on how to start doing this? because i cant really go Processclose() because people (like yourself) would just make their own program and exit it....

You could somehow create a list of processes running when the program starts, and check the current process list against the original, and kill any new ones. That way if any program is started while the computer is locked it will be terminated. Still, if a script is designed with a delay or lock detection you may have a problem. The problem being a vital process could be killed (can't think of an example off the top of my head) but that's what beta testing is for :D. It's a stretch but it might work.

Additionally, did you ever think of a keep alive process, for example design the program to run another instance of itself. The second instance recognizes that the first instance is already running, and goes into keep alive mode. If it detects that the other instance has been terminated, it will go into computer lock mode, and start a new instance of the program, which recognizes that the first instance is already running, and goes into keep alive mode. The process repeats. This would prevent the computer from being unlocked without the help of a script. This would not protect against scripts designed to close both processes faster than the new one can be created, but it's worth a try, and it's more stable than the aforementioned method.

One more thing. You may want to detect and kill "cmd.exe" so someone can't just do the taskkill command.

Combine all of the above methods and it should be pretty secure. You may want to make them optional during setup in case of problems.

Share this post


Link to post
Share on other sites

alright... ill figure it out... i WILL do the cmd close thing... and maybe even the $array of processes to prevent it... but ill add those next version when i add INI and password change and ect..

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Laptops dont all have Numpads :/ I changed it for myself though lol :)

I like it :) Works great to leave your computer running while away (while you dont want anoyone touching it ;)

I was wondering. If a program was ran as an administer (Vista) I don't THINK you can kill process without running cmd.exe as admin also. Which I don't think you have time to do before your program comes back to front ;)

Edited by Tekki

If you intend to use Sarcasm you must this sticker!!![size="1"][sub]pic made by manadar[/sub][/size]

Share this post


Link to post
Share on other sites

What if the program exited explorer.exe on startup, and started it again on exit? That way there would be no way to use any other program to close the locker, as you cannot start a program without explorer.exe.(as far as I know)


0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

Pretty neat. Got my Full-Screen Crash Recovery program to stop it though hehe. (And don't add that to the process watch-list please, otherwise I'll have to add yours to mine) :)

*edit: to be helpful - one possible suggestion: use Yashied's HotKey UDF, and block all keystrokes from being passed on to other apps (and keep them all for yourself). This of course won't stop the Async version of my program :) , but will stop most other things.. I think. (Then again, keyboard hook order might pose a problem..)

Edited by Ascend4nt

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System","DisableTaskMgr","REG_DWORD","00000001")

to disable task manager

HotKeySet("!{F4}","altf4") 
HotKeySet("!{tab}","alttab")
_HotKeyAssign($CK_WIN + $VK_E, 'winkeys')
_HotKeyAssign($CK_WIN + $VK_F, 'winkeys') 
_HotKeyAssign($CK_WIN + $VK_R, 'winkeys') 
_HotKeyAssign($CK_WIN + $VK_L, 'winkeys') 
_HotKeyAssign($CK_WIN + $VK_U, 'winkeys') 
_HotKeyAssign($CK_WIN + $VK_D, 'winkeys')

to disable key shortcuts

Edited by egymma

[center][/center]My Projects:-[list][*]Window Ender[*]Encryptor-Decryptor[/list]

Share this post


Link to post
Share on other sites

oh geez.. i haven't worked on this one since i last posted XD thanks you guys for the comments and suggestions.. when i have more time ill add to it...

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