找回密码
 加入
搜索
查看: 3532|回复: 7

[AU3基础] 请教使用鼠标模拟操作后,如何继续执行剩下的代码?

  [复制链接]
发表于 2013-11-21 22:15:56 | 显示全部楼层 |阅读模式
使用run打开一个软件A,然后使用AU3模拟鼠标操作,通过这个A软件的界面上提供的菜单,建立了一个SQL数据库,完毕之后再通过结束进程及鼠标模拟选择“确定”的方式来关闭窗口。可是接下来的代码就不再去执行了。请教原因及解决办法,谢谢!
部分代码及图片如下:


Run($U8Path & "\Admin\Admin.exe")
WinWait("用友U8[系统管理]")
WinActivate("用友U8[系统管理]")
Send("{alt down}")
Send("S")
Sleep(20)
Send("{DOWN}")
Send("{DOWN}")
Sleep(1000)
Send("{ENTER}")
Send("{alt up}")
WinWaitActive("初始化数据库实例")
ControlSend("初始化数据库实例", "", "Edit1", @ComputerName)
ControlSend("初始化数据库实例", "", "Edit2", $iNput)
ControlClick("初始化数据库实例", "", "[CLASS:Button; INSTANCE:2]")
WinWaitActive("系统管理")
ControlClick("系统管理", "", "[CLASS:Button; INSTANCE:1]")
Sleep(40000)
ProcessClose("admin.exe")
WinWait("Windows 任务管理器")
WinActivate("Windows 任务管理器")
Send("{ENTER}")
ControlClick("Windows 任务管理器", "", "[CLASS:Button; INSTANCE:1]")

图片1:

图片2:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2013-11-21 22:36:23 | 显示全部楼层
WinWait("Windows 任务管理器")?
这个窗口如何出来?不出来,代码就一直停这了。你要手动按出来吗?
 楼主| 发表于 2013-11-22 19:34:05 | 显示全部楼层
回复 2# user3000


ProcessClose("admin.exe")

这样会弹出来的。
发表于 2013-11-22 20:15:27 | 显示全部楼层
回复 3# smooth

既然你这么认为,我相信这里没人能帮到你的忙了!
 楼主| 发表于 2013-11-22 20:20:40 | 显示全部楼层
关闭任务管理器之后,脚本就会卡住,迷惘了。

#include <GuiStatusBar.au3>
#include <WinAPIEx.au3>

$Title = "用友U8 V11.0 SP1破解工具"
If WinExists($Title) Then Exit
Global $Form = GUICreate($Title, 360, 270)

DirCreate(@TempDir & '\U8Crack')
Global $Admin = @TempDir & '\U8Crack\Admin.ex_'
Global $ServerNT = @TempDir & '\U8Crack\ServerNT.ex_'
Global $U8TaskService = @TempDir & '\U8Crack\U8TaskService.ex_'
Global $UFIDA_U8_Pub_UFServerMgr = @TempDir & '\U8Crack\UFIDA.U8.Pub.UFServerMgr.ex_'
Global $VMProtectSDK32 = @TempDir & '\U8Crack\VMProtectSDK32.dll'
Global $VMProtectSDK64 = @TempDir & '\U8Crack\VMProtectSDK64.dll'
Global $UFSoft_U8_Framework_Login_BO = @TempDir & '\U8Crack\UFSoft.U8.Framework.Login.BO.dl_'
FileInstall('Admin.ex_', $Admin, 1)
FileInstall('ServerNT.ex_', $ServerNT, 1)
FileInstall('U8TaskService.ex_', $U8TaskService, 1)
FileInstall('UFIDA.U8.Pub.UFServerMgr.ex_', $UFIDA_U8_Pub_UFServerMgr, 1)
FileInstall('VMProtectSDK32.dll', $VMProtectSDK32, 1)
FileInstall('VMProtectSDK64.dll', $VMProtectSDK64, 1)
FileInstall('UFSoft.U8.Framework.Login.BO.dl_', $UFSoft_U8_Framework_Login_BO, 1)

Dim $Button[5]
$Button[1] = GUICtrlCreateButton("执行破解(&E)", 20, 10, 76, 25)
$Button[2] = GUICtrlCreateButton("删除破解(&D)", 130, 10, 76, 25)
$Button[3] = GUICtrlCreateButton("重启用友服务(&R)", 240, 10, 98, 25)
$Button[4] = GUICtrlCreateButton("浏览(&B)", 290, 68, 50, 20)

Global $Group[5]
$Group[1] = GUICtrlCreateGroup("", 10, 50, 340, 84)
$Group[2] = GUICtrlCreateGroup("", 12, 52, 336, 80)
$Group[3] = GUICtrlCreateGroup("", 10, 140, 340, 100)
$Group[4] = GUICtrlCreateGroup("", 12, 142, 336, 96)

;创建状态栏
Local $aParts[5] = [36, 250, 254, 310, -1];数组2代表分成两部分。
$hStatus = _GUICtrlStatusBar_Create($Form)
_GUICtrlStatusBar_SetParts($hStatus, $aParts)

Global $OSVer
If @OSVersion = "WIN_2008R2" Then
        $OSVer = "Windows 2008 R2"
ElseIf @OSVersion = "WIN_7" Then
        $OSVer = "Windows 7"
ElseIf @OSVersion = "WIN_8" Then
        $OSVer = "Windows 8"
ElseIf @OSVersion = "WIN_2008" Then
        $OSVer = "Windows 2008"
ElseIf @OSVersion = "WIN_VISTA" Then
        $OSVer = "Windows VISTA"
ElseIf @OSVersion = "WIN_2003" Then
        $OSVer = "Windows 2003"
ElseIf @OSVersion = "WIN_XP" Then
        $OSVer = "Windows XP"
ElseIf @OSVersion = "WIN_2000" Then
        $OSVer = "Windows 2000"
EndIf

GUICtrlCreateLabel("U8相关信息检测", 138, 50, 84, 12)

GUICtrlCreateLabel("安装路径:", 20, 72, 60, 12)
$ServDetails = _ServGetDetails("U8TaskService")
Global $U8Path = StringLeft($ServDetails[14], StringLen($ServDetails[14]) - 18)
$Label = GUICtrlCreateLabel('', 78, 72, 212, 12)
$hLabel = GUICtrlGetHandle($Label)
GUICtrlSetData(-1, _WinAPI_PathCompactPath($hLabel, $U8Path))

GUICtrlCreateLabel("版 本 号:", 20, 92, 60, 12)
$Getversion = _WinAPI_VerQueryValue($U8Path & "\EnterprisePortal.exe")
$U8version = $Getversion[1][4]
GUICtrlCreateLabel($U8version, 80, 92, 200, 12)

GUICtrlCreateLabel("补 丁 包:", 20, 112, 60, 12)
GUICtrlCreateLabel("SP1", 80, 112, 200, 12)

GUICtrlCreateLabel("重要说明", 155, 140, 50, 12)
GUICtrlCreateLabel("本补丁仅适用于用友U8 V11.0 SP1(11.00.2048),不适用于", 20, 160, 326, 12)
GUICtrlCreateLabel("U8其他版本,请勿混用,否则可能引起严重的问题。因破解文", 20, 180, 326, 12)
GUICtrlCreateLabel("件的特殊性,使用前请彻底关闭杀毒软件的监控,否则破解失", 20, 200, 326, 12)
GUICtrlCreateLabel("败!请不要用于商业用途,相关法律责任由使用者负责!", 20, 220, 326, 12)

GUICtrlCreateLabel("系统", 5, 252, 24, 12)
GUICtrlCreateLabel($OSVer, 40, 252, 208, 12)
GUICtrlCreateLabel("系统构架", 256, 252, 50, 12)
GUICtrlCreateLabel(@OSArch, 330, 252, 50, 12)

GUISetState(@SW_SHOW)
While 1
        $msg = GUIGetMsg()
        Switch $msg
                Case -3
                        DirRemove(@TempDir & '\U8Crack', 1)
                        Exit
                Case $Button[1]
                        If $U8Path = "" Then
                                MsgBox(16, "禁止运行", "您计算机上并未安装用友U8软件,程序无法继续!", "")
                        ElseIf $U8version <> "11.00.2048" Then
                                MsgBox(16, "警告", "本补丁不适用于您计算机上安装的U8版本,程序无法继续!", "")
                        ElseIf FileGetTime($U8Path & "\Admin\Admin.exe", 0, 1) = "20130425213146" And FileGetSize($U8Path & "\Admin\Admin.exe") = "8351744" Then
                                If MsgBox(33, "提醒", "用友U8软件已破解,您确定需要重新破解吗?", "") = 1 Then
                                        _PJ()
                                EndIf
                        Else
                                _PJ()
                        EndIf
                Case $Button[2]
                        If $U8Path = "" Then
                                MsgBox(16, "禁止运行", "您计算机上并未安装用友U8软件,程序无法继续!", "")
                        Else
                                If FileGetTime($U8Path & "\Admin\Admin.exe", 0, 1) = "20130121145810" And FileGetSize($U8Path & "\Admin\Admin.exe") = "6299648" Then
                                        MsgBox(16, "警告", "您的用友U8并没有破解,程序无法继续!", "")
                                Else
                                        If MsgBox(49, "提醒", "您真的要删除破解文件并恢复U8原始文件吗?", "") = 1 Then
                                                _HF()
                                                MsgBox(64, "提示", "用友U8 V11.0 SP1删除破解成功!", "")
                                        EndIf
                                EndIf
                        EndIf
                Case $Button[3]
                        _RestartServer()
                        $server = _ServGetState("U8TaskService")
                        If $server = "Running" Then
                                MsgBox(64, "提示", "重启用友服务成功!", "")
                        EndIf
                Case $Button[4]
                        Run("explorer.exe " & $U8Path)
        EndSwitch
        
WEnd

Func _PJ()
        If Not FileExists($U8Path & "\Admin\" & @ComputerName & "\UFSystem.MDF") Then
                If MsgBox(17, "警告", "您没有初始化用友数据库,不允许破解!让程序帮您初始化数据库吗?" & @CRLF & @CRLF & "您也可以在<开始菜单-用友U8V11.0-系统服务-系统管理>进行初始化。", "") = 1 Then
                        Global $iNput = InputBox("数据库实例sa账户口令", "请您输sa密码:" & @CRLF & @CRLF & _
                                        "一般情况下sa的口令为123456,如果密码为空,则直接点击“确定”即可。" & _
                                        "如果您忘记密码,请在SQL数据库管理工具中进行修改。", "")
                        If @error <> 1 Then
                                Run($U8Path & "\Admin\Admin.exe")
                                WinWait("用友U8[系统管理]")
                                WinActivate("用友U8[系统管理]")
                                Send("{alt down}")
                                Send("S")
                                Sleep(20)
                                Send("{DOWN}")
                                Send("{DOWN}")
                                Sleep(1000)
                                Send("{ENTER}")
                                Send("{alt up}")
                                WinWaitActive("初始化数据库实例")
                                ControlSend("初始化数据库实例", "", "Edit1", @ComputerName)
                                ControlSend("初始化数据库实例", "", "Edit2", $iNput)
                                ControlClick("初始化数据库实例", "", "[CLASS:Button; INSTANCE:2]")
                                WinWaitActive("系统管理")
                                ControlClick("系统管理", "", "[CLASS:Button; INSTANCE:1]")
                                Sleep(30000)
                                ProcessClose("admin.exe")
                                WinWait("Windows 任务管理器")
                                WinActivate("Windows 任务管理器")
                                Send("{ENTER}")
                                ControlClick("Windows 任务管理器", "", "[CLASS:Button; INSTANCE:1]")
                                If Not FileExists($U8Path & "\Admin\" & @ComputerName & "\UFSystem.MDF") Then
                                        Sleep(20000)

                                        ;关闭服务
                                        RunWait(@ComSpec & " /c SC stop UFNet", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC stop U8TaskService", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC stop U8DispatchService", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC stop U8KeyManagePool", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC stop U8MPool", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC stop U8SCMPool", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC stop U8SLReportService", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC stop U8WebPool", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC stop UFReportService", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC stop UTUService", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC stop Apache4TurboCRM70", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC stop TurboCRM70", '', @SW_HIDE)
                                        
                                        ;备份破解之前的文件
                                        If FileGetTime($U8Path & "\Admin\Admin.exe", 0, 1) = "20130121145810" And FileGetSize($U8Path & "\Admin\Admin.exe") = "6299648" Then
                                                FileMove($U8Path & "\Admin\Admin.exe", $U8Path & "\Admin\Admin.exe.bak", 1)
                                        EndIf
                                        If FileGetTime(@SystemDir & "\ServerNT.exe", 0, 1) = "20130425213145" And FileGetSize(@SystemDir & "\ServerNT.exe") = "2265088" Then
                                                FileMove(@SystemDir & "\ServerNT.exe", @SystemDir & "\ServerNT.exe.bak", 1)
                                        EndIf
                                        If FileGetTime($U8Path & "\U8TaskService.exe", 0, 1) = "20130118160636" And FileGetSize($U8Path & "\U8TaskService.exe") = "183080" Then
                                                FileMove($U8Path & "\U8TaskService.exe", $U8Path & "\U8TaskService.exe.bak", 1)
                                        EndIf
                                        If FileGetTime($U8Path & "\UFServerMgr\UFIDA.U8.Pub.UFServerMgr.exe", 0, 1) = "20130116155542" And FileGetSize($U8Path & "\UFServerMgr\UFIDA.U8.Pub.UFServerMgr.exe") = "256512" Then
                                                FileMove($U8Path & "\UFServerMgr\UFIDA.U8.Pub.UFServerMgr.exe", $U8Path & "\UFServerMgr\UFIDA.U8.Pub.UFServerMgr.exe.bak", 1)
                                        EndIf
                                        If FileGetTime($U8Path & "\U8Framework\Bin\Framework\UFSoft.U8.Framework.Login.BO.dll", 0, 1) = "20130123132034" And FileGetSize($U8Path & "\U8Framework\Bin\Framework\UFSoft.U8.Framework.Login.BO.dll") = "192512" Then
                                                FileMove($U8Path & "\U8Framework\Bin\Framework\UFSoft.U8.Framework.Login.BO.dll", $U8Path & "\U8Framework\Bin\Framework\UFSoft.U8.Framework.Login.BO.dll.bak", 1)
                                        EndIf
                                        
                                        ;复制破解文件到目标路径
                                        FileCopy($Admin, $U8Path & "\Admin\Admin.exe", 1)
                                        FileCopy($ServerNT, @SystemDir & "\ServerNT.exe", 1)
                                        FileCopy($U8TaskService, $U8Path & "\U8TaskService.exe", 1)
                                        FileCopy($UFIDA_U8_Pub_UFServerMgr, $U8Path & "\UFServerMgr\UFIDA.U8.Pub.UFServerMgr.exe", 1)
                                        FileCopy($UFSoft_U8_Framework_Login_BO, $U8Path & "\U8Framework\Bin\Framework\UFSoft.U8.Framework.Login.BO.dll", 1)
                                        If @OSArch = "X86" Then
                                                FileCopy($VMProtectSDK32, @SystemDir & "\", 1)
                                        Else
                                                FileCopy($VMProtectSDK64, @SystemDir & "\", 1)
                                        EndIf
                                        
                                        Run($U8Path & "\Admin\Admin.exe")
                                        WinActivate("用友提醒您:")
                                        ControlClick("用友提醒您:", "", "[ID:1]")
                                        ControlSend("密钥", "", "Edit1", "AAAAAA")
                                        ControlSend("密钥", "", "Edit2", "BBBBBB")
                                        ControlClick("密钥", "", "[ID:1]")
                                        ControlClick("密钥有效", "", "[ID:1]")
                                        Sleep(10000)
                                        ProcessClose("admin.exe")
                                        WinWait("Windows 任务管理器")
                                        WinActivate("Windows 任务管理器")
                                        ControlClick("Windows 任务管理器", "", "[CLASS:Button; INSTANCE:1]")
                                        
                                        ;开启服务
                                        RunWait(@ComSpec & " /c SC start U8DispatchService", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC start U8KeyManagePool", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC start U8MPool", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC start U8SCMPool", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC start U8SLReportService", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC start U8WebPool", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC start UFReportService", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC start UTUService", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC start Apache4TurboCRM70", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC start TurboCRM70", '', @SW_HIDE)
                                        RunWait(@ComSpec & " /c SC start UFNet", '', @SW_HIDE);这个服务的作用是读取加密卡的信息,为U8各个模块的登录提供加密服务,它的启动依赖于数据库初始化,也即是用友必须在SQL中建立数据库,才可以启动;
                                        ;RunWait(@ComSpec & " /c SC start U8TaskService", '', @SW_HIDE);这个服务会自动启动,就不用去启动它了。
                                        
                                        MsgBox(64, "恭喜", "用友U8 V11.0 SP1破解成功!", "")
                                EndIf
                        Else
                                MsgBox(16, "警告", "您没有输入sa账户密码,无法初始化数据库,破解无法继续!")
                        EndIf
                EndIf
        Else
                If MsgBox(33, "提示", "您确定开始破解吗?", "") = 1 Then
                        ;关闭服务
                        RunWait(@ComSpec & " /c SC stop UFNet", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC stop U8TaskService", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC stop U8DispatchService", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC stop U8KeyManagePool", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC stop U8MPool", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC stop U8SCMPool", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC stop U8SLReportService", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC stop U8WebPool", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC stop UFReportService", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC stop UTUService", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC stop Apache4TurboCRM70", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC stop TurboCRM70", '', @SW_HIDE)
                        
                        ;备份破解之前的文件
                        If FileGetTime($U8Path & "\Admin\Admin.exe", 0, 1) = "20130121145810" And FileGetSize($U8Path & "\Admin\Admin.exe") = "6299648" Then
                                FileMove($U8Path & "\Admin\Admin.exe", $U8Path & "\Admin\Admin.exe.bak", 1)
                        EndIf
                        If FileGetTime(@SystemDir & "\ServerNT.exe", 0, 1) = "20130425213145" And FileGetSize(@SystemDir & "\ServerNT.exe") = "2265088" Then
                                FileMove(@SystemDir & "\ServerNT.exe", @SystemDir & "\ServerNT.exe.bak", 1)
                        EndIf
                        If FileGetTime($U8Path & "\U8TaskService.exe", 0, 1) = "20130118160636" And FileGetSize($U8Path & "\U8TaskService.exe") = "183080" Then
                                FileMove($U8Path & "\U8TaskService.exe", $U8Path & "\U8TaskService.exe.bak", 1)
                        EndIf
                        If FileGetTime($U8Path & "\UFServerMgr\UFIDA.U8.Pub.UFServerMgr.exe", 0, 1) = "20130116155542" And FileGetSize($U8Path & "\UFServerMgr\UFIDA.U8.Pub.UFServerMgr.exe") = "256512" Then
                                FileMove($U8Path & "\UFServerMgr\UFIDA.U8.Pub.UFServerMgr.exe", $U8Path & "\UFServerMgr\UFIDA.U8.Pub.UFServerMgr.exe.bak", 1)
                        EndIf
                        If FileGetTime($U8Path & "\U8Framework\Bin\Framework\UFSoft.U8.Framework.Login.BO.dll", 0, 1) = "20130123132034" And FileGetSize($U8Path & "\U8Framework\Bin\Framework\UFSoft.U8.Framework.Login.BO.dll") = "192512" Then
                                FileMove($U8Path & "\U8Framework\Bin\Framework\UFSoft.U8.Framework.Login.BO.dll", $U8Path & "\U8Framework\Bin\Framework\UFSoft.U8.Framework.Login.BO.dll.bak", 1)
                        EndIf
                        
                        ;复制破解文件到目标路径
                        FileCopy($Admin, $U8Path & "\Admin\Admin.exe", 1)
                        FileCopy($ServerNT, @SystemDir & "\ServerNT.exe", 1)
                        FileCopy($U8TaskService, $U8Path & "\U8TaskService.exe", 1)
                        FileCopy($UFIDA_U8_Pub_UFServerMgr, $U8Path & "\UFServerMgr\UFIDA.U8.Pub.UFServerMgr.exe", 1)
                        FileCopy($UFSoft_U8_Framework_Login_BO, $U8Path & "\U8Framework\Bin\Framework\UFSoft.U8.Framework.Login.BO.dll", 1)
                        If @OSArch = "X86" Then
                                FileCopy($VMProtectSDK32, @SystemDir & "\", 1)
                        Else
                                FileCopy($VMProtectSDK64, @SystemDir & "\", 1)
                        EndIf
                        
                        Run($U8Path & "\Admin\Admin.exe")
                        WinActivate("用友提醒您:")
                        ControlClick("用友提醒您:", "", "[ID:1]")
                        ControlSend("密钥", "", "Edit1", "AAAAAA")
                        ControlSend("密钥", "", "Edit2", "BBBBBB")
                        ControlClick("密钥", "", "[ID:1]")
                        ControlClick("密钥有效", "", "[ID:1]")
                        Sleep(10000)
                        ProcessClose("admin.exe")
                        WinWait("Windows 任务管理器")
                        WinActivate("Windows 任务管理器")
                        ControlClick("Windows 任务管理器", "", "[CLASS:Button; INSTANCE:1]")
                        
                        ;开启服务
                        RunWait(@ComSpec & " /c SC start U8DispatchService", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC start U8KeyManagePool", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC start U8MPool", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC start U8SCMPool", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC start U8SLReportService", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC start U8WebPool", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC start UFReportService", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC start UTUService", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC start Apache4TurboCRM70", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC start TurboCRM70", '', @SW_HIDE)
                        RunWait(@ComSpec & " /c SC start UFNet", '', @SW_HIDE);这个服务的作用是读取加密卡的信息,为U8各个模块的登录提供加密服务,它的启动依赖于数据库初始化,也即是用友必须在SQL中建立数据库,才可以启动;
                        ;RunWait(@ComSpec & " /c SC start U8TaskService", '', @SW_HIDE);这个服务会自动启动,就不用去启动它了。
                        
                        MsgBox(64, "恭喜", "用友U8 V11.0 SP1破解成功!", "")
                EndIf
        EndIf
EndFunc   ;==>_PJ

Func _HF()
        ;关闭服务
        RunWait(@ComSpec & " /c SC stop UFNet", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8TaskService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8DispatchService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8KeyManagePool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8MPool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8SCMPool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8SLReportService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8WebPool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop UFReportService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop UTUService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop Apache4TurboCRM70", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop TurboCRM70", '', @SW_HIDE)
        
        ;恢复破解之前的文件
        FileMove($U8Path & "\Admin\Admin.exe.bak", $U8Path & "\Admin\Admin.exe", 1)
        FileMove(@SystemDir & "\ServerNT.exe.bak", @SystemDir & "\ServerNT.exe", 1)
        FileMove($U8Path & "\U8TaskService.exe.bak", $U8Path & "\U8TaskService.exe", 1)
        FileMove($U8Path & "\UFServerMgr\UFIDA.U8.Pub.UFServerMgr.exe.bak", $U8Path & "\UFServerMgr\UFIDA.U8.Pub.UFServerMgr.exe", 1)
        FileMove($U8Path & "\U8Framework\Bin\Framework\UFSoft.U8.Framework.Login.BO.dll.bak", $U8Path & "\U8Framework\Bin\Framework\UFSoft.U8.Framework.Login.BO.dll", 1)
        If @OSArch = "X86" Then
                FileDelete(@SystemDir & "\VMProtectSDK32.dll")
        Else
                FileDelete(@SystemDir & "\VMProtectSDK64.dll")
        EndIf
        
        ;开启服务
        RunWait(@ComSpec & " /c SC start UFNet", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8DispatchService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8KeyManagePool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8MPool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8SCMPool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8SLReportService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8TaskService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8WebPool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start UFReportService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start UTUService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start Apache4TurboCRM70", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start TurboCRM70", '', @SW_HIDE)
EndFunc   ;==>_HF

Func _RestartServer()
        ;关闭服务
        RunWait(@ComSpec & " /c SC stop UFNet", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8DispatchService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8KeyManagePool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8MPool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8SCMPool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8SLReportService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8TaskService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop U8WebPool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop UFReportService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop UTUService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop Apache4TurboCRM70", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC stop TurboCRM70", '', @SW_HIDE)
        ;开启服务
        RunWait(@ComSpec & " /c SC start UFNet", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8DispatchService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8KeyManagePool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8MPool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8SCMPool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8SLReportService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8TaskService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start U8WebPool", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start UFReportService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start UTUService", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start Apache4TurboCRM70", '', @SW_HIDE)
        RunWait(@ComSpec & " /c SC start TurboCRM70", '', @SW_HIDE)
EndFunc   ;==>_RestartServer

Func _ServGetDetails($iName, $Computer = ".")
        Local $Rtn = ''
        $Service = ObjGet("winmgmts:\\" & $Computer & "\root\cimv2")
        $sItems = $Service.ExecQuery("Select * from Win32_Service")
        For $objService In $sItems
                If $objService.Name == $iName Then
                        $Rtn &= $objService.SystemName & '|' & $objService.Name & '|' & $objService.ServiceType & '|' & $objService.State & '|'
                        $Rtn &= $objService.ExitCode & '|' & $objService.ProcessID & '|' & $objService.AcceptPause & '|' & $objService.AcceptStop & '|'
                        $Rtn &= $objService.Caption & '|' & $objService.Description & '|' & $objService.DesktopInteract & '|' & $objService.DisplayName & '|'
                        $Rtn &= $objService.ErrorControl & '|' & $objService.PathName & '|' & $objService.Started & '|' & $objService.StartMode & '|'
                        $Rtn &= $objService.StartName
                        Return StringSplit($Rtn, '|')
                EndIf
        Next
        Return SetError(-1)
EndFunc   ;==>_ServGetDetails

Func _ServGetState($iName, $Computer = ".")
        $Service = ObjGet("winmgmts:\\" & $Computer & "\root\cimv2")
        $sItems = $Service.ExecQuery("Select * from Win32_Service")
        For $objItem In $sItems
                If $objItem.Name == $iName Then Return $objItem.State
        Next
        Return SetError(-1)
EndFunc   ;==>_ServGetState
 楼主| 发表于 2013-11-22 20:23:27 | 显示全部楼层
本帖最后由 smooth 于 2013-11-22 21:50 编辑

回复 4# user3000

去掉winwait就可以了,看来这个函数不能乱用。谢谢。
发表于 2013-11-26 20:11:39 | 显示全部楼层
好长的代码啊  学习了!
发表于 2013-11-27 09:30:26 | 显示全部楼层
完全看不懂,晕。差距大
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-20 14:43 , Processed in 0.080055 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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