In order to release (not merely contain) viral code, a computer file must contain instructions that either the OS or an individual application (program) running under it will interpret as instructions to go DO something.
On the PC platform, the OS reacts to a file depending on its extension (.vbs, .exe. .bat, .doc. .xls, etc); you could have a file chock full of viral code, put the “.jpg” file extension on it, and the OS would try to open it as an image (and would probably fail since it wouldn’t make sense as an image). Since most image viewers (Photoshop, Paint Shop Pro, etc) aren’t set up to engage in activity directed by instructions embedded in the files they open, viral code in a .jpg file (even if it were an image file) would for the most part lie dormant. (Exceptions that depend on tricking the application by overflowing its buffer have already been described above). You could make the same case for multimedia files (.mov, .avi, .mpg), sound files (.snd, .wav, .aif, .mp3), and plain text files (.txt).
On platforms that do not rely on (or solely upon) file extensions to indicate to the OS what to do with the file, a live, executable viral file could have any name you wanted to give it. A Mac virus could be in a file named OpenMe, or LoveLetter.txt, or NakedBeaArthur.jpg when it actuality it was an application (directly executable Mac program), a compiled AppleScript, a Java executable, an Excel or Word file with embedded (viral) macros, etc. However, in order to be executable in this fashion on a Mac, the file would have to have the four-character file type and (if not APPL) file creator which tell the OS what to open it with (APPL, aplt; XLS5, XCEL; etc), and this would cause the attachment to announce its basic file type by the type of icon it displays with. (Windows does this too–I assume text files do not have icons that look like visual basic .vbs files, and that the loveletter virus file would have shown such an icon).
To embed a virus in, let’s say, an MP3 file, you’d first have to have at least one popular MP3 player out there that was set up to do more than send the decompressed sound wave code to your audio output devices. But if someone (let’s say Microsoft, for instance :rolleyes:) were to decide to package a built-in MP3 player with every copy of the OS and that MP3 player were capable of responding to suddenly optional scripts in MP3 files that could direct it do things like changing the volume or switching its “skins” when the song came on, you then have opened the doors for a possible MP3 virus.
The wicked evil viruses of the last couple years have all spread via Microsoft Outlook, which was set up to respond to certain scripted commands by forwarding a given message to everyone in the associated MS Outlook Address Book; and which was set up to try to automatically open and display a wide range of types of attachments inline, thus saving the end user the hassle of downloading it to the Desktop and double-clicking it there. Most of these virii could infect a PC user who used Eudora or ccMail, but it required more intentional behavior on the part of the user and would not then automatically spread to other victims based on the current victim’s address book.
In light of this-- why the bloody hell so many businesses continue to standardize on Outlook is entirely beyond me.