Jump to content

MS Windows informations...


sambalec
 Share

Recommended Posts

This is for the product key, i hope it works with your windows.

What else do you need? You can get the most information with the WMI. Just search for it.

ConsoleWrite(_GetWinProductKey() & @CR)

Func _GetWinProductKey()
    Local $bKey[15]
    Local $sKey[29]
    Local $Digits[24]
    Local $Value = 0
    Local $hi = 0
    local $n = 0
    Local $i = 0
    Local $Result
 Local $RegKey = "HKLM"
 If Not @OSArch = "X86" Then $RegKey = "HKLM64"
    $binaryDPID = RegRead($RegKey & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion","DigitalProductID")
    $Test = @extended

    If Not @Compiled Then
        If $Test = 3 Then $binaryDPID = Hex($binaryDPID)
    EndIf

    $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 = 28 To 0 Step -1
        If Mod(($i + 1), 6) = 0 Then
            $sKey[$i] = "-"
        Else
            $hi = 0
            For $n = 14 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

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...