Each particular variant of the virus can infect only one or two types of files. Most common virus that infects executables. Some viruses infect and files and boot disk area. A virus infecting your device drivers are extremely rare, usually viruses can infect and executables.
More recently, a proliferation of new types of viruses - viruses that have a file system on the disk. These viruses are usually referred to as DIR. Such viruses hiding her body in a certain part of the disk (usually - in the latest cluster disk) and mark it in the file allocation table (FAT) as the end of the file.
To prevent its detection, some viruses are applied fairly hitrye masking techniques. I tell you about the two of them: "invisible" and samomodifitsiruyuschihsya viruses.
"Invisible" viruses. Many resident viruses (and file, and boot) to prevent their discovery that the intercept of DOS (and thus applications) to the infected file and disk area and deliver them in the original (clean) form. Of course, this effect is observed only on the infected machine - to "clean" computer changes to files and boot disk areas can be easily detected.
SAMOMODIFITSIRUYUSCHIESYA viruses. Another method used by viruses to escape detection - changed its body. Many viruses keep most of its body in coded form to start using disassembler can not understand how they work. Samomodifitsiruyuschiesya viruses use the reception and often change the encoding parameters, but also alter its starting side, which serves to rest the commands raskodirovki virus. Thus, the body of this virus does not have a single permanent byte chain, which could identify the virus. This naturally makes it difficult to find such virus-detection programs.