Windows Produkt Key auslesen

  • hi,

    ich würde gerne mal wissen wie und wo man den windows produkt key auslesen kann so wie z.b. everest das machst.

    ich hab gehört das der in der reg stehen soll aber verschlüsselt.

    hoffe das mir jemand helfen kann und schon mal danke für alle antworten.

    Einmal editiert, zuletzt von .::Mignon::. (6. Juni 2008 um 21:18)

  • so nun stehe ich vor einem anderen problem, die func von xeno kann leider nur die keys von xp und vista auslesen. gibt es evlt. eine andere func für die betriebssysteme darunter funktioniert? also 2000 ME etc.

    freue mich wie immre auf eure antworten ;)

  • du brauchst es vllt nicht aber ich um so mehr. weißt du wenn ob die produkt key bei ME oder kleiner auch verschlüsselt sind wie bei XP und einfahc so in der reg stehen. ;)

  • sry, aber soweit ich das beurteilen kann is das lediglich die seriennummer vom system die bei der installation erstellt wird mit der kann ich aber leider nichts anfangen.

    ich hab die ganzen reg pfade von 95 - ME aber nur für diese seriennummer. anscheindend ist der PKEY woanders gespeichert.

    da im forum von deinem link auch geschreiben ist das der PKEY gar nicht gespeichert wird mussi ch sagen das es wahrscheinlich nicht stimmt da programme wie everest home auch den PKEY anzeigen.

    also hoffe auf weitere hilfe aber danke für deine bemühungen progandy ;)

  • AIDA32 sollte den Key anzeigen. Dann schua einfach mal, wo es den ausließt mit
    Process Monitor
    oder schau dir den Source von http://www.magicaljellybean.com/keyfinder/ an
    vor allem

    Spoiler anzeigen
    Zitat
  • ok thx das hat mir schon sehr weitergeholfen. leider weiß nich nich in welche programmsprache das skript von dir geschrieben war und verstehe deshalb nicht alles.

    Spoiler anzeigen

    ich weiß jetzt nich genau bei welchen betriebssystmen dieser teil vom skript die keys auslesen kann. "procedure TForm1.Get9xKey" lässt da vermuten das 98 95 gemeint sind aber zählen 2000 und ME auch dazu?

  • Das ist Delphi. Und der 2000/ME Key wird wie der XP Key ausgelesen ?
    9x ist für 95 und 98 ;)

  • @progandy: das die func in meinen beispiel win 95 und 98 ausliest ist mir kla. eigentlich wollte ich wissen welche func aus deinem beispiel für me und 2000 zuständig ist. ;)

  • Moin Mignon,

    Spoiler anzeigen
    [autoit]

    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.1.1 beta
    ; Author: Thorsten Meger <[email='Thorsten.Meger@gmx.de'][/email]> & ...
    ;
    ; Script Function:
    ; Windows XP Information displayed in a GUI
    ; with Office-Key (only Office XP or 2003 supported)
    ;
    ; ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    #include <GUIConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    ;GUI
    $GUI = GUICreate("Windows Information", 685, 450, 158, 127)

    [/autoit] [autoit][/autoit] [autoit]

    ;Labels
    $windowsInformation_L = GUICtrlCreateLabel("Windows Information", 8, 8, 659, 25)
    $status_L = GUICtrlCreateLabel("Information read out ...", 24, 80, 400, 17)
    $description_L = GUICtrlCreateLabel("Description", 16, 112, 103, 17)
    $windowsType_L = GUICtrlCreateLabel("WindowsType", 16, 152, 103, 17)
    $serialNumber_L = GUICtrlCreateLabel("SerialNumber", 16, 192, 103, 17)
    $ProductKey_L = GUICtrlCreateLabel("ProductKey", 16, 232, 103, 17)
    $InstallDate_L = GUICtrlCreateLabel("InstallDate", 16, 272, 103, 17)
    $LastBootUpTime_L = GUICtrlCreateLabel("LastBootUpTime", 16, 312, 103, 17)
    $RegisteredOwner_L = GUICtrlCreateLabel("RegisteredOwner", 16, 352, 103, 17)
    $officeKey_L = GUICtrlCreateLabel("OfficeKey", 16, 392, 103, 17)

    [/autoit] [autoit][/autoit] [autoit]

    ;Input
    $description_I = GUICtrlCreateInput("Description", 130, 112, 389, 21)
    $windowsType_I = GUICtrlCreateInput("WindowsType", 130, 152, 389, 21)
    $serialNumber_I = GUICtrlCreateInput("SerialNumber", 130, 192, 389, 21)
    $ProductKey_I = GUICtrlCreateInput("ProductKey", 130, 232, 389, 21)
    $InstallDate_I = GUICtrlCreateInput("InstallDate", 130, 272, 389, 21)
    $LastBootUpTime_I = GUICtrlCreateInput("LastBootUpTime", 130, 312, 389, 21)
    $RegisteredOwner_I = GUICtrlCreateInput("RegisteredOwner", 130, 352, 389, 21)
    $officeKey_I = GUICtrlCreateInput("OfficeKey", 130, 392, 389, 21)

    [/autoit] [autoit][/autoit] [autoit]

    ;Groups
    $informationPanel_G = GUICtrlCreateGroup("Information Panel", 8, 48, 585, 393)
    $status_G = GUICtrlCreateGroup("Status", 14, 64, 553, 41)
    $buttins_G = GUICtrlCreateGroup("Buttons", 608, 48, 65, 393)
    $office_G = GUICtrlCreateGroup("Microsoft Office", 14, 375, 553, 48)

    [/autoit] [autoit][/autoit] [autoit]

    ;Buttons
    $exit_B = GUICtrlCreateButton("Exit", 616, 72, 49, 25, 0)
    $Description_B = GUICtrlCreateButton("clipboard", 616, 112, 49, 25, 0)
    $WindowsType_B = GUICtrlCreateButton("clipboard", 616, 152, 49, 25, 0)
    $SerialNumber_B = GUICtrlCreateButton("clipboard", 616, 192, 49, 25, 0)
    $ProductKey_B = GUICtrlCreateButton("clipboard", 616, 232, 49, 25, 0)
    $InstallDate_B = GUICtrlCreateButton("clipboard", 616, 272, 49, 25, 0)
    $LastBootUpTime_B = GUICtrlCreateButton("clipboard", 616, 312, 49, 25, 0)
    $registeredOwner_B = GUICtrlCreateButton("clipboard", 616, 352, 49, 25, 0)
    $OfficeKey_B = GUICtrlCreateButton("clipboard", 616, 392, 49, 25, 0)

    [/autoit] [autoit][/autoit] [autoit]

    ; SetFont
    $font = "Comic Sans MS"
    GUICtrlSetFont($windowsInformation_L, 16, 400, 4, $font)

    [/autoit] [autoit][/autoit] [autoit]

    ;ProgressBar
    $progressbar = GUICtrlCreateProgress(140, 75, 400, 25)

    [/autoit] [autoit][/autoit] [autoit]

    ;Global variables
    Global $product = "" ; Office product Version (XP or 2003)
    Global $counter = 3 ; Counter for progressBar
    Global $wait = 150 ; Wait for progessBar

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $msg = GUIGetMsg()
    If $counter = 3 Then
    Sleep(500)
    GUICtrlSetData($status_L, "Initialize... " & $counter)
    progress()
    $counter -= 1
    ElseIf $counter = 2 Then
    GUICtrlSetData($status_L, "Initialize... " & $counter)
    progress()
    $counter -= 1
    ElseIf $counter = 1 Then
    GUICtrlSetData($status_L, "Initialize... " & $counter)
    progress()
    $counter -= 1
    ElseIf $counter = 0 Then
    GUICtrlSetData($status_L, "Ready ...")
    progress()
    $counter -= 1
    ElseIf $counter = -1 Then
    Dim $Bin = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "DigitalProductID")
    Dim $key4RegisteredOwner = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
    $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
    $colSettings = $objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")

    For $objOperatingSystem In $colSettings
    Next
    GUICtrlSetData($description_I, StringMid($objOperatingSystem.Description, 1))
    GUICtrlSetData($windowsType_I, '(' & @OSVersion & ') ' & StringMid($objOperatingSystem.Caption, 19))
    GUICtrlSetData($serialNumber_I, StringMid($objOperatingSystem.SerialNumber, 1))
    GUICtrlSetData($ProductKey_I, DecodeProductKey($Bin))
    GUICtrlSetData($InstallDate_I, WMIDateStringToDate($objOperatingSystem.InstallDate))
    GUICtrlSetData($LastBootUpTime_I, WMIDateStringToDate($objOperatingSystem.LastBootUpTime))
    GUICtrlSetData($RegisteredOwner_I, RegRead($key4RegisteredOwner, "RegisteredOwner"))
    GUICtrlSetData($officeKey_I, getOfficeKey())
    GUICtrlSetData($officeKey_L, "Office " & $product)
    $counter -= 1
    ElseIf $counter < - 1 Then
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $exit_B
    GUICtrlSetData($status_L, "So long, Mega")
    Sleep(1500)
    ExitLoop
    Case $msg = $Description_B
    ClipPut(StringMid($objOperatingSystem.Description, 1))
    GUICtrlSetData($status_L, "Description copied to clipboard")
    Case $msg = $WindowsType_B
    ClipPut('(' & @OSVersion & ') ' & StringMid($objOperatingSystem.Caption, 19))
    GUICtrlSetData($status_L, "WindowsType copied to clipboard")
    Case $msg = $SerialNumber_B
    ClipPut(StringMid($objOperatingSystem.SerialNumber, 1))
    GUICtrlSetData($status_L, "SerialNumber copied to clipboard")
    Case $msg = $ProductKey_B
    ClipPut(DecodeProductKey($Bin))
    GUICtrlSetData($status_L, "ProductKey copied to clipboard")
    Case $msg = $InstallDate_B
    ClipPut(WMIDateStringToDate($objOperatingSystem.InstallDate))
    GUICtrlSetData($status_L, "InstallDate copied to clipboard")
    Case $msg = $LastBootUpTime_B
    ClipPut(WMIDateStringToDate($objOperatingSystem.LastBootUpTime))
    GUICtrlSetData($status_L, "LastBootUpTime copied to clipboard")
    Case $msg = $registeredOwner_B
    ClipPut(RegRead($key4RegisteredOwner, "RegisteredOwner"))
    GUICtrlSetData($status_L, "RegisteredOwner copied to clipboard")
    Case $msg = $OfficeKey_B
    ClipPut(getOfficeKey())
    GUICtrlSetData($status_L, "OfficeKey copied to clipboard")
    Case Else
    ;;;;;;;
    EndSelect
    EndIf
    WEnd
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.1.1 beta
    ; Author: Unknown & Thorsten Meger <[email='Thorsten.Meger@gmx.de'][/email]>
    ;
    ; Script Function: Decode REG_BINARY
    ; ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    Func DecodeProductKey($BinaryDPID)
    Local $bKey[15]
    Local $sKey[29]
    Local $Digits[24]
    Local $Value = 0
    Local $hi = 0
    Local $n = 0
    Local $i = 0
    Local $dlen = 29
    Local $slen = 15
    Local $Result

    $Digits = StringSplit("BCDFGHJKMPQRTVWXY2346789", "")
    $BinaryDPID = StringMid($BinaryDPID, 105, 30)
    For $i = 1 To 29 Step 2
    $bKey[Int($i / 2) ] = Dec(StringMid($BinaryDPID, $i, 2))
    Next
    For $i = $dlen - 1 To 0 Step - 1
    If Mod(($i + 1), 6) = 0 Then
    $sKey[$i] = "-"
    Else
    $hi = 0
    For $n = $slen - 1 To 0 Step - 1
    $Value = BitOR(BitShift($hi, -8), $bKey[$n])
    $bKey[$n] = Int($Value / 24)
    $hi = Mod($Value, 24)
    Next
    $sKey[$i] = $Digits[$hi + 1]
    EndIf
    Next
    For $i = 0 To 28
    $Result = $Result & $sKey[$i]
    Next
    Return $Result
    EndFunc ;==>DecodeProductKey

    [/autoit] [autoit][/autoit] [autoit]

    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.1.1 beta
    ; Author: Unknown & Thorsten Meger <[email='Thorsten.Meger@gmx.de'][/email]>
    ;
    ; Script Function: WMIDateStringToDate (changed Date format)
    ; ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    Func WMIDateStringToDate($dtmDate)
    Return (StringMid($dtmDate, 7, 2) & "/" & _
    StringMid($dtmDate, 5, 2) & "/" & StringLeft($dtmDate, 4) _
    & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate, 13, 2))
    EndFunc ;==>WMIDateStringToDate

    [/autoit] [autoit][/autoit] [autoit]

    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.1.1 beta
    ; Author: Thorsten Meger <[email='Thorsten.Meger@gmx.de'][/email]>
    ;
    ; Script Function: Display a "fake" progressbar at the beginning
    ; ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    Func progress()
    If $counter = 3 Then
    For $i = 0 To 20 Step 1
    GUICtrlSetData($progressbar, $i)
    Sleep($wait / 20)
    Next
    ElseIf $counter = 2 Then
    For $i = 20 To 50 Step 1
    GUICtrlSetData($progressbar, $i)
    Sleep($wait / 30)
    Next
    ElseIf $counter = 1 Then
    For $i = 50 To 80 Step 1
    GUICtrlSetData($progressbar, $i)
    Sleep($wait / 30)
    Next
    ElseIf $counter = 0 Then
    For $i = 80 To 100 Step 1
    GUICtrlSetData($progressbar, $i)
    Sleep($wait / 20)
    Next
    GUICtrlSetState($progressbar, $GUI_HIDE)
    EndIf
    EndFunc ;==>progress

    [/autoit] [autoit][/autoit] [autoit]

    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.1.1 beta
    ; Author: Thorsten Meger <[email='Thorsten.Meger@gmx.de'][/email]>
    ;
    ; Script Function:Get & decode OfficeKey
    ; ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    Func getOfficeKey()
    Local $List[1]
    Local $i = 1
    $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Common\InstallRoot", "Path")
    If $var <> "" Then
    $product = "2003"
    Dim $officeKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Registration"
    Else
    $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0\Common\InstallRoot", "Path")
    If @error <> 0 Then
    GUICtrlSetData($status_L, "Info: Unable to find installationPath, maybe no Office installed!")
    Return "No Office XP or 2003 found"
    EndIf
    If $var <> "" Then
    $product = "XP"
    Dim $officeKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0\Registration"
    EndIf
    EndIf
    Dim $var = RegEnumKey($officeKey, $i)
    If @error <> 0 Then
    GUICtrlSetData($status_L, "Info: Unable to find REG_BINARY 'DigitalProductID', maybe no Office installed!")
    Return "No Office XP or 2003 found"
    Else
    $List[$i - 1] = RegRead($officeKey & "\" & $var, "DigitalProductID")
    If $List[$i - 1] = "" Then
    GUICtrlSetData($status_L, "Info: Unable to find REG_BINARY 'DigitalProductID', maybe no Office installed!")
    Else
    $key = $List[$i - 1]
    Return DecodeProductKey($key)
    EndIf
    EndIf
    EndFunc ;==>getOfficeKey

    [/autoit]


    Gruß
    Greenhorn


  • Greenhorn: das ke für dein beispiel hat mir geholfen. aber weißt du zufällig auch wo ich ien beispiel zum auslesne von 2000, ME bekommen kann?

    @progandy: da ich delphi nicht kann wundert mich diese zeile im skript immer wieder "if Listbox1.Items[0] <> 'Microsoft Windows 2000' then" das heißt doch eigentlich: wenn Listbox1... was anderes ist als "Microsoft Win 2000" dann ... oder?
    es wundert mich nun aber das es nie heißt: wenn Listbox1... = "Microsoft Win 2000" dann ... also sollte doch win 2000 nie ausgelesen werden oder?

  • Bei Win2000 sollte es auch funzen, weiß ich aber nicht genau ... :S

    ME -> K.A. ...
    95A -> HKLM\Software\Microsoft\Windows\CurrentVersion\ProductId ; Unverschlüsselt
    98SE -> HKLM\Software\Microsoft\Windows\CurrentVersion\ProductKey ; Unverschlüsselt


    Gruß


  • das mit 95, 98 hab ich schon gewusst, aber anscheinend weißt du auch nicht wie der bei ME 2000 ist. ich hab aber gelesen das es bei ME genau so sein soll wie bei 98. hatte aber noch keine möglichkeit dies zu testen. nur bei 2000 weiß ich gar nichts.

  • <> 'Microsoft Windows 2000' then" das heißt doch eigentlich: wenn Listbox1... was anderes ist als "Microsoft Win 2000" dann ... oder?
    es wundert mich nun aber das es nie heißt: wenn Listbox1... = "Microsoft Win 2000" dann ... also sollte doch win 2000 nie ausgelesen werden oder?

    Über den Punktoperator greift das Objekt "Listbox1" auf das Klassenelement (der Klasse für die "Listview1" definiert wurde) "Item[0]" zu, um es auszulesen.

    In AutoIt hieße das ungefähr so:

    [autoit]


    $Listbox1 = DllStructCreate('char Item[256];')
    $data = DllStructGetData($Listbox1, 'Item', 0)

    [/autoit][autoit][/autoit][autoit]

    If $data <> 'Microsoft Win 2000' Then

    [/autoit]


    Gruß
    Greenhorn


  • das mit 95, 98 hab ich schon gewusst, aber anscheinend weißt du auch nicht wie der bei ME 2000 ist. ich hab aber gelesen das es bei ME genau so sein soll wie bei 98. hatte aber noch keine möglichkeit dies zu testen. nur bei 2000 weiß ich gar nichts.

    Code
    // Don't change Registry.Access method if Win2k


    Also so wie bei XP ! ;)


  • den satz hab ich völlig überlesen, vllt weil es kein skript code wa^^ naja dann kann man also mit der xp func 2000, xp und vista auslesen ;)

    nur zu welcher func wählt denn nur win ME?