コード例 #1
0
        private static void FindGame()
        {
            while (true)
            {
                switch (ThreadState)
                {
                case State.FindGame:
                    string         error;
                    FindGameResult result = MemoryEditor.FindGame("League of Legends (TM) Client", out error);
                    //MemoryEditor.Context context = MemoryEditor.GetThreadContext();
                    if (result == FindGameResult.GameFound)
                    {
                        ThreadState = State.LoadWads;
                    }
                    break;

                case State.LoadWads:
                    uint addr;
                    if (MemoryEditor.FindPattern(@"\xE8\x00\x00\x00\x00\x8B\x4C\x24\x2C\x8A\xD8\x85\xC9",
                                                 "x????xxxxxxxx", out addr))
                    {
                        uint thisFunc;
                        MemoryEditor.FindPatternReverse(@"\x81\xEC\x3C\x01\x00\x00\xA1", "xxxxxxx", (IntPtr)addr, out thisFunc);
                        uint ECDSA;
                        MemoryEditor.FindPattern(@"\xE8\x00\x00\x00\x00\x84\xC0\x75\x34\x8D\x84\x24\x00\x00\x00\x00", @"x????xxxxxxx????",
                                                 out ECDSA);
                        int offset;
                        MemoryEditor.ReadInt((IntPtr)ECDSA + 1, out offset);
                        ECDSA = (uint)(ECDSA + offset + 5);
                        int callOffset = (int)addr - (int)thisFunc;
                        MemoryEditor.ReadInt((IntPtr)addr + 1, out offset);
                        addr = (uint)(addr + offset + 5);
                        LoadWadFiles((IntPtr)thisFunc, callOffset, (IntPtr)addr, (IntPtr)ECDSA);
                        ThreadState = State.WaitForNewGame;
                    }
                    break;
                }
                Thread.Sleep(1);
            }
        }
コード例 #2
0
        private void ScanForGame()
        {
            while (running)
            {
                Thread.Sleep(1000);
                String error;
                //Find LeagueClient:
                FindGameResult findGameResult = _leagueClientMemoryEditor.FindGame("LeagueClientUx", out error, false);
                if (findGameResult != FindGameResult.GameFound)
                {
                    OnErrorCallback("League Client Not Open");
                    continue;
                }

                //Get Command Line for Password & Port
                String   Password    = "";
                Int32    Port        = 0;
                String   commandLine = _leagueClientMemoryEditor.GetCommandLine();
                String[] commands    = commandLine.Split(' ');
                foreach (String command in commands)
                {
                    if (command.Contains("--remoting-auth-token="))
                    {
                        Password = command.Replace("\"", "").Replace("--remoting-auth-token=", "");
                    }
                    else if (command.Contains("--app-port="))
                    {
                        Port = Convert.ToInt32(command.Replace("\"", "").Replace("--app-port=", ""));
                    }
                }

                //Check to see if the user is logged in
                if (!APIRequest.Instance.Setup("riot", Password, Port))
                {
                    OnErrorCallback("Not Logged In");
                    continue;
                }

                //Find the LeagueClient for remote calling
                findGameResult = _leagueClientMemoryEditor.FindGame("LeagueClient", out error, false);
                _leagueClientMemoryEditor.ProcessExitedHandler += OnProcessClosed;
                if (findGameResult != FindGameResult.GameFound)
                {
                    continue;
                }

                String region;
                if (PlatformConfig.GetConfigSetting("LoginDataPacket", "platformId", out region))
                {
                    _remoteLoLReplays = new RemoteLoLReplays(region);
                    OnLoginCallback();
                    running = false;
                }
                else
                {
                    //Actually check to see if they're logged in

                    /*Login.Session session;
                     * if(!Login.GetSession(out session))
                     *  OnErrorCallback("Error Requesting PlatformID");*/
                    OnErrorCallback("Logging In");
                }
            }
        }