autoit 写的小脚本,目的是禁用大部分的按键,输入密码后才可以操作电脑,密码是"123" 右键 screen.au3,使用附件里面的 AutoIt3_x64.exe 打开就可以.
发现小东西似乎还可以哈,有办法绕过密码操作电脑吗? 目前是开机启动,优先级应该是最高的,似乎无解,尝试了 Ctrl+alt+del 也不行
https://cloud.g60.net/d/public/autoit-v3.zip 或者直接使用代码
#NoTrayIcon
; #RequireAdmin
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_icon=C:\Windows\System32\SHELL32.dll|-3
#PRE_UseX64=n
; #PRE_Res_requestedExecutionLevel=requireAdministrator
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <array.au3>
#include <Winapi.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <File.au3>
Opt("MustDeclareVars", 1)
Opt("GUIOnEventMode", 1)
Global $sCmd = "/s", $hParent = 0
If WinExists("ScrnSav:" & @AutoItExe) Then WinKill("ScrnSav:" & @AutoItExe)
AutoItWinSetTitle("ScrnSav:" & @AutoItExe)
If @Compiled Then
If $CmdLine[0] < 1 Then Exit
$sCmd = $CmdLine[1]
If $CmdLine[0] > 1 Then $hParent = HWnd($CmdLine[2])
If StringLeft(StringTrimLeft($sCmd, 1), 1) = "c" Then $sCmd = "/c"
EndIf
Global $Password = '123'
Global $MainForm
Global $Ipt_Password, $iUserDummy
Global $hHook, $hStub_KeyProc, $hmod
Switch $sCmd
Case "/s", "-s" ;FullScreen
_SCR_FullScreen()
Case "/c", "-c" ;Config
_SCR_Config()
Case "/p", "-p", "/l", "-l" ;Preview
_SCR_Preview($hParent)
Case Else
Exit
EndSwitch
Func _SCR_Preview($hParent)
EndFunc ;==>_SCR_Preview
Func _SCR_Config()
EndFunc ;==>_SCR_Config
Func _PassWord()
If GUICtrlRead($Ipt_Password) = $Password Then
;~ Exit
GUISetState(@SW_HIDE, $MainForm)
_WinAPI_UnhookWindowsHookEx($hHook)
;~ DllCallbackFree($hStub_KeyProc)
EndIf
EndFunc ;==>_PassWord
Func _Exit()
Exit
EndFunc ;==>_Exit
Func _SCR_FullScreen()
Local $hDC = _WinAPI_GetDC(0)
Local $DesktopWidth = _WinAPI_GetDeviceCaps($hDC, 118)
Local $DesktopHeight = _WinAPI_GetDeviceCaps($hDC, 117)
$hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam")
$hmod = _WinAPI_GetModuleHandle(0)
$hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hStub_KeyProc), $hmod)
;===============系统壁纸里面挑选背景图========
Local $FileList
Local $DirList = _FileListToArray(@WindowsDir & '\Web\Wallpaper', '*', 2)
For $I = 1 To $DirList[0]
Local $List = _FileListToArray(@WindowsDir & '\Web\Wallpaper' & '\' & $DirList[$I], '*.jpg', 1)
For $j = 1 To $List[0]
$FileList &= @WindowsDir & '\Web\Wallpaper\' & $DirList[$I] & '\' & $List[$j] & '|'
Next
Next
Local $ImgList = StringSplit(StringTrimRight($FileList, 1), '|', 3)
Local $Index = Random(0, UBound($ImgList) - 1, 1)
;============以下是主窗口=============
$MainForm = GUICreate('screenpro', $DesktopWidth, $DesktopHeight, 0, 0, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW,$WS_EX_LAYERED, $WS_EX_TOPMOST))
;~ $Ipt_Password = GUICtrlCreateInput('', ($DesktopWidth - 500) / 2, ($DesktopHeight - 40) / 2, 500, 40, $ES_PASSWORD)
;~ GUICtrlSetFont($Ipt_Password, 25)
;============设置背景图==============
GUICtrlCreatePic($ImgList[$Index], 0, 0, $DesktopWidth, $DesktopHeight)
GUICtrlSetState(-1, $gui_disable)
WinSetTrans($MainForm, '', 1)
;~ $iUserDummy = GUICtrlCreateDummy()
GUISetState()
GUISetOnEvent(-3, '_Exit')
;~ GUICtrlSetOnEvent($iUserDummy, "_PassWord") ;
;~ Local $AccelKeys[1][2] = [["{Enter}", $iUserDummy]]
;~ GUISetAccelerators($AccelKeys) ;回车快捷键
;~
Local $iTicks = 0, $iIdle
Local $Input = 0
While 1
$iIdle = _WinAPI_GetIdleTime()
If $iIdle > 3 * 60 * 1000 And $Input = 0 Then
$Input = 1
GUISetState(@SW_SHOW, $MainForm)
$hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hStub_KeyProc), $hmod)
Else
If _WinAPI_IsWindowVisible($MainForm) And $iIdle < $iTicks Then
Local $text = InputBox('提示', '请输入密码', '', '*', -1, -1, Default, Default, 0, $MainForm)
If $text = $Password Then
GUISetState(@SW_HIDE, $MainForm)
_WinAPI_UnhookWindowsHookEx($hHook)
$Input = 0
EndIf
EndIf
EndIf
$iTicks = $iIdle
Sleep(10)
WEnd
EndFunc ;==>_SCR_FullScreen
Func _KeyProc($nCode, $wParam, $lParam)
Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
Local $wVKey = DllStructGetData($tKEYHOOKS, "vkCode")
Switch $wVKey
Case 0x92, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x2C, 0x21, 0x22, 0x20, 0x09, 0x03, 0x91, 0x5D, 0x70 To 0x87
Return 1
Case 0x10, 0x11, 0X12, 0X1B, 0x2D, 0x2E, 0x5b, 0x5c, 0Xa0 To 0xa5
Return 1
EndSwitch
Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
EndFunc ;==>_KeyProc
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.