[已解决]AU3做病毒免疫和全盘禁区指定进程讨论
用批处理很好做!做一个配置文件!注册表限制位置
HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun\
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File ExecutionOptions\
直接用for命令可全部导入注册表
AU3中看了下帮助文件
IniRead ( "文件名", "字段名", "关键字", "默认值" )从某标准配置文件(*.ini)中读取某个数值.
IniReadSection ( "文件名", "字段名" )从某标准配置文件(*.ini)中读取某个节中的所有关键字或值.
IniReadSection ( "文件名", "字段名" )从某标准配置文件(*.ini)中读取某个节中的所有关键字或值.
IniReadSectionNames ( "文件名" )从某标准配置文件(*.ini)中读取所有字段的信息.
试了下,只能一个改配置文件导入,使用数组的方法,照例子未成功
有用AU3做过此程序的请指点下,用那个函数具体些!
[ 本帖最后由 jycel 于 2009-3-22 00:40 编辑 ] 自己顶!
试了下这样可行,现要去做下假病毒!
$file = FileOpen("NoRun.ini", 0)
; Check if file opened for reading OK
If $file = -1 Then
MsgBox(0, "错误", "未找到配置文件.")
Exit
EndIf
; Read in lines of text until the EOF is reached
While 1
$line = FileReadLine($file)
If @error = -1 Then ExitLoop
RegWrite("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\"&$line,"Debugger","REG_SZ","全盘禁止运行"&$line)
RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun", $line, "REG_SZ", $line)
Wend
FileClose($file)
[ 本帖最后由 jycel 于 2009-3-21 17:17 编辑 ] 注册表免疫倒成功了!对于磁盘分区免疫,现在是要么能在每个分区能建,但不能读取配置文件,另就是直接在配置文件中给明地址!谁帮我综合下!试了N久都没对!
每个分区手动输的~~晕!
#NoTrayIcon
#include <Process.au3>
Local $w = ["a:", "b:", "c:", "d:", "e:", "f:", "g:", "h:", "i:", "j:", "k:", "l:", "m:", "n:", "o:", "p:", "q:", "r:", "s:", "t:", "u:", "v:", "w:", "x:", "y:", "z:"]
For $eleFile In $w
DirCreate($eleFile & "\jycel2.bat")
FileSetAttrib($eleFile & "\jycel2.bat", "+RHS")
_RunDOS("echo Y|cacls " & $eleFile & "\jycel2.bat" & " /P Everyone:n")
Next
MsgBox(16,"提示","分区免疫成功",5)
这个是在配置文件中直接给地址:缺点无法判断有多少分区,而且配置文件太多了!
#NoTrayIcon
#include <Process.au3>
$exe = @ScriptDir & "\norun.ini"
$file = FileOpen($exe, 0)
If $file = -1 Then
MsgBox(0, "错误", "无法打开文本,请检查相关设置!")
Exit
EndIf
While 1
$line = FileReadLine($file)
If @error = -1 Then ExitLoop
If $line <> "" Then
DirCreate("" & $line & "")
FileSetAttrib("" & $line & "", '+R+H+S+A')
_RunDOS("echo Y|cacls " & $line & " /P Everyone:n")
EndIf
WEnd
[ 本帖最后由 jycel 于 2009-3-21 21:25 编辑 ] 没人指点吗?试了这么久,真搞笑,:face (13): 二个循环把配置中的文件,前二个给生存到C后二个D就这样一个盘生成二个不一样的 搞到现在终于做成了,在此得多谢群里的“九月赝飞”帮忙
代码如下:
#NoTrayIcon
#include <Process.au3>
$exe = @ScriptDir & "\norun.ini"
$file = FileOpen($exe, 0)
If $file = -1 Then
MsgBox(0, "错误", "无法打开文本,请检查相关设置!")
Exit
EndIf
While 1
$line = FileReadLine($file)
If @error = -1 Then ExitLoop
If $line <> "" Then
dowhat($line)
EndIf
WEnd
func dowhat($line)
$var = DriveGetDrive( "FIXED" )
If NOT @error Then
;MsgBox(4096,"", "Found " & $var & " drives")
For $i = 1 to $var
DirCreate($var[$i]&'\'& $line)
FileSetAttrib($var[$i]&'\'& $line, '+R+H+S+A')
_RunDOS("echo Y|cacls " &$var[$i]&'\'& $line & " /P Everyone:n")
Next
EndIf
EndFunc 顶了啊,这个挺不错 呵呵..從上往下看,邊看邊笑...
DriveGetDrive :face (8): 當初我也找得很辛苦 强人啊楼主,恭喜成功了。
页:
[1]