老早以前就知道了有一个windows未公开函数可以针对单独文件关闭WFP,然后想干啥干啥。网上有关的描述为
如果在VB里用,声明的时候我不知道这个序号为5怎么处理,然后还想用GetProcAddress获取地址但是不知道为什么一直出错,我那个郁闷。后来闲着逛VBGOOD发现了一个代码眼睛一亮,
Private Declare Function SfcFileException Lib "sfc_os.dll" Alias "#5" (ByVal dwUnknown0 As Long, ByVal pwszFile As Long, ByVal dwUnknown1 As Long) As Long
突然就明白了,只导出出序号声明里就写序号就可以了么···我贴出来全部代码:
Option Explicit
Private Declare Function SfcFileException Lib "sfc_os.dll" Alias "#5" (ByVal dwUnknown0 As Long, ByVal pwszFile As Long, ByVal dwUnknown1 As Long) As Long
Private Sub Command1_Click()
On Error Resume Next
Dim s As String
Err.Clear
s = "c:\windows\system32\winmine.exe" + vbNullChar 'windows的扫雷程序
If SfcFileException(0, StrPtr(s), -1) = 0 Then 'ok!
DoEvents
Kill s
If Err.Number <> 0 Then MsgBox Err.Description
FileCopy "c:\windows\system32\notepad.exe", s 成功的话就用记事本程序替换了扫雷程序
If Err.Number <> 0 Then MsgBox Err.Description
Else
MsgBox "failed!"
End If
End Sub
有了这个东西,杀人行凶就更方便了~!
2008/10/5 | Tags:VB,编程 | VB编程 | 查看评论(0)