I made this code for myself, it's not that advanced but works very well for me. I use it at home as i have classified information on my computer. This program does very well at defending it when I'm out for a coffee break.
So, here's how it works:
When you hit F8, your screen is filled with a black screen which says 'Locked'. All inputs will be blocked, and because alt+ctrl+del still works, i looped a taskkill for that. Every 200 milliseconds, the script checks if there's an 'I' drive. This is (at my computer) the USB drive when plugged it. If it finds the drive, it will check a file called 'key.txt' and compare it to the same file but then located in /WINDOWS/. If both file's content are identical to each other, it will unlock again.
So, in short: Your USB drive is the key to unlock your computer. You only have to type your password twice. Once in the windows dir, and once in the root of your USB drive.
Pretty neat idea eh? :3
Code:
#NoTrayIcon
SysGet, VirtualScreenWidth, 78
SysGet, VirtualScreenHeight, 79
F8::
Lock:
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000000
Gui, Font, CFF0000
Gui, Font,, Arial
Gui, Font, s128
Gui, Font, x0 y0
Gui, Add, Text, Locked, Locked
Gui, Show, x0 y0 h%VirtualScreenHeight% w%VirtualScreenWidth% , lock
SetTimer, checkkey, 200
return
checkkey:
driveget, drives, list, removable ;list of removable drives
FileRead, localkey, C:\WINDOWS\key.txt
passkey= ;filereadline will not overwrite passkey if there is an error
keyaccepted:=false
loop, parse,drives
{
FileRead, passkey, %a_loopfield%:\key.txt
if (passkey=localkey)
{
Gui Destroy
BlockInput off
SetTimer, checkkey, off
keyaccepted:=true
break
}
}
if not keyaccepted
{
BlockInput on
WinKill, Windows Task Manager
Gui, Show, x0 y0 h%VirtualScreenHeight% w%VirtualScreenWidth% , lock ;paints over any crack attempt
}
return
I hope someone's helped with this, or that you found the idea interesting. Please make a small notice about me whenever you will release this to the public.