Destroy your boot sector!

November 13th, 2007

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:
XKCD strip about a boot sector (MBR) love letter

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.)

5 Responses to “Destroy your boot sector!”

  1. Dustin says:

    Actually, it is supposed to continue booting normally. Its mentioned in the “how it works” section… but you’re right, I’d rather stupid people avoid running it, less complaining emails I get. :)

    Grub doesn’t (normally) work because it uses those extra sectors in that region.. and they get overwritten by my program. I’m not familiar with the BSD sector, and if it only takes up one sector then theres no good reason it wouldn’t work, as you can see. :)

    Nice video.

  2. » MBR Love Note Responses » Random thoughts along the roadside… » Blog Archive says:

    [...] Brandon said “it was a [real, non-script kiddie] hack”.. thanks. Gameboy genius filmed installation and booting of the love note and put it on YouTube… you can see it at his blog. [...]

  3. Snowboards says:

    XKCD is possibly the most awesome web comic I’ve ever seen, the guy is genius. Actually wait, XKCD is the second most awesome. I think the most awesome is Dinosaur Comics over at It truly is good times.

  4. nitro2k01 says:

    Thanks for the tip. Dinosaur comics looks awesome too. (I still think xkcd is better though)

  5. nitro2k01 says:

    Comments closed. No thank you, I don’t want Nike shoes, you Chinese spam bastards.