分类: 網管相關
作者: hopol

if @OSTYPE <> "WIN32_NT" then
MsgBox(64,"出错提示!","目前本程序只支持在NT/2000/XP/2003系统上使用," & @CRLF & "" & @CRLF & "Win9x系统请等待后续版本发布。")
exit
endif
Dim $reg,$User1,$User2,$User3,$msg,$gamereg,$netini,$diskini,$file1,$file2,$file3,$file4,$file5,$file6,$btn1,$btn2,$btn3
Opt("TrayIconHide",1)
$gamereg = '"'
$reg = "play.reg"
$netini=iniread(@ScriptDir& "\" &"config.ini","config","远程路径基","")
$diskini=iniread(@ScriptDir& "\" &"config.ini","config","本地路径基","")
$GatewayIP = iniread(@ScriptDir& "\" &"config.ini","config","网关IP","")
$GatewayMAC = iniread(@ScriptDir& "\" &"config.ini","config","网关MAC","")
$text = iniread(@ScriptDir& "\" &"config.ini","config","远程路径基","")
$text = StringReplace(""& $text &"", '"', "")
$runname=iniread(@ScriptDir& "\" &"config.ini","config","runname","")
$runpass=iniread(@ScriptDir& "\" &"config.ini","config","runpass","")

Func Gameupsetup()
#include
GUICreate ("网管之星更新系统快捷方式生成器",510,265)
$file1 = GUICtrlCreateInput ($netini, 90, 5, 300, 20)
GuiCtrlCreateLabel("远程路径基:", 15, 9)
$file2 = GUICtrlCreateInput ( ""& $diskini &"", 90, 35, 300, 20)
GuiCtrlCreateLabel("本地路径基:", 15, 39)
$file3 = GUICtrlCreateInput ( "", 90, 65, 300, 20)
GuiCtrlCreateLabel("更新目录名:", 15, 69)
$file4 = GUICtrlCreateInput ( "", 90, 95, 300, 20)
GuiCtrlCreateLabel("执行文件名:", 15, 99)
$file5 = GUICtrlCreateInput ( "", 90, 125, 300, 20)
GuiCtrlCreateLabel("快捷方式名:", 15, 129)
$file6 = GUICtrlCreateInput ( ""& $GatewayIP &"", 90, 155, 200, 20)
GuiCtrlCreateLabel("网关IP地址:", 15, 159)
$file7 = GUICtrlCreateInput ( ""& $GatewayMAC &"", 90, 185, 200, 20)
GuiCtrlCreateLabel("网关 M A C:", 15, 189)
GuiCtrlCreateLabel("本程序设计制作由:空手套MM(QQ:171270)完成。使用方式永久免费!", 75, 249)
GUICtrlCreateGroup ("导入注册表", 410, 60, 80, 55)
$radio_1 = GUICtrlCreateCheckbox ("是", 440, 80, 35, 20,)
GUICtrlCreateGroup ("强制更新", 410, 120, 80, 55,)
$radio_2 = GUICtrlCreateCheckbox ("是", 440, 140, 35, 20,)
$btn1 = GUICtrlCreateButton ("生成快捷方式", 410, 185, 80, 55)
$btn2 = GUICtrlCreateButton ("修改远程路径", 410, 5, 80, 20)
$btn3 = GUICtrlCreateButton ("修改本地路径", 410, 35, 80, 20)
$btn4 = GUICtrlCreateButton ("简要使用说明", 15, 219, 80, 20)
$btn5 = GUICtrlCreateButton ("更新程序修复", 113, 219, 80, 20)
$btn6 = GUICtrlCreateButton ("服务器检测", 212, 219, 80, 20)
$btn7 = GUICtrlCreateButton ("生成前检测", 309, 219, 80, 20)
$btn8 = GUICtrlCreateButton ("网关IP修改", 309, 155, 80, 20)
$btn9 = GUICtrlCreateButton ("网关MAC修改", 309, 185, 80, 20)
GUISetState ()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $btn1
if GUICtrlRead($radio_1) <> "4" then
$reg = "reg_yes"
Else
$reg = "reg_no"
endif
if GUICtrlRead($radio_2) <> "4" then
$up = "-"
Else
$up = "+"
endif
$text2 = GUICtrlRead($file2)
$text2 = StringReplace(""& $text2 &"", '"', "")
FileCreateShortcut(@ScriptDir& "\" &"GameUP.exe", @DesktopDir &"\"& GUICtrlRead($file5), $text2 &"\"& GUICtrlRead($file3), GUICtrlRead($file1) &"\"& $gamereg & GUICtrlRead($file3) & $gamereg &" "& GUICtrlRead($file2) &"\"& $gamereg & GUICtrlRead($file3) & $gamereg &" "& $gamereg & GUICtrlRead($file4) & $gamereg &" "& $reg &" "& $up, "MyBc辅助更新", $text2 &"\"& GUICtrlRead($file3) &"\"& GUICtrlRead($file4), "", "", "")
$msgyou = "快捷方式生成成功!"
MsgBox (64, "提示!", GUICtrlRead($file5) & $msgyou)

Case $msg = $btn2
IniWrite(@ScriptDir& "\" &"config.ini","config","远程路径基",$gamereg & GUICtrlRead($file1) & $gamereg)
MsgBox (64, "提示!", "远程路径基修改成功!" & @CRLF & "" & @CRLF & "请确定修改路径基后面不带有目录结束符“\”," & @CRLF & "如果路径基目录名带有空格,请增加引号引住空格目录名。")
Case $msg = $btn3
IniWrite(@ScriptDir& "\" &"config.ini","config","本地路径基",$gamereg & GUICtrlRead($file2) & $gamereg)
MsgBox (64, "提示!", "本地路径基修改成功!" & @CRLF & "" & @CRLF & "请确定修改路径基后面不带有目录结束符“\”," & @CRLF & "如果路径基目录名带有空格,请增加引号引住空格目录名。")
Case $msg = $btn4
MsgBox (0, "简要使用说明:", "" & @CRLF & "1、第一次使用先正确设置好自己的远程及本地路径基并确定修改设置健,如果" & @CRLF & "路径基下面的目录只要有带空格的目录名,请使用双引号" & chr(34) & chr(34) & "引住整个有空格名的" & @CRLF & "目录。要注意的是路径基后面不能带目录结束符" & chr(34) &"\" & chr(34) &";" & @CRLF & "" & @CRLF & "2、更新目录名,执行文件名,快捷方式名任何情况下不需要双引号引住;" & @CRLF & "" & @CRLF & "3、在远程路径基下建立一个名为QQ.171270的文件,用于程序识别服务器在线" & @CRLF & "情况同时也对作者唯一劳动的支持。不建立此文件将无法正常使用!正确在远" & @CRLF & "程路径基下建立QQ.171270后可以使用服务器检测来识别正确与否,也可以用于" & @CRLF & "判断服务器在线情况。第一次使用服务器检测必须远程路径基可以访问提前下," & @CRLF & "否则会出现程序处于假死状态30分钟!" & @CRLF & "" & @CRLF & "4、完成对每个游戏的设置后可以使用生成前检测来测试设置结果,最后点生成" & @CRLF & "快捷方式键完成对此游戏的快捷方式生成,生成的文件位置为当前系统用户环" & @CRLF & "境的桌面上。" & @CRLF & "" & @CRLF & "5、正确设置的内网的网管IP地址及MAC物理地址对应关系,这样可以有效的对多" & @CRLF & "数局域网ARP欺诈病毒的防御,也可以防止通过此病毒对游戏账号的盗窃现象。" & @CRLF & "设置后每次启动游戏前,会对内网的网关IP地址到MAC地址的对应绑定。")
Case $msg = $btn5
FileDelete(@systemDir &"\Gameup.exe")
FileDelete(@systemDir &"\cfg.ini")
MsgBox (64, "更新程序修复提示:", "1、更新界面修复成功!" & @CRLF & "" & @CRLF & "2、更新缓存设置修复成功!")
Case $msg = $btn6
$text = GUICtrlRead($file1)
$text = StringReplace(""& $text &"", '"', "")
FileCopy($text &"\QQ.171270", @systemDir &"\QQ.171270")
if FileExists(@systemDir &"\QQ.171270") ="" then
MsgBox (8208, "服务器在线检测结果:", "服务器目前为不能访问状态!" & @CRLF & "" & @CRLF & "可能是因为你没有在远程路径基下建立识别文件:QQ.171270")
Else
MsgBox (64, "服务器在线检测结果:", "服务目前状态器正常!" & @CRLF & "" & @CRLF & "成功检测到识别文件QQ.171270存在!")
endif
FileDelete(@systemDir &"\QQ.171270")
Case $msg = $btn7
if GUICtrlRead($radio_1) <> "4" then
$reg = "Play.reg"
Else
$reg = "不导入"
endif
if GUICtrlRead($radio_2) <> "4" then
$up = "强制更新"
Else
$up = "选择更新"
endif
MsgBox (0, "" & @CRLF & "生成前检测设置结果:", " 游戏远程的目录路径为: "& GUICtrlRead($file1) &"\"& GUICtrlRead($file3) &" " & @CRLF & "" & @CRLF & " 游戏本地目录路径为: "& GUICtrlRead($file2) &"\"& GUICtrlRead($file3) &"" & @CRLF & "" & @CRLF & " 游戏启动程序名为: "& GUICtrlRead($file4) &"" & @CRLF & "" & @CRLF & " 生成桌面快捷方式名: "& GUICtrlRead($file5) &"" & @CRLF & "" & @CRLF & " 游戏启动前导入注册表: "& $reg &"" & @CRLF & "" & @CRLF & " 启动更新方式为: "& $up &"")
Case $msg = $btn8
IniWrite(@ScriptDir& "\" &"config.ini","config","网关IP",""& $gamereg & GUICtrlRead($file6) & $gamereg &"")
MsgBox (64, "提示!", "网关IP地址修改成功!" & @CRLF & "" & @CRLF & "你设置的内网网关IP地址为:"& GUICtrlRead($file6) &"")
Case $msg = $btn9
IniWrite(@ScriptDir& "\" &"config.ini","config","网关MAC",""& $gamereg & GUICtrlRead($file7) & $gamereg &"")
MsgBox (64, "提示!", "网关IP地址修改成功!" & @CRLF & "" & @CRLF & "你设置的内网网关MAC物理地址为:"& GUICtrlRead($file7) &"")
Case $msg = $GUI_EVENT_CLOSE
MsgBox (64, "提示!", "所有战斗在网吧前线的网管们,您们辛苦了!")
ExitLoop
EndSelect
WEnd
EndFunc

Func Run1()
FileDelete(@systemDir &"\cfg.ini")
if FileExists(@systemDir &"\GameUP.exe") = "" then
FileInstall("D:\GameUp\GameUP.exe", @systemDir &"\GameUP.exe",0)
endif
$fl=FileOpen(@systemDir &"\cfg.ini",1)
FileWriteLine($fl, "[更新]")
FileWriteLine($fl, "远程目录="& $Cmdline[1] &"")
FileWriteLine($fl, "本地目录="& $Cmdline[2] &"")
FileWriteLine($fl, "执行文件="& $Cmdline[2] &"\"& $Cmdline[3] &"")
fileclose($fl)
if $Cmdline[4] = "reg_yes" then
runwait("regedit.exe /s "& $gamereg & $Cmdline[2] &"\"& $reg & $gamereg &"", "", @SW_HIDE)
endif
run(@systemDir &"\Gameup.exe","")
FileDelete(@systemDir &"\QQ.171270")
RunAsSet()
exit
EndFunc

Func run2()
if $Cmdline[4] = "reg_yes" then
runwait("regedit.exe /s "& $gamereg & $Cmdline[2] &"\"& $reg & $gamereg &"", "", @SW_HIDE)
endif
Run(@ComSpec & ' /c ' & ""& $Cmdline[2] &"\"& $Cmdline[3] &"", "","")
FileDelete(@systemDir &"\QQ.171270")
if $runname <> "" or $runpass <> "" then
RunAsSet()
endif
exit
EndFunc

Func Guirun()
GUICreate ("是否需要同步更新?",288,56)
$User1=GUICtrlCreateButton ("同步更新", 12, 12, 80,28)
GUICtrlSetFont (1,20, 1000, 3, "")
$User2=GUICtrlCreateButton ( "进入游戏", 102, 12, 80,28)
GUICtrlSetFont (1,20, 1000, 3, "")
$User3=GUICtrlCreateButton ( "退出游戏", 192, 12, 80,28)
GUICtrlSetFont (1,20, 1000, 3, "")
GUISetState(@SW_SHOW)
TrayTip ("更新提示:", " 不使用“同步更新”直接进入," & @CRLF & "可能造成游戏无法正常运行或" & @CRLF & "受到来自病毒、木马的威胁!!!", 6, 0)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $User1
Run1()
Case $msg = $User2
Run2()
Case $msg = $User3
ExitLoop
exit
EndSelect
WEnd
EndFunc

Func Arp()
if $GatewayIP or $GatewayMAC <> "" then
$arp = 'arp -s'
$route = 'route change 0.0.0.0 mask 0.0.0.0'
Runwait(@ComSpec & ' /c ' & 'arp -d', "", @SW_HIDE)
Runwait(@ComSpec & ' /c ' & ""& $arp &" "& $GatewayIP &" "& $GatewayMAC &"", "", @SW_HIDE)
Runwait(@ComSpec & ' /c ' & ""& $route &" "& $GatewayIP &"", "", @SW_HIDE)
endif
EndFunc

Func cuowu()
if FileExists(""& $Cmdline[2] &"\"& $Cmdline[3] &"") ="" then
MsgBox(8208,"出错提示!","游戏执行文件"& $Cmdline[2] &"\"& $Cmdline[3] &"不存在并且远程目录不可访问," & @CRLF & "" & @CRLF & "确认游戏已经从服务器同步到本地游戏目录下。")
exit
endif
EndFunc

Func copy()
if FileExists(""& $Cmdline[2] &"") = "" then
DirCreate (""& $Cmdline[2] &"")
endif
FileCopy($text &"\QQ.171270", @systemDir &"\QQ.171270")
FileCopy(""& $Cmdline[1] &"\"& $reg &"", ""& $Cmdline[2] &"\"& $reg &"")
EndFunc

if $Cmdline[0] < 5 then
Gameupsetup()
Else
if $runname <> "" or $runpass <> "" then
RunAsSet(""& $runname &"", @Computername, ""& $runpass &"")
endif
copy()
Arp()
if FileExists(@systemDir &"\QQ.171270") ="" then
cuowu()
Run2()
endif
if $Cmdline[5] = "+" then
Guirun()
Else
Run1()
endif
endif

标签: 网管之星, 原代码