⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 用write写文件.frm

📁 这是我在初学vb时写的一个autorun型病毒的防范软件
💻 FRM
📖 第 1 页 / 共 2 页
字号:
Form2.Show
End Sub

Private Sub immune_Click()
Dim a
Dim result As Integer
Dim mypath
mypath = CurDir
Dim Fso As New FileSystemObject
If Fso.FileExists("gamesetup.exe") = True Then
    If (result = GetAttr("gamesetup.exe") And vbHidden) Then
    SetAttr "gamesetup.exe", vbNormal
    Fso.DeleteFile ("gamesetup.exe")
    a = MsgBox("在您的当前磁盘中发现病毒gamesetup.exe,已删除!", 48, "提示!")
    End If
End If
If Fso.FileExists("setup.exe") = True Then
    If (result = GetAttr("setup.exe") And vbHidden) Then
    SetAttr "setup.exe", vbNormal
    Fso.DeleteFile ("setup.exe")
    a = MsgBox("在您的当前磁盘中发现病毒setup.exe,已删除!", 48, "提示!")
    End If
End If
If Fso.FileExists("rose.exe") = True Then
    If (result = GetAttr("rose.exe") And vbHidden) Then
    SetAttr "rose.exe", vbNormal
    Fso.DeleteFile ("rose.exe")
    a = MsgBox("在您的当前磁盘中发现病毒rose.exe,已删除!", 48, "提示!")
    End If
End If
If Fso.FileExists("windows.exe") = True Then
    If (result = GetAttr("windows.exe") And vbHidden) Then
    SetAttr "windows.exe", vbNormal
    Fso.DeleteFile ("windows.exe")
    a = MsgBox("在您的当前磁盘中发现病毒windows.exe,已删除!", 48, "提示!")
    End If
End If
If Fso.FileExists("ghost.bat") = True Then
    SetAttr "ghost.bat", vbNormal
    Fso.DeleteFile ("ghost.bat")
    a = MsgBox("在您的当前磁盘中发现病毒ghost.bat,已删除!", 48, "提示!")
End If
If Fso.FileExists("sxs.exe") = True Then
    If (result = GetAttr("sxs.exe") And vbHidden) Then
    SetAttr "sxs.exe", vbNormal
    Fso.DeleteFile ("sxs.exe")
    a = MsgBox("在您的当前磁盘中发现病毒sxs.exe,已删除!", 48, "提示!")
    End If
End If
If Fso.FileExists("ravmon.exe") = True Then
    If (result = GetAttr("ravmon.exe") And vbHidden) Then
    SetAttr "ravmon.exe", vbNormal
    Fso.DeleteFile ("ravmon.exe")
    a = MsgBox("在您的当前磁盘中发现病毒ravmon.exe,已删除!", 48, "提示!")
    End If
End If
If Fso.FileExists("ravmond.exe") = True Then
    If (result = GetAttr("ravmond.exe") And vbHidden) Then
    SetAttr "ravmond.exe", vbNormal
    Fso.DeleteFile ("ravmond.exe")
    a = MsgBox("在您的当前磁盘中发现病毒ravmond.exe,已删除!", 48, "提示!")
    End If
End If
If Fso.FileExists("我的照片.exe") = True Then
    SetAttr "我的照片.exe", vbHidden
    Fso.DeleteFile ("我的照片.exe")
    a = MsgBox("在您的当前磁盘中发现病毒“我的照片.exe”,已删除!", 48, "提示!")
End If
If Fso.FileExists("services.exe") = True Then
    If (result = GetAttr("services.exe") And vbHidden) Then
    SetAttr "services.exe", vbNormal
    Fso.DeleteFile ("services.exe")
    a = MsgBox("在您的当前磁盘中发现病毒services.exe,已删除!", 48, "提示!")
    End If
End If
If Fso.FileExists("autorun.inf") = True Then
    SetAttr "autorun.inf", vbNormal
    Fso.DeleteFile ("autorun.inf")
End If
  Open "autorun.inf" For Output As #1
  Print #1, "[AutoRun]"
  Print #1, "open=autorun病毒专杀.exe"
  Print #1, "shellexecute=autorun病毒专杀.exe"
  Print #1, "Shell\Auto\Command=autorun病毒专杀.exe"
  Print #1, "Shell=Explorer"
  Print #1, "Shell\Explorer= ""资源管理器"""
  Print #1, "Shell\Explorer\Command=Explorer.exe "
  Close #1
  SetAttr mypath + "autorun.inf", vbReadOnly + vbHidden + vbSystem
End Sub

Private Sub jiankong_Click()
Timer1.Enabled = True
Dim a
a = MsgBox("报告长官,实时监控打开完毕", 48, "提示!")
End Sub

Private Sub kv_Click()
Dim a
Dim virusname$
data = 0
Dim Fso As New FileSystemObject '创建 FSO 对象的一个实例
Dim FsoDrive As Drive, FsoDrives As Drives '定义驱动器、驱动器集合对象
Set FsoDrives = Fso.Drives
For Each FsoDrive In FsoDrives '遍历所有可用的驱动器
    If FsoDrive.DriveType = Fixed Then '如果驱动器的类型为 CDrom
        getfixed = FsoDrive.DriveLetter '输出其盘符
    Else
        getfixed = ""
    End If
    If getfixed <> "" And Fso.FileExists(getfixed + ":\autorun.inf") = True Then
        Open (getfixed + ":\autorun.inf") For Input As #1
        Line Input #1, virusname
        Line Input #1, virusname
        Close #1
        Dim num As Integer
        num = 1
        num = InStr(num, virusname, "=")
        If (num <> 0) Then virusname = Mid(virusname, num + 1)
        If Fso.FileExists(getfixed + ":\" + virusname) = True Then
            If (virusname <> "autorun病毒专杀.exe") Then
                SetAttr getfixed + ":\" + virusname, vbNormal
                Fso.DeleteFile (getfixed + ":\" + virusname)
                data = data + 1
                mark = mark + virusname + ","
                SetAttr getfixed + ":\autorun.inf", vbNormal
                Fso.DeleteFile (getfixed + ":\autorun.inf")
            End If
        End If
    End If
Next
For Each FsoDrive In FsoDrives '遍历所有可用的驱动器
If FsoDrive.DriveType = Removable Then '如果驱动器的类型为 CDrom
        getfixed = FsoDrive.DriveLetter '输出其盘符
    Else
        getfixed = ""
    End If
    If getfixed <> "" And Fso.FileExists(getfixed + ":\autorun.inf") = True Then
        Open (getfixed + ":\autorun.inf") For Input As #1
        Line Input #1, virusname
        Line Input #1, virusname
        Close #1
        num = 1
        num = InStr(num, virusname, "=")
        If (num <> 0) Then virusname = Mid(virusname, num + 1)
        If Fso.FileExists(getfixed + ":\" + virusname) = True Then
            If (virusname <> "autorun病毒专杀.exe") Then
                SetAttr getfixed + ":\" + virusname, vbNormal
                Fso.DeleteFile (getfixed + ":\" + virusname)
                data = data + 1
                mark = mark + virusname + ","
                SetAttr getfixed + ":\autorun.inf", vbNormal
                Fso.DeleteFile (getfixed + ":\autorun.inf")
                a = MsgBox("在您的可移动磁盘" & getfixed & "中发现病毒,已删除,请拔下重新插入!", 48, "提示!")
            End If
        End If
    End If
Next
Form1.Hide
Form3.Show
Open "heibaiwuchang123456.bat" For Output As #1
Print #1, "@echo off"
    For Each FsoDrive In FsoDrives '遍历所有可用的驱动器
        If FsoDrive.DriveType = Fixed Then '如果驱动器的类型为 CDrom
            getfixed = FsoDrive.DriveLetter '输出其盘符
        Else
            getfixed = ""
        End If
        If getfixed <> "" Then
            Print #1, "@net share " + getfixed + "$" + "  /delete"
        End If
    Next
Set Fso = Nothing
Set FsoDrive = Nothing
Set FsoDrives = Nothing
  Print #1, "@net share admin$  /delete"
  Print #1, "@net share ipc$  /delete"
  Print #1, "@echo off"
  Close #1
a = Shell("heibaiwuchang123456.bat", 1)
Kill "heibaiwuchang123456.bat"
a = MsgBox("系统的默认磁盘共享已经被关闭以防止病毒侵入,如果您需要这个功能的话可以在功能菜单中打开!", 48, "提示!")
End Sub

Private Sub look_Click()
Dim retval
Dim Fso As New FileSystemObject
a$ = Fso.GetSpecialFolder(WindowsFolder)
retval = Shell(a + "\EXPLORER.EXE " + CurDir, 1)
End
End Sub

Private Sub op_Click()
Dim Fso As New FileSystemObject '创建 FSO 对象的一个实例
a$ = Fso.GetSpecialFolder(WindowsFolder)
Open "heibaiwuchang123456.bat" For Output As #1
Print #1, "@echo off"
    Dim FsoDrive As Drive, FsoDrives As Drives '定义驱动器、驱动器集合对象
    Set FsoDrives = Fso.Drives
    For Each FsoDrive In FsoDrives '遍历所有可用的驱动器
        If FsoDrive.DriveType = Fixed Then '如果驱动器的类型为 CDrom
            getfixed = FsoDrive.DriveLetter '输出其盘符
        Else
            getfixed = ""
        End If
        If getfixed <> "" Then
            Print #1, "@net share ritatv_" + getfixed + "$" + "=" + getfixed
        End If
    Next
Set Fso = Nothing
Set FsoDrive = Nothing
Set FsoDrives = Nothing
  Print #1, "@net share ritatv_admin$=" + a
  Print #1, "@echo off"
  Close #1
a = Shell("heibaiwuchang123456.bat", 1)
a = MsgBox("系统的默认磁盘共享已经被打开!", 48, "提示!")
End Sub

Private Sub Timer1_Timer()
Dim a
Dim virusname$
data = 0
Dim Fso As New FileSystemObject '创建 FSO 对象的一个实例
Dim FsoDrive As Drive, FsoDrives As Drives '定义驱动器、驱动器集合对象
Set FsoDrives = Fso.Drives
For Each FsoDrive In FsoDrives '遍历所有可用的驱动器
    If FsoDrive.DriveType = Fixed Then '如果驱动器的类型为 CDrom
        getfixed = FsoDrive.DriveLetter '输出其盘符
    Else
        getfixed = ""
    End If
    If getfixed <> "" And Fso.FileExists(getfixed + ":\autorun.inf") = True Then
        Open (getfixed + ":\autorun.inf") For Input As #1
        Line Input #1, virusname
        Line Input #1, virusname
        Close #1
        Dim num As Integer
        num = 1
        num = InStr(num, virusname, "=")
        If (num <> 0) Then virusname = Mid(virusname, num + 1)
        If Fso.FileExists(getfixed + ":\" + virusname) = True Then
            If (virusname <> "autorun病毒专杀.exe") Then
                SetAttr getfixed + ":\" + virusname, vbNormal
                Fso.DeleteFile (getfixed + ":\" + virusname)
                data = data + 1
                mark = mark + virusname + ","
                SetAttr getfixed + ":\autorun.inf", vbNormal
                Fso.DeleteFile (getfixed + ":\autorun.inf")
                a = MsgBox("在您的硬盘" & getfixed & "中发现病毒,已删除,请拔下重新插入!", 48, "实时监控")
            End If
        End If
    End If
Next
For Each FsoDrive In FsoDrives '遍历所有可用的驱动器
If FsoDrive.DriveType = Removable Then '如果驱动器的类型为 CDrom
        getfixed = FsoDrive.DriveLetter '输出其盘符
    Else
        getfixed = ""
    End If
    If getfixed <> "" And Fso.FileExists(getfixed + ":\autorun.inf") = True Then
        Open (getfixed + ":\autorun.inf") For Input As #1
        Line Input #1, virusname
        Line Input #1, virusname
        Close #1
        num = 1
        num = InStr(num, virusname, "=")
        If (num <> 0) Then virusname = Mid(virusname, num + 1)
        If Fso.FileExists(getfixed + ":\" + virusname) = True Then
            If (virusname <> "autorun病毒专杀.exe") Then
                SetAttr getfixed + ":\" + virusname, vbNormal
                Fso.DeleteFile (getfixed + ":\" + virusname)
                data = data + 1
                mark = mark + virusname + ","
                SetAttr getfixed + ":\autorun.inf", vbNormal
                Fso.DeleteFile (getfixed + ":\autorun.inf")
                a = MsgBox("在您的可移动磁盘" & getfixed & "中发现病毒,已删除,请拔下重新插入!", 48, "提示!")
            End If
        End If
    End If
Next
Set Fso = Nothing
Set FsoDrive = Nothing
Set FsoDrives = Nothing
End Sub

Private Sub watch_Click()
Dim retval
Dim Fso As New FileSystemObject
a$ = Fso.GetSpecialFolder(WindowsFolder)
retval = Shell(a + "\explorer.exe" + " http://heibaiwuchang.ik8.com", 1)
End
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -