Çå³ý1465µÄ³ÌÐò ÌÕ´ÓÌ瘝 1994-06-17 #include ª¤ #include ª¤ #include ª¤ #include ª¤ #include ª¤ #include ª¤ FILE *fpi;ª¤ main(int argc,char *argv[]) {ª¤ char fname[30],test[30];ª¤ int k,n,done,mode,handle;ª¤ unsigned char endbyte[20];ª¤ struct ffblk ffp;ª¤ if (argc!=2) { prinft("\n\n syntax:kill1465 FILENAME"); exit(1); } ª¤done=findfirst(argv[1],&ffp,0);ª¤ strcpy(test,argv[1]);ª¤ if(test[0]=='\\'||test[1]==':') {ª¤ for(k=0;test[k]!=NULL;k++) for(n=0;test[k-n]!='\\'&&test[k-n]!=':';n++) ª¤test[k-n+1]=NULL; } ª¤ else test[0]=NULL;ª¤ while(!done) { strcpy(fname,test);ª¤ strcat(fname,ffp.ff_name);ª¤ printf("\n\tScaning the file %s",fname); mode=ffp.ff_attrib;ª¤ _chmod(fname,FA_RDONLY| FA_HIDDEN); ª¤ fpi=fopen(fname,"rb+"); if(fpi==NULL) printf("\n\t Error to open the file."); else {ª¤ hadnle=fileno(fpi);ª¤ fseek(fpi,-0x11,SEEK_END); ª¤fread(endbyte,17,1,fpi); ª¤if(strstr(enbyte,"L4Q0DGDIIB+GLO")) { ª¤printf("\nFound virus 1465 in %s ,Running...!",fname);ª¤ ffp.ff_fsize-=1465; if(strstr(fname,"COM")) kill_com(ffp.ff_fsize);ª¤ if(strstr(fname,"EXE")) kill_exe(ffp.ff_fsize); chsize(handle,ffp.ff_fsize); ª¤printf("\n\n\t\t Clear !"); ª¤} ª¤}ª¤ fclose(fpi);ª¤ _chmod(fname,1,mode);ª¤ done=findnext(&ffp); ª¤}ª¤ }/*main()*/ª¤ kill_com(long length) {ª¤ unsigned char lbyte[5];ª¤ int i;ª¤ fseek(fpi,(long)(length+5*256+32+4),0);ª¤ fread(lbyte,5,1,fpi);ª¤ for(i=5;i>0;i--) lbyte[5-i]^=i;ª¤ fseek(fpi,0,0); ª¤fwrite(lbyte,5,1,fpi); }ª¤ kill_exe(long length) {ª¤ unsigned char lbytel[30],endbyte[30];ª¤ long int i,k,temp;ª¤ fseek(fpi,-0x95,SEEK_END); ª¤fread(endbyte,0xa,1,fpi); ª¤for(i=0;i<10;i++) endbyte[i]^=(10-i);ª¤ fseek(fpi,0,SEEK_SET);ª¤ fread(lbyte,24,1,fpi);ª¤ temp=(long)(length/512)+1;ª¤ lbyte[5]=temp-lbyte[5]*256; ª¤k=length-(long)(temp-1)*512; ª¤lbyte[3]=k/256;ª¤ lbyte[15]=(endbyte[1]*256+endbyte[0])/256; lbyte[14]=endbyte[1]*256+endbyte[0]-(long)lbyte[15]*256; lbyte[16]=endbyte[2];lbyte[17]=endbyte[3]; lbyte[20]=endbyte[6];lbyte[21]=endbyte[7]; ª¤ lbyte[23]=(endbyte[9]*256+endbyte[8])/256; lbyte[22]=endbyte[9*256+endbyte[8]-lbyte[23]*256; ª¤fseek(fpi,0,0);ª¤ fwrite(lbyte,24,1,fpi);ª¤ }ª¤