Results 1 to 8 of 8

Thread: Product keys and the registry

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    4

    Product keys and the registry

    Hello folks.

    I am a PC repair and networking technician in Bellingham, WA. I have been given a task regarding CD/Product keys and developing a small stand alone program that will scan and pull customer's product keys prior to reloading their OS.

    Much like this one: http://www.klinzmann.name/licensecrawler.htm

    If anyone can kick start me to create one of these progs, I'd appreciate it.

  2. #2
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Product keys and the registry

    Is it safe to assume you've never worked with the registry with Vb .NET before?

    If not, then I would recommend reading up on some tutorials from Google. There is also a wealth of info here on this site.

    Next, you'll need to locate where the info is in the registry. I know that most of the installed application are located in: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products

    You can check the files within that key to see if any of them pertain to the product keys.

    I also know that Office 11.0 stores it's key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Registration\{90110409-6000-11D3-8CFE-0150048383C9} and Office 12.0 in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Registration\{90120000-0021-0000-0000-0000000FF1CE}\.

    The key is kept in the DigitalProductID item within that key.

    Windows' keeps its DigitalProductID in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\.

    That should get you started.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    4

    Re: Product keys and the registry

    I have worked with VB.net and the registry. I have never done so in order to retrieve product keys for a customer, prior to reinstalling their OS.

    The program link I posted pulls ALL product keys from the registry that are currently installed.

  4. #4

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    4

    Re: Product keys and the registry

    According to your post, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products

    Appears to be where I need to create a routine to scan and pull product keys that are currently installed on a machine. At least as a trial run.

    Is this correct?

  5. #5
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Product keys and the registry

    You'll need to figure out how each application stores it's keys and where. They obviously aren't going to be in plain alphanumeric characters. You'll need to figure out the encode their product keys.

    Typically, you can match up the characters in the registry key with corresponding alphanumeric characters.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  6. #6
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Product keys and the registry

    According to your post, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products

    Appears to be where I need to create a routine to scan and pull product keys that are currently installed on a machine.

    Is this correct?
    Yes. I actually made a loop with the help of some people on this site that loops through those keys and lists them in a ListView. I'll look for it and post the code.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  7. #7
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Product keys and the registry

    Here it is:

    vb Code:
    1. Public Sub UninstallPrograms()
    2.             'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products
    3.             Dim SoftwareKey As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products"
    4.             Using rk As RegistryKey = Registry.LocalMachine.OpenSubKey(SoftwareKey)
    5.                 For Each skName In rk.GetSubKeyNames()
    6.                     Dim propertiesKey As RegistryKey = Registry.LocalMachine.OpenSubKey(SoftwareKey, False). _
    7.                                                                              OpenSubKey(skName, False). _
    8.                                                                              OpenSubKey("InstallProperties", False)
    9.                     Dim name = propertiesKey.GetValue("DisplayName", "<DisplayName not found>")
    10.                     Dim publisher = propertiesKey.GetValue("Publisher", "<Publisher not found>")
    11.                     Dim DisplayVersion = propertiesKey.GetValue("DisplayVersion", "<Display Version not found>")
    12.                     Dim installLocation = propertiesKey.GetValue("InstallLocation", "<InstallLocation not found>")
    13.                     propertiesKey.Close()
    14.                 Next
    15.             End Using
    16.     End Sub
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  8. #8

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    4

    Re: Product keys and the registry

    Thanks much.

    I'll use your code as a starting point.

    I'll post back later if I make any headway. I would like to make something quite similar to that program I posted. It seems to have been done in C++ or VB.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width