有个Online Course的网上测评只能用LockDown Browser这个浏览器,灰常牛逼,禁用了所有的快捷键,禁用了任务管理器,禁用了alt-tab,禁止在虚拟机里(包括VM Ware,Virtual PC……)运行,反正我能想到的办法都被它禁掉了╮(╯▽╰)╭
由于Ohio State University使用了这个网上测评的系统,有OSU的学生就在吐槽说这浏览器特么的不就是个病毒么。
看到帖子说可以用Notepad打开LockDown.exe,我一想我电脑里不是有更强大的UltraEdit嘛,就打开来看了一下。
让我感到疑惑的是,网上所有的帖子都说这个软件的机制是禁用了它的blacklist上所有的程序,但根据我观察到的情况,我倒觉得它用的是whitelist,即只允许出现在它列表中的那些进程 (系统进程等),否则一律要求用户kill。可能那些帖子太老了吧,最近这个浏览器update过了。
最奇怪的是,在该可执行文件中,出现了AutoHotKey字符串,就说明程序的作者意识到了AHK的存在,但缘于何种原因他没有要求用户禁止AutoHotKey.exe,就不得而知了。因为为了破除该软件的限制,我们用到的工具正是AutoHotKey。
运行程序的命令需要用到AHK自带的Window Spy小工具,因为需要用这个工具查看需要运行的程序的名字(在AHK里的名字)。
主要参考了这个脚本,在它的基础上做了不少修改。
另外,截屏这个功能参考了这个帖子(我直接copy & paste了CaptureScreen这个函数)。
原来国外竟有这么多人在研究AHK,我觉得还蛮惊讶的;也很好奇为何这个简单轻便的小工具有这么大的魅力,能吸引到这么多人在论坛上讨论。
Talk is cheap. Show me the code.
下面是我的脚本:
Run, C:\Program Files (x86)\Respondus LockDown Browser\LockDown.exe
WinWait, Respondus LockDown Browser
WinSet, AlwaysOnTop, Off, Respondus LockDown Browser
WinSet, Enable, , Respondus LockDown Browser
Gui -MinimizeBox
Gui, Add, Button, default, &Run Chrome
Gui, Add, Button, default, &Show Chrome
Gui, Add, Button, default, &Run Explorer
Gui, Add, Button, default, &Show Foxit Reader
Gui, Add, Button, default, &Screen Shot
Gui, Show,, Subversion Menu
WinSet, AlwaysOnTop, On, Subversion Menu
return
ButtonRunIE:
Run, IEXPLORE.EXE
return
ButtonRunChrome:
Run, chrome.EXE
return
ButtonShowChrome:
WinActivate, ahk_class Chrome_WidgetWin_1
return
ButtonVisitAllWindows:
WinGet, id, list,,, Program Manager
Loop, %id%
{
this_id := id%A_Index%
WinActivate, ahk_id %this_id%
WinGetClass, this_class, ahk_id %this_id%
WinGetTitle, this_title, ahk_id %this_id%
MsgBox, 4, , Visiting All Windows`n%a_index% of %id%`nahk_id %this_id%`nahk_class %this_class%`n%this_title%`n`nContinue?
IfMsgBox, NO, break
}
return