public bool Attach() { Process[] process_matches = Process.GetProcessesByName(process_name); if (process_matches.Length == 0) return false; process = process_matches[0]; return true; }