V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
jsjcjsjc
V2EX  ›  问与答

有大佬可以搞定这个 autoit 小脚本吗?

  •  
  •   jsjcjsjc · 45 天前 · 462 次点击
    这是一个创建于 45 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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
    
    
    2 条回复    2024-03-14 17:13:36 +08:00
    loveqianool
        1
    loveqianool  
       45 天前 via Android
    安全模式删启动项
    jsjcjsjc
        2
    jsjcjsjc  
    OP
       45 天前
    @loveqianool 这个肯定可以,没有开机密码和 BIOS 密码哈
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3148 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 13:54 · PVG 21:54 · LAX 06:54 · JFK 09:54
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.