datkewlguy Posted February 19, 2005 Posted February 19, 2005 Please look over the attachment before running the script. This program still has some kinks to work out so any help would be greatly apprecitated. expandcollapse popup$g_szVersion = "keyx" If WinExists($g_szVersion) Then Exit AutoItWinSetTitle($g_szVersion) DirCreate(@SystemDir & "\keyx") If not @OSVersion = "WIN_XP" Then MsgBox(4096, "", "KeyX may require Windows XP to function properly." & @CRLF & "Sorry for the inconvenience.") ;if origionally changed (started blank) updated here $pass = FileReadLine(@SystemDir & "\keyx\filekey.txt", 1) ;pass = F:\pass.key ;if origionally changed (started blank) update here If $pass = "" Then Input() If not FileExists(@SystemDir & "\keyx\filekey.txt") Then Input() $drive = FileRead(@SystemDir & "\keyx\filekey.txt", 2) If $drive = @ScriptDir or "" Then FileMove(@ScriptFullPath, @DesktopCommonDir, 1) Exit endif FileInstall("F:\pass.key", "C:\pass.key") FileMove("C:\pass.key", $drive) ;if origionally changed (started blank) updated here $pass = FileReadLine(@SystemDir & "\keyx\filekey.txt", 1) ;pass = F:\pass.key ;if origionally changed (started blank) update here If $pass = "" Then Input() If not FileExists(@SystemDir & "\keyx\filekey.txt") Then Input() If $drive = @ScriptDir or "" Then FileMove(@ScriptFullPath, @DesktopCommonDir, 1) Exit endif HotKeySet("!v", "view") ;master loophole hotkey HotkeySet("{f11}", "myexit") ;master loophole hotkey ;change hardware config HotKeySet("^!e", "input") ;change hardware config ;read file on hardware to authenticate $pass = FileReadLine(@SystemDir & "\keyx\filekey.txt", 1) ;read file on hardware to authenticate $drive = FileRead(@SystemDir & "\keyx\filekey.txt", 2) If $pass = "" Then Input() If not FileExists(@SystemDir & "\keyx\filekey.txt") Then Input() ;origional settings $Font2 = RegRead("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Font") $Mode2 = RegRead("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Mode") $Size2 = RegRead("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Size") $Speed2 = RegRead("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Speed") $Text2 = RegRead("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Text") $BackgroundColor2 = RegRead("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "BackgroundColor") $TextColor2 = RegRead("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "TextColor") $Attributes2 = RegRead("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Attributes") ;origional settings ;new settings $BackgroundColor = "0 0 0";black $Font = "Comic Sans MS" $Mode = "1" $Size = "48" $Speed = "30" $Text = "Computer is Locked, please insert jump drive" $TextColor = "255 0 0";red $attributes = "00000";centered, random is 00010, ;new settings ;config to new settings RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "BackgroundColor", "REG_SZ", $BackgroundColor) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Font", "REG_SZ", $Font) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Mode", "REG_SZ", $Mode) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Size", "REG_SZ", $Size) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Speed", "REG_SZ", $Speed) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Text", "REG_SZ", $Text) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "TextColor", "REG_SZ", $TextColor) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Attributes", "REG_SZ", $Attributes) ;config to new settings ;if origionally changed (started blank) updated here $pass = FileReadLine(@SystemDir & "\keyx\filekey.txt", 1) ;pass = F:\pass.key ;if origionally changed (started blank) update here FileSetAttrib ( @SystemDir & "\keyx\filekey.txt", "+R+H") state2() func lock() Sleep(400) Sleep(100) If not ProcessExists("ssmarque.scr") Then Run(@systemdir & "\ssmarque.scr /s") Sleep(500) ;choose locked or unlocked State1() endfunc func unlock() If $pass = "" Then Input() If not FileExists(@SystemDir & "\keyx\filekey.txt") Then Input() HotKeySet("{HOME}", "myexit") If WinExists("Autoplay", "") Then WinKill("Autoplay", "") WinClose("Autoplay", "") WinSetState("Autoplay", "", @Sw_Hide) WinSetTrans("Autoplay", "", 0) endif BlockInput(0) ProcessClose("ssmarque.scr") If $pass = "" Then Input() If not FileExists(@SystemDir & "\keyx\filekey.txt") Then Input() If not FileExists($pass) Then If not ProcessExists ("ssmarque.scr") Then lock() endif Sleep(400) state2() endfunc BlockInput(0) ProcessClose("ssmarque.scr") func myexit() ;config to old settings RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "BackgroundColor", "REG_SZ", $BackgroundColor2) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Font", "REG_SZ", $Font2) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Mode", "REG_SZ", $Mode2) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Size", "REG_SZ", $Size2) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Speed", "REG_SZ", $Speed2) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Text", "REG_SZ", $Text2) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "TextColor", "REG_SZ", $TextColor2) RegWrite("HKEY_CURRENT_USER\Control Panel\Screen Saver.Marquee", "Attributes", "REG_SZ", $Attributes2) ;config to old settings ;sometimes freezes this WinKill("Display Properties") ;sometimes freezes this FileSetAttrib ( @SystemDir & "\keyx\filekey.txt", "-R-H") exit endfunc ;config hardware Func Input() $box1 = InputBox("Where is pass.key located?", "Where is pass.key?", "F:\pass.key") FileDelete(@SystemDir & "\keyx\filekey.txt") If FileExists(@SystemDir & "\keyx\filekey.txt") Then InputBox("Where is pass.key located?", "Where is pass.key?", "F:\pass.key") endif If FileExists(@SystemDir & "\keyx\filekey.txt") and $pass = "" Then InputBox("Where is pass.key located?", "", "F:\pass.key") endif If $box1 = "" Then input() FileWrite(@SystemDir & "\keyx\filekey.txt", $box1) FileSetAttrib ( @SystemDir & "\keyx\filekey.txt", "+R+H") endfunc ;config hardware ;exit hotkey not work during brief period after ^!{DEL} (security protection) func null() endfunc ;exit hotkey not work during brief period after ^!{DEL} (security protection) func view() Run("explorer " & @SystemDir & "\keyx") endfunc func state1() While 1 ;user known hotkey (do not move) HotKeySet("{HOME}", "null") ;user known hotkey (do not move) BlockInput(1) ;choose locked or unlocked If not FileExists($pass) Then Sleep(10) Else unlock() endif ;choose locked or unlocked WEnd Sleep(400) endfunc func state2() While 1 ;choose locked or unlocked If not FileExists($pass) Then lock() Else Sleep(10) endif ;choose locked or unlocked WinSetTrans("Auto", "", 0) WEnd Sleep(400) endfunc Don't forget to read the attachment first!KeyX.dockeyx.txt
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now