怎么实现?

解决方案 »

  1.   

    做一个自毁程序,看了下面的讨论你就知道答案了。http://expert.csdn.net/Expert/topic/1336/1336336.xml?temp=.2723963
      

  2.   

    http://expert.csdn.net/Expert/topic/665/665448.xml?temp=.7085688
    http://www.csdn.net/expert/topic/605/605274.xml?temp=.7463495
      

  3.   

    main()
    {
      printf("这是一个删除自身的程序\n");
      HMODULE hm = GetModuleHandle(0);
      
      char buf[MAX_PATH];
      GetModuleFileName(hm, buf, sizeof(buf));
      CloseHandle((HANDLE)4);
      
      __asm
      {
       lea eax, buf
       push 0
       push 0
       push eax
       push ExitProcess
       push hm
       push DeleteFile
       push UnmapViewOfFile
       ret
      }
      return 0;
    }