/* * /// <summary> * /// 全图功能 * /// </summary> * private enum functionName * { * BigmapRemoveMist, //大地图去迷雾 * BigmapShowUnit, //大地图显示单位 * BigmapShowInvisible,//大地图显示隐身 * BigmapAnalysisUnit, //大地图分辨幻象 * BigmapShowHierogram,//大地图显示神符 * SmallmapRemoveMist, //小地图去迷雾 * SmallmapShowUnit, //小地图显示单位 * SmallmapShowInvisible//小地图显示隐身 * // ShowEnemySign, //显示敌军信号(取消) * // AllowBusiness //允许交易(取消) * // ShowSkills //显示技能(取消) * } * /// <summary> * /// 偏移信息 * /// </summary> * public struct OffSet * { * public uint MemAdd; * public byte[] Data; * public byte[] Data2; * } * private Dictionary<functionName, OffSet> DetialOffset;*/ #endregion /// <summary> /// /// </summary> /// <param name="version">游戏版本</param> /// <param name="opionts">全图功能</param> public GameHack(AppVersion version, GameHelper gameHelper, bool[] opionts) { this.m_appVersion = version; this.m_gameHelper = gameHelper; GameHelper.ModuleInfo[] miArray = gameHelper.GetEntryPoint(); m_mapHackOptions = new bool[opionts.Length]; for (int i = 0; i < opionts.Length; i++) { m_mapHackOptions[i] = opionts[i]; } foreach (GameHelper.ModuleInfo mi in miArray) { if (mi.ModuleName.ToString().LastIndexOf("Game.dll") > 0) { m_modulePath = mi.ModuleName.ToString(); m_moduleAddress = mi.Address.ToUInt64(); Open(); break; } } }
private void OpenMapHack() { string modulePath = null; ulong moudlueAddress = 0; GameHack.AppVersion gameVersion; while (true) { Process[] gameProcess = Process.GetProcessesByName("War3"); Thread.Sleep(3000); if (gameProcess.Length == 1) { // try { m_gH = new Tools.Tools.GameHelper(); m_gH.ReadProcess = gameProcess[0]; GameHack gameHack; Tools.Tools.GameHelper.ModuleInfo[] moduleInfos = m_gH.GetEntryPoint(); foreach (Tools.Tools.GameHelper.ModuleInfo mi in moduleInfos) { if (mi.ModuleName.ToString().LastIndexOf("Game.dll") > 0) { modulePath = mi.ModuleName.ToString(); moudlueAddress = mi.Address.ToUInt64(); } } FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(modulePath); switch (fvi.FileVersion) { case "1, 20, 4, 6074": { gameVersion = GameHack.AppVersion.Ver_1_20E; gameHack = new GameHack(GameHack.AppVersion.Ver_1_20E, m_gH, m_mapHackOptions); break; } case "1, 24, 1, 6374": { gameVersion = GameHack.AppVersion.Ver_1_24B; gameHack = new GameHack(GameHack.AppVersion.Ver_1_24B, m_gH, m_mapHackOptions); break; } case "1, 24, 4, 6387": { gameVersion = GameHack.AppVersion.Ver_1_24E; gameHack = new GameHack(GameHack.AppVersion.Ver_1_24E, m_gH, m_mapHackOptions); break; } case "1, 25, 1, 6397": { gameVersion = GameHack.AppVersion.Ver_1_25B; gameHack = new GameHack(GameHack.AppVersion.Ver_1_25B, m_gH, m_mapHackOptions); break; } case "1, 26, 0, 6401": { gameVersion = GameHack.AppVersion.Ver_1_26B; gameHack = new GameHack(GameHack.AppVersion.Ver_1_26B, m_gH, m_mapHackOptions); break; } default: { throw new Exception("Version not found!"); } } SoundPlayer openSoundPlayer = new SoundPlayer(Properties.Resources.RGodLike); openSoundPlayer.Play(); Thread.Sleep(1000); this.Invoke(new m_closeFormDelegate(CloseForm)); break; } // catch (Exception e) //{ //MessageBox.Show(e.StackTrace); //this.Invoke(new m_closeFormDelegate(CloseForm)); //this.Close(); //} } Thread.Sleep(1000); } }
private void button2_Click(object sender, EventArgs e) { Process battleClientTask = Process.GetProcessesByName("11Game")[0]; if (battleClientTask == null) { MessageBox.Show("Task not found"); return; } else { m_battleClientGH = new Tools.Tools.GameHelper(); string name = null; byte[] bys = Encoding.Unicode.GetBytes(textBox1.Text); foreach (byte b in bys) { name += b.ToString() + " "; } Clipboard.SetText(name.Trim()); if (bys.Length > 26) //!=5 { textBox1.Text = ""; MessageBox.Show("长度太长"); return; } else { name = textBox1.Text; m_battleClientGH.ReadProcess = battleClientTask; Tools.Tools.GameHelper.ModuleInfo[] moduleArray = m_battleClientGH.GetEntryPoint(); m_gameModuleAddress = (int)moduleArray[0].Address; foreach (Tools.Tools.GameHelper.ModuleInfo mi in moduleArray) { if (mi.ModuleName.ToString().ToUpper().Contains("11SSO.DLL")) { two = (int)mi.Address; } if (mi.ModuleName.ToString().ToUpper().Contains("11SSO_TRD.DLL")) { three = (int)mi.Address; } if (mi.ModuleName.ToString().ToUpper().Contains("ASSOCKET.DLL")) { four = (int)mi.Address; } } byte[] unicodeName = Encoding.Unicode.GetBytes(name); BattleClientClearNameMemory(); for (int i = 0; i < BATTLECLIENTNAMEOFFSETLIST.Length; i++) { for (int j = 0; j < unicodeName.Length; j++) { m_battleClientGH.WriteByte(m_gameModuleAddress + BATTLECLIENTNAMEOFFSETLIST[i] + j, unicodeName[j]); } } for (int i = 0; i < ISSO_OFFSETLIST.Length; i++) { for (int j = 0; j < unicodeName.Length; j++) { m_battleClientGH.WriteByte(two + BATTLECLIENTNAMEOFFSETLIST[i] + j, unicodeName[j]); } } for (int i = 0; i < SSS_TRD_OFFSETLIST.Length; i++) { for (int j = 0; j < unicodeName.Length; j++) { m_battleClientGH.WriteByte(three + BATTLECLIENTNAMEOFFSETLIST[i] + j, unicodeName[j]); } } for (int i = 0; i < ASSOCKET_OFFSETLIST.Length; i++) { for (int j = 0; j < unicodeName.Length; j++) { m_battleClientGH.WriteByte(four + BATTLECLIENTNAMEOFFSETLIST[i] + j, unicodeName[j]); } } MessageBox.Show(" 修改完成"); } } }