public void AttachToGame() { // Find the game process gameProcess = Process.GetProcessesByName("GameOfThronesWinterIsComing").FirstOrDefault(); if (gameProcess != null) { Console.WriteLine("Attached to game process."); } else { Console.WriteLine("Could not find game process."); } }