Windows XP Slideshow

  1. # create table to convert in base 24 
  2. $map="BCDFGHJKMPQRTVWXY2346789" 
  3. # Read registry Key 
  4. $value = (get-itemproperty "HKLM:\\SOFTWARE\Microsoft\Windows NT\CurrentVersion").digitalproductid[0x34..0x42] 
  5. # Convert in Hexa to show you the Raw Key 
  6. $hexa = "" 
  7. $value | foreach
  8.   $hexa = $_.ToString("X2") + $hexa 
  9. "Raw Key Big Endian: $hexa" 
  10.  
  11. # find the Product Key 
  12. $ProductKey = "" 
  13. for ($i = 24; $i -ge 0; $i--) { 
  14.   $r =
  15.   for ($j = 14; $j -ge 0; $j--) { 
  16.     $r = ($r * 256) -bxor $value[$j
  17.     $value[$j] = [math]::Floor([double]($r/24)) 
  18.     $r = $r % 24 
  19.   
  20.   $ProductKey = $map[$r] + $ProductKey  
  21.   if (($i % 5) -eq 0 -and $i -ne 0) { 
  22.     $ProductKey = "-" + $ProductKey 
  23.   
  24. "Product Key: $ProductKey" 
 
Loading...
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.