public bool IsGameRunning() { Process[] process = Process.GetProcessesByName(ExeName); if (process.Length > 0) { string process_path = process[0].MainModule.FileName; FileInfo FileInfo = new FileInfo(process_path); if (FileInfo.Length == 60218776) { GAME_VERSION = GAME_VERSION_DETECTED.SOCIALCLUB; } else { GAME_VERSION = GAME_VERSION_DETECTED.STEAM; } if (GAME_VERSION == GAME_VERSION_DETECTED.SOCIALCLUB) { WorldPTR = WorldPTR_SOCIALCLUB; AmmoPTR = AmmoPTR_SOCIALCLUB; ClipPTR = ClipPTR_SOCIALCLUB; BlipPTR = BlipPTR_SOCIALCLUB; PointerAddressA = PointerAddressA_SOCIALCLUB; } else { WorldPTR = WorldPTR_STEAM; AmmoPTR = AmmoPTR_STEAM; ClipPTR = ClipPTR_STEAM; BlipPTR = BlipPTR_STEAM; PointerAddressA = PointerAddressA_STEAM; } return(true); } else { MessageBox.Show("错误 : 你需要先启动 " + ExeName, "错误!", MessageBoxButton.OK, MessageBoxImage.Warning); return(false); } }
public bool IsGameRunning() { Process[] process = Process.GetProcessesByName(ExeName); if (process.Length > 0) { string process_path = process[0].MainModule.FileName; FileInfo FileInfo = new FileInfo(process_path); if (FileInfo.Length == 60218776) { GAME_VERSION = GAME_VERSION_DETECTED.SOCIALCLUB; } else { GAME_VERSION = GAME_VERSION_DETECTED.STEAM; } if (GAME_VERSION == GAME_VERSION_DETECTED.SOCIALCLUB) { WorldPTR = WorldPTR_SOCIALCLUB; AmmoPTR = AmmoPTR_SOCIALCLUB; ClipPTR = ClipPTR_SOCIALCLUB; BlipPTR = BlipPTR_SOCIALCLUB; } else { WorldPTR = WorldPTR_STEAM; AmmoPTR = AmmoPTR_STEAM; ClipPTR = ClipPTR_STEAM; BlipPTR = BlipPTR_STEAM; } return(true); } else { MessageBox.Show("ERROR : You need to launch " + ExeName, "ERROR"); return(false); } }