예제 #1
0
파일: Native.cs 프로젝트: Kohadev/IW-GSC
        public bool ConnectToGame(Game.GameId gameId)
        {
            var process = Process.GetProcessesByName(Game.ProcessForGameId(gameId)).FirstOrDefault();

            if (process != null)
            {
                _handle = OpenProcess(0x1f0fff, false, process.Id);
                SetupOffsetsForGameId(gameId);
                return(true);
            }
            return(false);
        }
예제 #2
0
파일: Native.cs 프로젝트: Kohadev/IW-GSC
        private void SetupOffsetsForGameId(Game.GameId gameId)
        {
            switch (gameId)
            {
            case Game.GameId.Ghosts_MP:
            case Game.GameId.Ghosts_Server:
                AssetsPool = FindPattern(0x140001000, 0x145000000, "\x4C\x8D\x05\x00\x00\x00\x00\xF7\xE3",
                                         "xxx????xx");
                var offset = BitConverter.ToUInt32(Read(AssetsPool + 3, 4), 0);
                AssetsPool += offset + 7;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(gameId), gameId, null);
            }
        }