Public Function ConvertToOSProductKey(sKey() As Byte) As String
Dim X As Long, i As Long, Chars As String, Cur As Long, Last As Long, KeyPart1 As String, IsWin8 As Integer, KeyOutput As String
Dim Key() As Byte
Key = Binary1ArrayTo0Array(sKey)
IsWin8 = (Key(66) \ 6) And 1
Key(66) = (Key(66) And &HF7) Or ((IsWin8 And 2) * 4)
i = 24
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
X = 14
Do
Cur = Cur * 256
Cur = Key(X + 52) + Cur
Key(X + 52) = (Cur \ 24)
Cur = Cur Mod 24
X = X - 1
Loop While X >= 0
i = i - 1
KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
Last = Cur
Loop While i >= 0
If (IsWin8 = 1) Then
KeyPart1 = Mid(KeyOutput, 2, Last)
KeyOutput = Replace(KeyOutput, KeyPart1, KeyPart1 & "N", 2, 1, 0)
If Last = 0 Then KeyOutput = "N" & KeyOutput
End If
ConvertToOSProductKey = Mid(KeyOutput, 1, 5) & "-" & Mid(KeyOutput, 6, 5) & "-" & Mid(KeyOutput, 11, 5) & "-" & Mid(KeyOutput, 16, 5) & "-" & Mid(KeyOutput, 21, 5)
End Function
АндрейБ писал(а):В системе пользователь администратор.
АндрейБ писал(а):у меня win8.
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 21