Advertisement
Guest User

key.vbs

a guest
Jul 29th, 2015
885
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Set oWSH = CreateObject("WScript.Shell")
  2. MsgBox "Serial key = " & CTK(oWSH.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
  3.  
  4. Function CTK(Key)
  5.     Const KeyOffset = 52
  6.     i = 28
  7.     Chars = "BCDFGHJKMPQRTVWXY2346789"
  8.     Do
  9.         Cur = 0
  10.         x = 14
  11.         Do
  12.             Cur = Cur * 256
  13.             Cur = Key(x + KeyOffset) + Cur
  14.             Key(x + KeyOffset) = (Cur \ 24) And 255
  15.             Cur = Cur Mod 24
  16.             x = x -1
  17.         Loop While x >= 0
  18.         i = i -1
  19.         KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
  20.         If (((29 - i) Mod 6) = 0) And (i <> -1) Then
  21.             i = i -1
  22.             KeyOutput = "-" & KeyOutput
  23.         End If
  24.     Loop While i >= 0
  25.     CTK = KeyOutput
  26. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement