Compression virus
A compression virus is an example of a benevolent computer virus, invented by Fred Cohen.[1] It searches for an uninfected executable file, compresses the file and prepends itself to it.[src] The virus can be described in pseudo code program compression-virus:= {01234567; subroutine infect-executable:= {loop:file = get-random-executable-file; if first-line-of-file = 01234567 then goto loop; compress file; prepend compression-virus to file; } main-program:= {if ask-permission then infect-executable; uncompress the-rest-of-this-file into tmpfile; run tmpfile;} } The 01234567 is the virus signature, and is used to make sure (if first-line-of-file = 01234567) the file is not already infected.[src] The virus then asks for permission (ask-permission) to infect a random executable (get-random-executable-file).[src] If the permission is granted, it compresses the executable (infect-executable), prepends itself to it (prepend), uncompresses the current executable file (uncompress the-rest-of-this-file) into a temporary file (tmpfile) and runs it (run tmpfile).[src] 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.[3] The reason for excluding small programs is that their infected versions will be bigger than their originals.[src]
A compression virus is an example of a benevolent computer virus, invented by Fred Cohen.[1] It searches for an uninfected executable file, compresses the file and prepends itself to it.[src] The virus can be described in pseudo code program compression-virus:= {01234567; subroutine infect-executable:= {loop:file = get-random-executable-file; if first-line-of-file = 01234567 then goto loop; compress file; prepend compression-virus to file; } main-program:= {if ask-permission then infect-executable; uncompress the-rest-of-this-file into tmpfile; run tmpfile;} } The 01234567 is the virus signature, and is used to make sure (if first-line-of-file = 01234567) the file is not already infected.[src] The virus then asks for permission (ask-permission) to infect a random executable (get-random-executable-file).[src] If the permission is granted, it compresses the executable (infect-executable), prepends itself to it (prepend), uncompresses the current executable file (uncompress the-rest-of-this-file) into a temporary file (tmpfile) and runs it (run tmpfile).[src] 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.[3] The reason for excluding small programs is that their infected versions will be bigger than their originals.[src]
14 sentences · 14 cited inline · 3 references stored
References
- Fred Cohen & Associates · retrieved 2026-11-18 · rev 1135258308
Cite this reference
MLA "Fred Cohen & Associates." 2026-11-18. http://all.net/books/virus/index.html. Accessed 27 November 2026.
Chicago "Fred Cohen & Associates." 2026-11-18. http://all.net/books/virus/index.html.
APA encyclopegia.org. (2026). Fred Cohen & Associates. Retrieved November 27, 2026, from http://all.net/books/virus/index.html
- Mark A. Ludwig 1995, Giant Black Book of Computer Viruses p.10 Wikipedia revision 1135258308, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1135258308
Cite this reference
MLA "Mark A. Ludwig 1995, Giant Black Book of Computer Viruses p.10 Wikipedia revision 1135258308, retrieved 2026-11-19." Mark A. 2026-11-18. https://en.wikipedia.org/w/index.php?oldid=1135258308. Accessed 27 November 2026.
Chicago "Mark A. Ludwig 1995, Giant Black Book of Computer Viruses p.10 Wikipedia revision 1135258308, retrieved 2026-11-19." Mark A. 2026-11-18. https://en.wikipedia.org/w/index.php?oldid=1135258308.
APA Mark A. (2026). Mark A. Ludwig 1995, Giant Black Book of Computer Viruses p.10 Wikipedia revision 1135258308, retrieved 2026-11-19. Retrieved November 27, 2026, from https://en.wikipedia.org/w/index.php?oldid=1135258308
- McAfee article on Cruncher.2092, read Characteristics · retrieved 2009-07-28 · rev 1135258308
Cite this reference
MLA "McAfee article on Cruncher.2092, read Characteristics." "McAfee article on Cruncher. 2009-07-28. https://web.archive.org/web/20100823073607/http://vil.nai.com/vil/content/v_318.htm. Accessed 27 November 2026.
Chicago "McAfee article on Cruncher.2092, read Characteristics." "McAfee article on Cruncher. 2009-07-28. https://web.archive.org/web/20100823073607/http://vil.nai.com/vil/content/v_318.htm.
APA "McAfee article on Cruncher. (2009). McAfee article on Cruncher.2092, read Characteristics. Retrieved November 27, 2026, from https://web.archive.org/web/20100823073607/http://vil.nai.com/vil/content/v_318.htm
Cite this article
MLA
"Compression virus." encyclopegia.org, 2023, https://encyclopegia.org/wiki/compression-virus. Accessed 27 November 2026.
Chicago
"Compression virus." encyclopegia.org. Accessed November 27, 2026. https://encyclopegia.org/wiki/compression-virus.
APA
encyclopegia.org. (2023). Compression virus. Retrieved November 27, 2026, from https://encyclopegia.org/wiki/compression-virus
Accessed November 27, 2026 · CC BY-SA 4.0 · citation page · JSON