Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Updated Saturday, June 3rd, 2006 at 1:13pm

Windows XP and Vista Product Key Recovery

There are many programs available for extracting the product key from a Windows XP or Vista installation. The only problem is that they generally require the computer to be functional to run. These programs are useless if the operating system is corrupt and the computer will not boot into Windows. Fortunately, there are other options. This article explains how you can retrieve the product key with just the ntuser.dat file from the machine. You can also download a stand-alone version of my decrypter tool.

Windows Vista Users

I have been informed that this method also works on Windows Vista.

Translations

Background Information

While this may not sound very useful to the average user, if you work with computers on a daily basis you have most likely ran into this problem: You have to perform a fresh installation of Windows on a computer with a corrupt operating system, and the product key has been lost. This method makes it easy to find.

Instructions

The first step is getting the ntuser.dat file from the computer. In most cases the easiest method is to remove the hard drive, and connect it to a working machine.

ntuser.dat is generally located here:
C:\Documents and Settings\(User Name)\ntuser.dat
Where (User Name) is the primary account – Most often it is ‘Owner’ or ‘User’

Now that you have the file, you need to be able to view it. I recommend loadhive.exe (Download it here) from matcode.com.

Just run the program and select the file. It will show you a message with more information. It is important that you do not close this program until you are finished viewing the registry, as it temporarily loads the file, and unloads it again when you exit.

Now run regedit. Under HKEY_LOCAL_MACHINE you will notice a new sub-key called NTUSER. Starting with NTUSER go to Software > Microsoft > Windows NT > Current Version.

In the right window, double-click on DigitalProductID. This is the entry that contains the encoded product key.

We want the information in bytes 52 to 66. You can use the chart below for reference. We need the 15 sets of numbers where the 1’s are located.

0000  00 00 00 00 00 00 00 00  ..
0008  00 00 00 00 00 00 00 00  ..
0010  00 00 00 00 00 00 00 00  ..
0018  00 00 00 00 00 00 00 00  ..
0020  00 00 00 00 00 00 00 00  ..
0028  00 00 00 00 00 00 00 00  ..
0030  00 00 00 00 11 11 11 11  ..
0038  11 11 11 11 11 11 11 11  ..
0040  11 11 11 00 00 00 00 00  ..
0048  00 00 00 00 00 00 00 00  ..
0050  00 00 00 00 00 00 00 00  ..

Now that you have the 15 byte encrypted code, you can type it into my decrypter tool:

Web-based version

Windows XP Key Decrypter Tool

Downloadable stand-alone version (exe)

Windows XP Key Decrypter Tool

Just click ‘Decrypt Code‘ and you will have your 25 digit Windows XP product key!

Troubleshooting

If you cannot find the DigitalProductId key in the file you loaded earlier, try the software hive located here:

\%SystemRoot%\System32\config\software

Load it the same way as before. Under regedit, it will generally create the new entries here: HKEY_LOCAL_MACHINE\SOFTWARE_00 (although the loadhive program will tell you where it puts it).

Final Notes

  • The decrypter tool ignores spaces and dashes, and is not case-sensitive.
  • If you cannot find ntuser.dat, make sure you can view hidden and system files.
  • If you are not sure which user account to select, I recommend searching for all ntuser.dat files on the drive, and using the largest one.
  • Do not attempt to open your own ntuser.dat file with Load Hive, because it is already in use, and you already have access to your own registry :)
  • If you cannot find the proper key with the data you need, try the alternate hive file, mentioned in the troubleshooting section above.

NOTICE!

Please do not ask me how to retrieve the product key from your Windows CD – it is not possible. Also, please do not ask general Windows questions here. The comments below are only for discussion of this particular retrieval method. If you have Windows questions, or questions about product keys in general, search Google.

  If you have found this page useful, please consider donating. Thanks!

Pages: « 2014 13 12 11 10 [9] 8 7 6 5 41 » Show All

  1. 135
    Shealee

    I got the product key code, but I don’t think it is right. I am going to continue to try to find my cd case with the product id on it.

  2. Shealee: The chart above shows the numbers. The 1’s are where the numbers are that you use.

  3. 133
    Shealee

    I don’t uenderstand what numbers I am looking for one I get into the digital product id. Can you help me?

  4. Reh: This is not really the best place to ask that, but you will just need to format the drive with the new CD.

  5. I bought a new computer without an Operating system. I tried to install Windowxs XP Pro x64. The problem is the key on cd is not readable and I can’t complete installation. i also have windoxs XP Pro and I want to install that instead but The computer keeps trying to make me complete installation of x64. How can i bypass x64 so i can install XP Pro?

  6. Nice script, I would be interested to see the PHP source, I myself made a ASP version of this a long time ago.

  7. Bill: I do not really need an example, my script is one already ;) Nice work though.

  8. 128
    Bill

    In Reverse Order. Take the Bytes from DigitalProductID 52 to 66 and write them down in Reverse Order. Convert each to DEC. Then you perform repeated Multiplication by 256, INT Division by 24 to start a new list for the next character, MOD Division by 24 to get the next number to start the process over. When you are finished with the original list you will have the results of the final MOD Division which when Converted by using a table will give you the last Character of the CD KE.
    Send me an email and I can send you a complete example.

  9. Bill: Not to be skeptical, but I will believe that when I see it :) What order does your method generate the final result in?

  10. 126
    Bill

    I figured out the math behind the source code for the XP Product Key. I takes about an hour to do with pencil. To get one character of the key takes 15 steps. If any one is interested, I can pass it on.

  11. 125
    Bill

    What I really would like to know is the Math behind the source code, not the source code itself. I have found several different examples of source code on the net but can’t figure out the math. Each of the encrypted bits represents two places in the product key but how is it done? There is a divided by 24 statement and a MOD statement. I will keep at it.

  12. Bill: Good to know! I had not tried it on Vista yet. As for the source code, I may release it some day. The code is not that interesting to look at though ;)

  13. 123
    Bill Max

    Your code works with VISTA. Good Job. Would like to learn more about how MS encrypts this Product Key. Would like to see the source code.

  14. 122
    bassface

    great it really worked just for curiosity i tried to find “Keyfinder151.Zip” which was mentuioned by another poster but with no success .anyone have a copy?

  15. 121
    Brian Waylett

    This worked brilliantly. I was able to recover my Product number
    many thanks to Matt

Pages: « 2014 13 12 11 10 [9] 8 7 6 5 41 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.