When the program is executed, some of these viruses infect other programs. A computer, when booted, looks in these areas for executable code on how to start running. A boot sector virus overwrites that original startup code with its own code. From then on, whenever you boot the computer from the infected hard disk or the infected floppy, the virus is free to go about its business. Complicating matters further, some viruses are capable of infecting files as well as boot sectors.
Polymorphic viruses use encryption or other methods to change how they look.
This strategy of changing their appearance helps to defeat antivirus scanning software. Stealth viruses attempt to hide any modifications they have made from antivirus scanning software. For example, stealth viruses sometimes substitute unaltered files and directory table entries for the virus-altered ones, in an attempt to fool antivirus scanning software. Fast infector viruses are capable of infecting any file which is opened, rather than only executed files. Slow infectors only modify files as the files are being created or altered for legitimate reasons, a practice which fools some antivirus software.