Save an XP install when the CD key has been lost

Scenario

The lady who bought the computer decided to clean it up a bit by removing all the stickers -- well guess what? There goes the CD key sticker too. I have actually experienced this scenary twice in real life!!! Interesting that in both cases it was a woman who wanted her computer to look pretty, and didn't realize she was violating her license with Microsoft. Sorry Microsoft, but I have to side with the poor folks who do this. They aren't lawyers and they don't know about software piracy, and they don't understand all the measures taken to prevent it.

To make matters worse, now (months or years after the stickers were removed) a repair-install of Windows XP was started for some unknown reason by some unqualified jackass who didn't even check to see if there was a CD key handy. Now it is impossible to boot Windows even in safe mode, and there is no CD key to complete the install. You can't run a simple CD key viewer because you do not have the luxury of Windows.

  1. Boot from a Knoppix CD.

  2. From terminal, mount the C:\ drive. Usually this simply involves the following:

    Now type "df" to see where it was mounted. Usually this is under /mnt/hda1 or something like that.

  3. cd /mnt/hda1/windows/system32/config
    od -An -t x4 software.sav | less

  4. Try to find the raw product key.

    Search for the following string, "506c6174" (which is actually part of "DigitalProductId" in little endian byte order ("Plat" ... do you see it? 0x74=='t', 0x61=='a', 0x6c=='l', and 0x50=='P'). You will find several of these. The one we want looks similar to the following:

    The green section is the word "DigitalProductId" in little endian byte order. Note the 00000000 exactly 52 bytes after the green section. Right after that is the raw product key which we need. If the 00000000 is not exactly 52 bytes after the green section (it won't be green in your octal dump), then you found the wrong one. Search again. Note, if it does look like a key, get it, but also search for all others and get them too. I actually found and decoded my Office CD key in the process. That is not the key I was looking for, but I saved time by decoding all the ones I found.

    Keep in mind this is little endian byte order. In little endian byte order, abcdefgh becomes ghefcdab. Knowing that, 1031cb70 is actually 70cb3110. Move from left to right as you look at each 4 byte chunk. Taking apart each chunk requires going from right to left separating the bytes. Continue this way chopping off 2 characters at a time. Each 2 characters makes one byte. Then, the raw product key for this system is the red portion, and taken apart correctly is:

  5. On a different computer, download a program called KeyViewer.exe from www.alphacomps.com. Go to the "Raw Key" section and it can convert the raw key to the CD key.

    If you don't have another computer handy to run KeyViewer on, then how are you reading this web page?!?


Note: the raw key above is not a real key. It has been modified to protect my computer :-)

Note 2: If the computer refuses to boot and continue the Windows XP install due to a corrupt or missing C:\Windows\System32\Config\System file, boot to "repair" mode from the Windows XP CDROM, then rename the existing system file to system- then copy system.sav to system as follows:

Now upon restart do not attempt to boot from CDROM then re-insert it when Windows asks you to.

Note 3: If windows is still messed up, use google. I don't have your answer.

Ken takes no responsibility for damages you do to your computer as a result of following the instructions in this article. If you need this document, you are in dire straights anyways so don't com crying to me.

There is probably some utility or Linux CD that will automatically do all this for you. I haven't found it, but it seems like it should be done.