最新消息:

windows 系统key读取脚本(三)

脚本专区 永恒心锁 1877浏览 0评论
@echo off & setlocal enabledelayedexpansion
set tokens=%WinDir%\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat
set vbs=winkey.vbs
for /f "delims=:" %%a in ('findstr /n /b ":vbs" %0') do (more +%%a %0>"%vbs%")
for /f "delims=" %%a in ('cscript //nologo "%vbs%"') do set key=%%a
del "%vbs%"
cls
echo.&echo 提取密钥:%key%
>> .\winkey.ini echo [winkey]
>> .\winkey.ini echo key=%key%
:vbs
ON ERROR RESUME NEXT
Dim objShell
Set objShell = CreateObject("WScript.Shell")
WScript.Echo GetKey(objShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
Function GetKey(rpk)
 Const rpkOffset=52:i=28
 szPossibleChars="BCDFGHJKMPQRTVWXY2346789"
 Do
 dwAccumulator=0 : j=14
 Do
 dwAccumulator=dwAccumulator*256
 dwAccumulator=rpk(j+rpkOffset)+dwAccumulator
 rpk(j+rpkOffset)=(dwAccumulator\24) and 255
 dwAccumulator=dwAccumulator Mod 24
 j=j-1
 Loop While j>=0
 i=i-1 : szProductKey=mid(szPossibleChars,dwAccumulator+1,1)&szProductKey
 if (((29-i) Mod 6)=0) and (i<>-1) then
 i=i-1 : szProductKey="-"&szProductKey
 End If
 Loop While i>=0
 GetKey=szProductKey
End Function
永恒心锁,版权所有丨如未注明,均为转载丨本网站采用BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » windows 系统key读取脚本(三)

您必须 登录 才能发表评论!