#NoTrayIcon
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=..\..\..\图标\优化图标\winxp\toolbar\Toolbar _ Delete.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseAnsi=y
#AutoIt3Wrapper_Res_Fileversion=1.0.0.2
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#Obfuscator_Parameters=123
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#Region AutoIt3Wrapper 预编译参数(常用参数)
;#AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer% ;自定义资源段
;#AutoIt3Wrapper_Run_Tidy= ;脚本整理
;#AutoIt3Wrapper_Run_Obfuscator= ;代码迷惑
;#AutoIt3Wrapper_Run_AU3Check= ;语法检查
;#AutoIt3Wrapper_Run_Before= ;运行前
;#AutoIt3Wrapper_Run_After= ;运行后
#EndRegion AutoIt3Wrapper 预编译参数(常用参数)
#cs ____________________________________
AutoIt 版本: 3.2.12.0 (第一版)
脚本作者:
Email:
QQ/TM:
脚本版本:
脚本功能:利用密码判定的方式开关U盘,利用更改regedit.exe(注册表管理器)名称的方式禁止手动更改注册表设置
工作原理:
1.程序驱动
2.更改regedit.exe的名称造成用户找不到regedit.exe文件
3.判定密码
4.通过密码来设定不同的注册表和是否还原regedit.exe
计划完善
1.测试可行性
2.win会自行报错
3.360会报危险
#ce _______________脚本开始_________________
Select
Case FileExists(@WindowsDir&"\regedit.exe") = 1
;MsgBox(4096, @WindowsDir&"\regedit.exe 文件", "存在")
FileMove(@WindowsDir&"\regedit.exe", @WindowsDir&"\reg.iog")
DirCreate(@WindowsDir&"\regedit.exe")
;MsgBox(4096, @SystemDir&"\dllcache\regedit.exe", "存在")
FileMove(@SystemDir&"\dllcache\regedit.exe", @SystemDir&"\dllcache\reg.iog")
DirRemove(@WindowsDir&"\regedit.exe", 1)
Case FileExists(@WindowsDir&"\regedit.exe") = 0
;MsgBox(4096, @WindowsDir&"\regedit.exe 文件", "不存在")
Case Else
;MsgBox(4096, @WindowsDir&"\regedit.exe 文件", "错误")
EndSelect
Dim $var,$state,$issue
$var = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start")
Select
Case $var = 3
$state = "保护现在处于关闭状态"
$issue = "打开"
Case $var = 4
$state = "保护现在处于打开状态"
$issue = "关闭"
Case Else
$state = "保护现在处于未知错误状态"
$issue = "关闭"
EndSelect
#Region --- CodeWizard generated code Start ---
;InputBox features: Title=Yes, Prompt=Yes, Default Text=No
If Not IsDeclared("sInputBoxAnswer") Then Local $sInputBoxAnswer
$sInputBoxAnswer = InputBox("移动设备安全开关", $state & ",如果要" & $issue & "请输入安全密码.", "", "*", "-1", "-1", "-1", "-1")
Select
Case @error = 0 ;OK - The string returned is valid
if $sInputBoxAnswer = "1234" Then
FileMove(@SystemDir&"\dllcache\reg.iog", @SystemDir&"\dllcache\regedit.exe")
Sleep(2000)
FileMove(@WindowsDir&"\reg.iog", @WindowsDir&"\regedit.exe")
MsgBox(0,"","注册表加密保护已经卸载")
EndIf
If $sInputBoxAnswer = "123" Then
Select
Case $var = 3
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start", "REG_DWORD", "00000004")
Sleep(200)
$var1 = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start")
If $var1 <> 4 Then
MsgBox(0, "错误", "操作失败")
;### Tidy Error: If/ElseIf statement without a then..
ElseIf $var1 = 4 Then
MsgBox(0, "成功", "保护已打开")
EndIf
Case $var = 4
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start", "REG_DWORD", "00000003")
$var1 = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start")
If $var1 <> 3 Then
MsgBox(0, "错误", "操作失败")
;### Tidy Error: If/ElseIf statement without a then..
ElseIf $var1 = 3 Then
MsgBox(0, "成功", "保护已关闭")
EndIf
Case Else
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start", "REG_DWORD", "00000004")
;### Tidy Error -> "endselect" is closing previous "case"
EndSelect
;### Tidy Error -> "elseif" is closing previous "select"
ElseIf $sInputBoxAnswer <> "ootc" Then
MsgBox(4096, "", "密码错误,操作未被执行")
;### Tidy Error -> "endif" is closing previous "select"
EndIf
Case @error = 1 ;The Cancel button was pushed
Case @error = 3 ;The InputBox failed to open
;### Tidy Error -> "endselect" is closing previous "case"
EndSelect
#EndRegion --- CodeWizard generated code Start ---