结束瑞星进程(转载)

网络安全 No Comments »
  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之

Thx N.Design Studio for this Theme
Entries RSS Comments RSS Log in