找回密码
 加入
搜索
查看: 2450|回复: 7

[已解决]AU3做病毒免疫和全盘禁区指定进程讨论

[复制链接]
发表于 2009-3-21 15:57:32 | 显示全部楼层 |阅读模式
用批处理很好做!做一个配置文件!
注册表限制位置
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 编辑 ]
 楼主| 发表于 2009-3-21 17:12:21 | 显示全部楼层
自己顶!
试了下这样可行,现要去做下假病毒!
$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 编辑 ]
 楼主| 发表于 2009-3-21 21:23:21 | 显示全部楼层
注册表免疫倒成功了!对于磁盘分区免疫,现在是要么能在每个分区能建,但不能读取配置文件,另就是直接在配置文件中给明地址!谁帮我综合下!试了N久都没对!
每个分区手动输的~~晕!
#NoTrayIcon
#include <Process.au3>
Local $w[26] = ["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 编辑 ]
 楼主| 发表于 2009-3-21 23:56:35 | 显示全部楼层
没人指点吗?试了这么久,真搞笑, 二个循环把配置中的文件,前二个给生存到C后二个D就这样一个盘生成二个不一样的
 楼主| 发表于 2009-3-22 00:39:35 | 显示全部楼层
搞到现在终于做成了,在此得多谢群里的“九月赝飞”帮忙
代码如下:
#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[0] & " drives")
    For $i = 1 to $var[0]
                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
发表于 2009-8-30 16:19:28 | 显示全部楼层
顶了啊,这个挺不错
发表于 2009-9-16 13:44:21 | 显示全部楼层
呵呵..從上往下看,邊看邊笑...
DriveGetDrive 當初我也找得很辛苦
发表于 2012-8-8 11:38:02 | 显示全部楼层
强人啊楼主,恭喜成功了。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-30 03:33 , Processed in 0.098822 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表