What do I and Dustin over at Virtual Roadside have in common? Let’s see, we’re geeky, we follow xkcd, and we luuuv messing around with boot sectors!
He made a nice snippet of ASM that resides in your MBR, which prints a little message of your choice. It’s inspired by this XKCD strip:
This takes me right back to when I was twelve or so and got Form.B from a floppy. I actually noticed it myself, and I checked it out with a program that could read flopppy disks on a low level. I don’t remember why I had such a program lying around, but I think it had something to do with my interest in DMF formatting, which allowed you to store 1.72 MB of data on a 1.44 MB floppy by (mis)using otherwise unused space. Anyway, the Form.B virus had a nice little message in it, greeting whoever managed to read it. I never felt that close to hardware until I started programming the Gameboy.
Where was I… Oh yeah, the MBR love letter. I tried it, and also filmed it and put on youtube, which you can watch below. I have the FreeBSD boot loader installed, which booted just fine. Maybe a computer with the MBR love letter is actually supposed to just boot afterwards, when using Windows’ boot loader, just that Dustin don’t want to say that out loud, so that less people will try it on their on computers? (No I haven’t checked the source code myself. It’s 6 AM and I’ve been up all night. Hopefully I’ll go to bed when I’ve finish this post.)
Now that the demo scene is producing size demos (Everything from 32 bytes up to 512 bytes) you could probably fit one of these into the boot sector to make this hack even nicer.
If you can’t read that blurry poem, it says:
Love me, love me not My 'puter is all I got With this malicious vector Can I really restore my boot sector?
On a related note, recently the computer virus had its 25th anniversary. I’ve meant to say something about this, but I never got about doing it.
Edit:As Dustin points out the FBSD boot loader is only one boot sector big, which would be the reason why it works. Not only that, just by pressing any of the F keys associated with a partition, the boot loader automatically rewrites itself into the MBR. (The reason for this is to save the selection as the new default to the next next boot.)