Analysis of the I-LOVE-YOU virus

By Frans

Below the text of the famous virus, interspersed with my comments. This is mainly to show that the virus does not contain all kinds of dirty tricks that the Anti-virus software people claim it to have. Especially the reproduction mechanism is dead simple. The only noteworthy thing about it, is that it contains a two step quine, because it can generate an HTML file, which can create the original virus text again.

The quality and style of the code differs from part to part, which seems to suggest that it is from the hand of more than one person. It almost looks like this virus was build from fragments of other virii. Some parts, like the procedure html are quite complicated to construct. Other parts contain typical beginners errors. There are fragments of useless code, and some functionality has been implemented more than once. I even found some small bugs. This is not a particularily well designed piece of code. My conclusion is that this virus was never intended to be anything more than a pratical joke. It is also not the most evil virus one can think of. It does some harm, but there are some simple modifications which would make it much more harmful.

I have taken the liberty to indent the code in order to improve readability.

Update November 1, 2012: I have removed the remainder of the file, because all kinds of virus scanners were marking this page as having the virus active, while that is not the case in any way. Of course, some smart person could reconstruct the original source from all the fragments that where contained in this page. At some later point, I might include the contents again in some form that will not trigger virus scanners.

Update February 17, 2014: I made the original page available as PDF file.

My life as a hacker | Software Engineering