Guest User

Untitled

a guest
Dec 18th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. Set WshShell = CreateObject("WScript.Shell")
  2.  
  3. MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
  4.  
  5. Function ConvertToKey(Key)
  6.  
  7. Const KeyOffset = 52
  8.  
  9. i = 28
  10.  
  11. Chars = "BCDFGHJKMPQRTVWXY2346789"
  12.  
  13. Do
  14.  
  15. Cur = 0
  16.  
  17. x = 14
  18.  
  19. Do
  20.  
  21. Cur = Cur * 256
  22.  
  23. Cur = Key(x + KeyOffset) + Cur
  24.  
  25. Key(x + KeyOffset) = (Cur \ 24) And 255
  26.  
  27. Cur = Cur Mod 24
  28.  
  29. x = x -1
  30.  
  31. Loop While x >= 0
  32.  
  33. i = i -1
  34.  
  35. KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
  36.  
  37. If (((29 - i) Mod 6) = 0) And (i <> -1) Then
  38.  
  39. i = i -1
  40.  
  41. KeyOutput = "-" & KeyOutput
  42.  
  43. End If
  44.  
  45. Loop While i >= 0
  46.  
  47. ConvertToKey = KeyOutput
  48.  
  49. End Function
Add Comment
Please, Sign In to add comment