elva

程序的自删除代码

#include "windows.h" 

int main(int argc, char *argv[]) 

  char   buf[MAX_PATH]; 
  HMODULE module; 
   
  module = GetModuleHandle(0); 
  GetModuleFileName(module, buf, MAX_PATH); 
  CloseHandle((HANDLE)4); 
   
  __asm  
  { 
    lea   eax, buf 
    push   0 
    push   0 
    push   eax 
    push   ExitProcess 
    push   module 
    push   DeleteFile 
    push   UnmapViewOfFile 
    ret 
  } 
   
  return 0; 
}  

posted on 2007-04-25 21:58 叶子 阅读(351) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理