找回密码
 加入
搜索
查看: 5258|回复: 22

有没有修改XP序列号的源码 啊!?

[复制链接]
发表于 2008-7-31 10:52:40 | 显示全部楼层 |阅读模式
我在autoit论坛上看见过一个!但是好像有错误!序列号不对

[ 本帖最后由 eaglelin 于 2008-11-8 14:16 编辑 ]
发表于 2008-8-2 22:31:31 | 显示全部楼层
。。。。。。。。。。晕``你是来学习怎么写入的`还是  去讨论序列号不对`?
发表于 2008-8-3 02:20:36 | 显示全部楼层
以前的是我发的。。。序列号不对是修改不成功的。
 楼主| 发表于 2008-8-3 12:31:51 | 显示全部楼层
你的源码执行以后 正确的序列号 没有显示出来
发表于 2008-11-6 09:51:20 | 显示全部楼层
我的也是,正确的序列号 没有显示出来
发表于 2008-11-6 11:10:27 | 显示全部楼层
有错误就修改一下,源码呢?
发表于 2008-11-6 11:19:32 | 显示全部楼层
#include <GUIConstants.au3>
#include <Constants.au3>
_wmiset()
$strComputer = "."
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
Global $colComputers
$colComputers = $objWMIService.ExecQuery("Select * from win32_WindowsProductActivation")
               
$hgui = GUICreate("Windows XP/2003 序列号更换工具", 300, 150)
GuiSetIcon("shell32.dll",162, $hgui)

Dim $Setkey = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "DigitalProductID")
GUICtrlCreateLabel("系统序列号:更换序号请按照以下格式输入", 20, 10, 300, 20)
GUICtrlSetColor(-1,0xff0000)
  $Key = GUICtrlCreateInput("",20, 30,183, 20)
  GUICtrlSetData($key, DecodeProductKey($Setkey))
  $readbutton = GUICtrlCreateButton("修改", 20, 80, 100, 25)
  $exitbutton = GUICtrlCreateButton("退出", 150, 80, 100, 25)
  GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()

Sleep(600)
WEnd

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


Func _wmiset()
;制作:叁恨居士
;功能:判断系统是否存在WMI服务,没有便退出。如果没有运行,便将WMI服务设置启动类型为自动并运行它。
$foo = Run(@ComSpec & " /c sc query winmgmt", @SystemDir, @SW_HIDE, $STDOUT_CHILD)
$lines = ""
While 1
    $line = StdoutRead($foo)
    If @error Then ExitLoop
     $lines &= $line
Wend
$lines = StringSplit($lines,@CRLF,1)
For $x = 1 To $lines[0]
        If StringInStr($lines[$x], "1060")  Then
                MsgBox(32,"错误","本软件运行所需的服务不存在")
                ExitLoop
                   Exit
    ElseIf StringInStr($lines[$x], "STOPPED") Then
               RunWait(@ComSpec & ' /c sc config winmgmt start= auto', @SystemDir, @SW_HIDE)
        RunWait(@ComSpec & ' /c sc start winmgmt', @SystemDir, @SW_HIDE)
              ExitLoop
    EndIf
Next
EndFunc
发表于 2008-11-6 12:02:06 | 显示全部楼层
改不了,希望有人能帮忙改一下了。
发表于 2008-11-7 21:20:18 | 显示全部楼层
看来没有人来帮了。自己解决。
发表于 2008-11-7 23:04:23 | 显示全部楼层
  这个修改序列号的代码,好像是少了修改的函数段,不过觉得好像比较复杂,不像VB脚本的地个修改简小...
发表于 2008-11-7 23:48:25 | 显示全部楼层
唉。现在的世道。连复制脚本都复制少了。

完整脚本如下,是很久以前写的了。我都忘记得差不多了,还给你们翻出来。
有时间我整理,更新一下吧。


#include <GUIConstants.au3>


$strComputer = "."

        $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")

$colComputers = $objWMIService.ExecQuery("Select * from win32_WindowsProductActivation")
                                                                              
$hgui = GUICreate("Windows XP/2003 序列号更换工具", 300, 150)
GuiSetIcon("shell32.dll",162, $hgui)
        
        Dim $Setkey = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "DigitalProductID")
        GUICtrlCreateLabel("系统序列号:更换序号请按照以下格式输入", 20, 10, 300, 20)
        GUICtrlSetColor(-1,0xff0000)
                $Key = GUICtrlCreateInput("",20, 30,230, 25)
                GUICtrlSetData($key, DecodeProductKey($Setkey))
                $readbutton = GUICtrlCreateButton("修改", 20, 80, 100, 25)
                $exitbutton = GUICtrlCreateButton("退出", 150, 80, 100, 25)
                
                
                GUISetState(@SW_SHOW)
        While 1
        $msg = GUIGetMsg()
                Select
                        Case $msg = $readbutton
                                $readkey = GUICtrlRead($Key)
                                If $readkey = "" then
                                        MsgBox(16,"错误","你确定你输入的序列号没错吗?")
                                        Else
                                $Setkey=StringReplace($readkey,"-","")
                                
                                
                                ;MsgBox(0,"sdlkfj",$Setkey)
                                
                                for $obj In $colComputers 
                                
      
                                 $Obj.SetProductKey ($Setkey)
                                 if @error = 0 then
MsgBox(64,"恭喜!!!","您的 Windows CD-KEY 修改成功。请检查系统属性。")
Endif

if @error <> 0 then
        
MsgBox(16,"失败","修改失败!请检查输入的 CD-KEY 是否与当前 Windows 版本相匹配。")


Endif
                                        
                                        Next
                                        Endif
                                Case $msg = $GUI_EVENT_CLOSE  Or $msg = $exitbutton
                                Exit
                EndSelect
        WEnd
        

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





发表于 2008-11-7 23:54:01 | 显示全部楼层
就是那个$obj.SetProductKey()
发表于 2008-11-8 00:10:14 | 显示全部楼层
怪了,新版运行脚本肯定是错误的,老版本编译好的没问题...
发表于 2008-11-8 09:31:10 | 显示全部楼层
回sanhen:
不是说你的代码运行的问题,而是运行之后显示出来的序列号是不正确的。这个序列号根本不是系统的序列号。
发表于 2008-11-8 11:48:06 | 显示全部楼层
原帖由 redapple2008 于 2008-11-8 09:31 发表
回sanhen:
不是说你的代码运行的问题,而是运行之后显示出来的序列号是不正确的。这个序列号根本不是系统的序列号。


你用老版本运行或者编译后,肯定是正确的,新版本的问题吧...
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-18 19:47 , Processed in 0.075072 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表