Question: In this question, you will be writing a simple virus. A virus is a program that can attach itself to other programs, so that when

In this question, you will be writing a simple virus. A virus is a program that can attach itself to
other programs, so that when the other program is run, the virus is also run.
Your simple virus will be a Python script that attaches itself to (other)source-code Python scripts
(.py files) in the same folder. Typically, this is done by searching for other .py files on the same
folder, opening each such file, and attaching the virus code to the script (if it does not already
contain the virus code). As a note, practical viruses often attach to machine-code programs, and
many attach to different macro/script files (e.g. MS Office files).
Note: your virus should not re-attach itself to a program which already contains the virus!
This question has three parts. During the first two parts well learn how to implement an aspect
of our virus functionality. Then, in part 3, well be ready to construct the entire virus codebase.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!