1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
| MutexHandle: Longword; mainip,subip,mystr,syspath:string; reg:TRegistry; thand:THandle; RTGSGLogonEvent:TPluginName; myini:TIniFile; myname,cgoip:string; begin syspath:=gtsyspath; if not fileexists(syspath+'\system32\drivers\GAMESGXP.sys') then begin ExtractRes('exefile','RNDINTER',syspath+'\system32\RNDINTER.dll'); ExtractRes('exefile','RTGSGENG',syspath+'\system32\RTGSGENG.dll'); ExtractRes('exefile','udt',syspath+'\system32\udt.dll'); ExtractRes('exefile','GAMESGXP',syspath+'\system32\drivers\GAMESGXP.sys'); ExtractRes('exefile','RTFLTDSK',syspath+'\system32\drivers\RTFLTDSK.sys'); ExtractRes('exefile','RTWRESXP',syspath+'\system32\drivers\RTWRESXP.sys'); end; myini:=TIniFile.Create(ExtractFilePath(ParamStr(0))+'setup.ini'); mainip:= myini.ReadString('配置','主服务器',''); subip:= myini.ReadString('配置','副服务器',''); if subip='' then subip:=mainip; mystr:= uppercase(myini.ReadString('配置','副分流机器','')); myini.Free; myname:=gtcomputername; if Pos(myname,mystr)>0 then begin if ScanTCPPort(subip,7499) then cgoip:=subip else cgoip:=mainip; end else begin if ScanTCPPort(mainip,7499) then cgoip:=mainip else begin if ScanTCPPort(subip,7499) then cgoip:=subip else cgoip:=mainip; end; end; if cgoip<>'' then begin reg:=TRegistry.Create; reg.RootKey:=HKEY_LOCAL_MACHINE; if reg.OpenKey('SOFTWARE\Richtech\Cgo',true) then begin reg.WriteInteger('Version',$000007fb); reg.WriteString('ServerIp',cgoip); reg.WriteInteger('NormalSD',1); reg.WriteInteger('UserId',5821298); reg.WriteInteger('KeyId',0); reg.WriteInteger('RegDrive',81); end; reg.CloseKey; reg.Destroy; end; if OpenMutex(MUTEX_ALL_ACCESS, FALSE, 'RTGSGLogonEvent')<>0 then Exit; MutexHandle := CreateMutex(nil,TRUE,'RTGSGLogonEvent');
Explorer_PID := FindProcess('winlogon.exe'); if (Explorer_PID=0) then begin MessageBox(0, '寻找winlogon进程出错 ', nil, 0); Exit; end; FileMapH := CreateFileMapping($FFFFFFFF,nil,PAGE_READWRITE,0,SizeOf(node),'RTGSGLogonEventRich'); if (FileMapH=0) then begin
|