示例#1
0
        public override void CreateChildren()
        {
            // This function will fill the following value(s):
            //      _newChildrenArgs.ThisGame
            //      _newChildrenArgs.ThisGameMemory
            War3Common.GetGameMemory(
                _gameContext,
                ref _newChildrenArgs);

            base.CreateChild(TrainerNodeType.Introduction, NodeIndex);
            base.CreateChild(TrainerNodeType.Cash, NodeIndex);
            base.CreateChild(TrainerNodeType.AllSelectedUnits, NodeIndex);
        }
示例#2
0
        /************************************************************************/
        /* Debug                                                                */
        /************************************************************************/
        private void menuDebug1_Click(object sender, EventArgs e)
        {
            string strIndex = Microsoft.VisualBasic.Interaction.InputBox(
                "nIndex = 0x?",
                "War3Common.ReadFromGameMemory(nIndex)",
                "0", -1, -1);

            if (String.IsNullOrEmpty(strIndex))
            {
                return;
            }

            Int32 nIndex;

            if (!Int32.TryParse(
                    strIndex,
                    System.Globalization.NumberStyles.HexNumber,
                    System.Globalization.NumberFormatInfo.InvariantInfo,
                    out nIndex))
            {
                nIndex = 0;
            }

            try
            {
                UInt32 result = 0;
                using (WindowsApi.ProcessMemory mem = new WindowsApi.ProcessMemory(_currentGameContext.ProcessId))
                {
                    NewChildrenEventArgs args = new NewChildrenEventArgs();
                    War3Common.GetGameMemory(
                        _currentGameContext, ref args);
                    result = War3Common.ReadFromGameMemory(
                        mem, _currentGameContext, args,
                        nIndex);
                }
                MessageBox.Show(
                    "0x" + result.ToString("X"),
                    "War3Common.ReadFromGameMemory(0x" + strIndex + ")");
            }
            catch (WindowsApi.BadProcessIdException ex)
            {
                ReportProcessIdFailure(ex.ProcessId);
            }
        }