private bool TryGetGameProcess(LiveSplitState state) { Process possibleProcess = Process.GetProcessesByName("Borderlands3").FirstOrDefault(p => p.MainModule.FileName.Contains("OakGame") && !pidsToIgnore.Contains(p.Id)); // Find a running version of BL3 (proper) without an improper version // If we were unable to find a version of BL3, might as well stop now. if (possibleProcess == null) { settings.SetGameVersion("Not Found"); return(false); } string possibleVersion = VersionHelper.GetProductVersion(possibleProcess.MainModule.FileName); // A string for our currently possible version string possibleStorefront = VersionHelper.GetStorefront(possibleProcess); Debug.WriteLine("Possible Version: " + possibleVersion); MemoryDefinition possibleDef = new MemoryDefinition(possibleVersion, possibleStorefront); settings.SetGameVersion(possibleStorefront + "/" + possibleVersion); settings.SetSupportsLevelSplits(possibleDef.levelSplitsState != null); if (!possibleDef.bKnownVersion || possibleDef == null) { pidsToIgnore.Add(possibleProcess.Id); MessageBox.Show($"Unexpected game version: {possibleVersion} on {possibleStorefront}", "LiveSplit.Borderlands3", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } // Initialize all of our variables since we have a proper game version now. gameProcess = possibleProcess; gameStorefront = possibleStorefront; gameVersion = possibleVersion; versionDefinition = possibleDef; Debug.WriteLine("Base Address: " + possibleProcess.Modules[0].BaseAddress.ToString("X")); state.IsGameTimeInitialized = true; return(true); }