Hallo liebe Autoit´ler,
Ich wollte fragen ob es schon einen Script gibt womit es möglich ist den Key von Windows 8/8.1 auszulesen. Ich weiß das es bereits einen "Script" für Windows 7 gibt, daher wollte ich einmal fragen.
Hallo liebe Autoit´ler,
Ich wollte fragen ob es schon einen Script gibt womit es möglich ist den Key von Windows 8/8.1 auszulesen. Ich weiß das es bereits einen "Script" für Windows 7 gibt, daher wollte ich einmal fragen.
Kommt drauf an wie der Key in diesem Script für win7 abgefragt wurde aber ich würde darauf tippen dass das Script auch mit win8 noch funktioniert
Kommt drauf an wie der Key in diesem Script für win7 abgefragt wurde aber ich würde darauf tippen dass das Script auch mit win8 noch funktioniert
Der Script für Windows 7 usw. wird per DigitalProductId Abgefragt, den Script habe ich bereits ausprobiert aber leider erfolglos.
Keine Ahnung welches Script du getestet hast, aber das hier funktioniert von XP bis 8.1 völlig problemlos:
ConsoleWrite("Windows Key : " & @TAB & _DecodeProductKey("Windows") & @CRLF)
[/autoit] [autoit][/autoit] [autoit]ConsoleWrite("Windows Key 4 : " & @TAB & _DecodeProductKey("Windows_DPid4") & @CRLF)
ConsoleWrite("Windows Default : " & @TAB & _DecodeProductKey("Windows_Def") & @CRLF)
ConsoleWrite("Windows Default 4 : " & @TAB & _DecodeProductKey("Windows_Def_DPid4") & @CRLF & @CRLF)
ConsoleWrite("Office XP Key : " & @TAB & _DecodeProductKey("Office XP") & @CRLF)
ConsoleWrite("Office 2003 Key : " & @TAB & _DecodeProductKey("Office 2003") & @CRLF)
ConsoleWrite("Office 2007 Key : " & @TAB & _DecodeProductKey("Office 2007") & @CRLF)
ConsoleWrite("Office 2010 x86 Key: " & @TAB & _DecodeProductKey("Office 2010 x86") & @CRLF)
ConsoleWrite("Office 2010 x64 Key: " & @TAB & _DecodeProductKey("Office 2010 x64") & @CRLF)
Func _DecodeProductKey($Product, $Offset = 0)
Local $sKey[29], $Value = 0, $hi = 0, $n = 0, $i = 0, $dlen = 29, $slen = 15, $Result, $bKey, $iKeyOffset = 52, $RegKey
Switch $Product
[/autoit] [autoit][/autoit] [autoit]Case "Windows"
$bKey = RegRead("HKLM64\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "DigitalProductId")
Case "Windows_DPid4"
$bKey = RegRead("HKLM64\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "DigitalProductId4")
$iKeyOffset = 0x328
Case "Windows_Def"
$bKey = RegRead("HKLM64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DefaultProductKey", "DigitalProductId")
Case "Windows_Def_DPid4"
$bKey = RegRead("HKLM64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DefaultProductKey", "DigitalProductId4")
$iKeyOffset = 0x328
Case "Office XP"
$RegKey = 'HKLM\SOFTWARE\Microsoft\Office\10.0\Registration'
IF @OSArch = 'x64' Then $RegKey = 'HKLM64\SOFTWARE\Wow6432Node\Microsoft\Office\10.0\Registration'
For $i= 1 to 100
$var = RegEnumKey($RegKey, $i)
If @error <> 0 then ExitLoop
$bKey = RegRead($RegKey & '\' & $var, 'DigitalProductId')
IF Not @error Then ExitLoop
Next
Case "Office 2003"
$RegKey = 'HKLM\SOFTWARE\Microsoft\Office\11.0\Registration'
IF @OSArch = 'x64' Then $RegKey = 'HKLM64\SOFTWARE\Wow6432Node\Microsoft\Office\11.0\Registration'
For $i= 1 to 100
$var = RegEnumKey($RegKey, $i)
If @error <> 0 then ExitLoop
$bKey = RegRead($RegKey & '\' & $var, 'DigitalProductId')
IF Not @error Then ExitLoop
Next
Case "Office 2007"
$RegKey = 'HKLM\SOFTWARE\Microsoft\Office\12.0\Registration'
IF @OSArch = 'x64' Then $RegKey = 'HKLM64\SOFTWARE\Wow6432Node\Microsoft\Office\12.0\Registration'
For $i= 1 to 100
$var = RegEnumKey($RegKey, $i)
If @error <> 0 then ExitLoop
$bKey = RegRead($RegKey & '\' & $var, 'DigitalProductId')
IF Not @error Then ExitLoop
Next
Case "Office 2010 x86"
$RegKey = 'HKLM\SOFTWARE\Microsoft\Office\14.0\Registration'
IF @OSArch = 'x64' Then $RegKey = 'HKLM64\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Registration'
For $i= 1 to 100
$var = RegEnumKey($RegKey, $i)
If @error <> 0 then ExitLoop
$bKey = RegRead($RegKey & '\' & $var, 'DigitalProductId')
IF Not @error Then ExitLoop
Next
$iKeyOffset = 0x328
Case "Office 2010 x64"
IF @OSArch <> 'x64' Then SetError(1, 0, "Product not found")
$RegKey = 'HKLM64\SOFTWARE\Microsoft\Office\14.0\Registration'
For $i= 1 to 100
$var = RegEnumKey($RegKey, $i)
If @error <> 0 then ExitLoop
$bKey = RegRead($RegKey & '\' & $var, 'DigitalProductId')
IF Not @error Then ExitLoop
Next
$iKeyOffset = 0x328
Case Else
Return SetError(1, 0, "Product not supported")
EndSwitch
[/autoit] [autoit][/autoit] [autoit]IF Not BinaryLen($bKey) Then Return ""
[/autoit] [autoit][/autoit] [autoit]Local $aKeys[BinaryLen($bKey)]
For $i = 0 To UBound($aKeys) - 1
$aKeys[$i] = Int(BinaryMid($bKey, $i + 1, 1))
Next
Local Const $isWin8 = BitAND(Int($aKeys[66]) / 6, 1)
$aKeys[66] = BitOR(BitAND($aKeys[66], 0xF7), BitAND($isWin8, 2) * 4)
$i = 24
Local $sChars = "BCDFGHJKMPQRTVWXY2346789", $iCur, $iX, $sKeyOutput, $iLast
While $i > -1
$iCur = 0
$iX = 14
While $iX > -1
$iCur *= 256
$iCur = $aKeys[$iX + $iKeyOffset] + $iCur
$aKeys[$iX + $iKeyOffset] = Int($iCur / 24)
$iCur = Mod($iCur, 24)
$iX -= 1
WEnd
$i -= 1
$sKeyOutput = StringMid($sChars, $iCur + 1, 1) & $sKeyOutput
$iLast = $iCur
WEnd
If $isWin8 Then
$sKeyOutput = StringMid($sKeyOutput,2,$iLast)&"N"&StringTrimLeft($sKeyOutput,$iLast+1)
EndIf
Return StringRegExpReplace($sKeyOutput, '(\w{5})(\w{5})(\w{5})(\w{5})(\w{5})', '\1-\2-\3-\4-\5')
[/autoit] [autoit][/autoit] [autoit]EndFunc
[/autoit]Genau sowas hatte ich gesucht, Danke! Ich hatte so wie es aussieht einen ganz anderen..
Aber was genau ist der Unterschied
[autoit]ConsoleWrite("Windows Key : " & @TAB & _DecodeProductKey("Windows") & @CRLF)
[/autoit][autoit][/autoit][autoit]ConsoleWrite("Windows Key 4 : " & @TAB & _DecodeProductKey("Windows_DPid4") & @CRLF)
ConsoleWrite("Windows Default : " & @TAB & _DecodeProductKey("Windows_Def") & @CRLF)
ConsoleWrite("Windows Default 4 : " & @TAB & _DecodeProductKey("Windows_Def_DPid4") & @CRLF & @CRLF)
zwischen den "Windows Key", "Windows Key4", "Windows Default" & "Windows Default 4"?