Compression virus


A compression virus is an example of a benevolent computer virus, invented by Fred Cohen. It searches for an uninfected executable file, compresses the file and prepends itself to it. The virus can be described in pseudo code

program compression-virus:=

The 01234567 is the virus signature, and is used to make sure the file is not already infected. The virus then asks for permission to infect a random executable. If the permission is granted, it compresses the executable, prepends itself to it, uncompresses the current executable file into a temporary file and runs it.
Cruncher is an example of a compression virus, a strain of which - Cruncher.2092 is described by McAfee as memory-resident virus that infects all but small com files, making them smaller. The reason for excluding small programs is that their infected versions will be bigger than their originals.