Example #1
0
 /// <summary>
 /// Performs a cold reboot of the system
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void tsbtnDebugReset_DoubleClick(object sender, System.EventArgs e)
 {
     if (RTH_Imports.IsConnected)
     {
         RTH_Imports.Reboot(RTH_Imports.BootFlag.cold);
     }
 }
Example #2
0
        /// <summary>
        /// The poke.
        /// </summary>
        public void Poke()
        {
            uint Address = (uint)(this.offsetInMap + map.SelectedMeta.magic);

            this.FindByNameAndTagType();
            RTH_Imports.Poke(Address, (uint)this.identInt32, 32);
        }
Example #3
0
        private void tsbtnDebugConnect_Click(object sender, EventArgs e)
        {
            tslblDebugStatus.Text = "[Attempting to connect...]";
            System.Windows.Forms.Application.DoEvents();

            switch (RTH_Imports.InitRTH(tstbDebugIP.Text))
            {
            case RTH_Imports.debugType.RthDLL:
            case RTH_Imports.debugType.YeloDebug:
                tstbDebugIP.Text             = RTH_Imports.DebugIP;
                tslblDebugStatus.Text        = "[Connected: " + RTH_Imports.DebugName + "]";
                tsbtnDebugConnect.Enabled    = false;
                tsbtnDebugDisconnect.Enabled = true;
                tsbtnDebugLoadMap.Enabled    = true;
                timerDebug.Enabled           = true;
                tsbtnDebugReset.Enabled      = true;
                break;

            case RTH_Imports.debugType.None:
                tslblDebugStatus.Text        = "[Not Connected]";
                tsbtnDebugConnect.Enabled    = true;
                tsbtnDebugDisconnect.Enabled = false;
                tsbtnDebugLoadMap.Enabled    = false;
                tsbtnDebugReset.Enabled      = false;
                break;
            }
        }
Example #4
0
        /// <summary>
        /// The poke.
        /// </summary>
        public void Poke()
        {
            uint Address = (uint)(this.offsetInMap + map.SelectedMeta.magic);

            switch (this.bitCount)
            {
            case 8:
            {
                RTH_Imports.Poke(Address, Convert.ToByte(this.value), 8);
                break;
            }

            case 16:
            {
                RTH_Imports.Poke(Address, (uint)Convert.ToInt16(this.value), 16);
                break;
            }

            case 32:
            {
                RTH_Imports.Poke(Address, (uint)Convert.ToInt32(this.value), 32);
                break;
            }
            }
        }
Example #5
0
        private void tsbtnDebugLoadMap_Click(object sender, EventArgs e)
        {
            if (!RTH_Imports.IsConnected)
            {
                return;
            }

            uint   HeaderAddress = 0x547700;
            string connectInfo   = tslblDebugStatus.Text;

            try
            {
                tslblDebugStatus.Text = "[Loading Debug Map...]";
                byte[] data = new byte[2048];
                data = (byte[])RTH_Imports.Peek(HeaderAddress, (uint)data.Length);

                MapHeader LoadedMap = new MapHeader(data);

                string[] filePaths = Directory.GetFiles(Globals.Prefs.pathMapsFolder, "*.map");

                tslblDebugStatus.Text = "[Comparing Maps...]";
                foreach (string filename in filePaths)
                {
                    // Load file and read header
                    FileStream fs         = new FileStream(filename, FileMode.Open);
                    byte[]     headerData = new byte[2048];
                    fs.Read(headerData, 0, 2048);
                    fs.Close();
                    // Compare file to debug header
                    if (LoadedMap.Compare(new MapHeader(headerData)) == 0)
                    {
                        // Found our MAP!! YES!! Load It!!
                        TryLoadMapForm(filename);
                        return;
                    }
                }
                System.Windows.Forms.MessageBox.Show("No matching map found!" +
                                                     "\nType: " + LoadedMap.MapType +
                                                     "\nName: " + LoadedMap.MapName +
                                                     "\nScenario Name: " + LoadedMap.ScenarioName);
            }
            catch (Exception ex)
            {
                if (ex.Message == "No xbox processes loaded.")
                {
                    Globals.Global.ShowErrorMsg("Halo 2 not loaded", ex);
                }
                else
                {
                    Globals.Global.ShowErrorMsg("Load map failed!", ex);
                }
            }
            finally
            {
                tslblDebugStatus.Text = connectInfo;
            }
        }
Example #6
0
 private void tsbtnDebugDisconnect_Click(object sender, EventArgs e)
 {
     RTH_Imports.DeInitRTH();
     tslblDebugStatus.Text        = "[Not Connected]";
     tsbtnDebugConnect.Enabled    = true;
     tsbtnDebugDisconnect.Enabled = false;
     tsbtnDebugLoadMap.Enabled    = false;
     timerDebug.Enabled           = false;
 }
Example #7
0
 private void timerDebug_Tick(object sender, EventArgs e)
 {
     if (!RTH_Imports.Ping(1600))
     {
         tslblDebugStatus.Text        = "[Not Connected]";
         tsbtnDebugConnect.Enabled    = true;
         tsbtnDebugDisconnect.Enabled = false;
         tsbtnDebugLoadMap.Enabled    = false;
     }
 }
Example #8
0
        /// <summary>
        /// The poke.
        /// </summary>
        public void Poke()
        {
            uint Address = (uint)(this.offsetInMap + map.SelectedMeta.magic);

            switch (ValueType)
            {
            case IFPIO.ObjectEnum.Short:
            {
                RTH_Imports.Poke(Address, (uint)Convert.ToInt16(this.Value), 16);
                break;
            }

            case IFPIO.ObjectEnum.Int:
            {
                RTH_Imports.Poke(Address, (uint)Convert.ToInt32(this.Value), 32);
                break;
            }

            case IFPIO.ObjectEnum.UShort:
            {
                RTH_Imports.Poke(Address, Convert.ToUInt16(this.Value), 16);
                break;
            }

            case IFPIO.ObjectEnum.UInt:
            {
                RTH_Imports.Poke(Address, Convert.ToUInt32(this.Value), 32);
                break;
            }

            case IFPIO.ObjectEnum.Float:
            {
                uint val = Convert.ToUInt32(Convert.ToSingle(this.Value));
                RTH_Imports.Poke(Address, val, 32);
                break;
            }

            case IFPIO.ObjectEnum.Unknown:
            {
                RTH_Imports.Poke(Address, RTH_Imports.ConvertFloat(Convert.ToSingle(this.Value)), 32);
                break;
            }

            case IFPIO.ObjectEnum.Byte:
            {
                RTH_Imports.Poke(Address, Convert.ToByte(this.Value), 8);
                break;
            }
            }
        }
Example #9
0
        public void Poke()
        {
            uint Address = (uint)(this.offsetInMap + map.SelectedMeta.magic);

            try
            {
                uint StringID = (uint)(((ushort)this.sidIndexer) | ((byte)map.Strings.Length[this.sidIndexer] << 24));
                RTH_Imports.Poke(Address, StringID, 32);
            }
            catch
            {
                MessageBox.Show("Net: Something is wrong with this Sid " + this.EntName + " Offset " + this.chunkOffset.ToString());
            }
        }
Example #10
0
        /// <summary>
        /// The poke.
        /// </summary>
        public void Poke()
        {
            uint Address = (uint)(this.offsetInMap + map.SelectedMeta.magic);

            try
            {
                uint StringID =
                    (uint)(((ushort)this.sidIndexer) | ((byte)map.Strings.Length[this.sidIndexer] << 24));
                RTH_Imports.Poke(Address, StringID, 32);
            }
            catch (Exception ex)
            {
                Global.ShowErrorMsg(
                    "Net: Something is wrong with this Sid " + this.EntName + " Offset " + this.chunkOffset, ex);
            }
        }
Example #11
0
        /// <summary>
        /// The poke.
        /// </summary>
        public void Poke()
        {
            if (this.isNulledOutReflexive)
            {
                return;
            }

            string tempstring1 = this.comboBox1.Text;

            if (tempstring1.Contains(" Is Invalid. On Line ") || tempstring1.Contains("Something is wrong with this ") ||
                tempstring1.Contains(" : Value is Too Small To Be An Index") ||
                tempstring1.Contains(" : Value is Too Large To Be The Indexer"))
            {
                return;
            }

            if (tempstring1 == "nulled")
            {
                this.Value = -1;
            }

            if (tempstring1.Contains(" : "))
            {
                int counter;
                for (counter = 0; counter < tempstring1.Length; counter++)
                {
                    if (tempstring1[counter] == ' ')
                    {
                        break;
                    }
                }

                this.Value = Convert.ToInt32(tempstring1.Substring(0, counter));
            }

            uint Address = (uint)(this.offsetInMap + map.SelectedMeta.magic);

            switch (ValueType)
            {
            case IFPIO.ObjectEnum.Short:
            {
                RTH_Imports.Poke(Address, (uint)Convert.ToInt16(this.Value), 16);
                break;
            }

            case IFPIO.ObjectEnum.Int:
            {
                RTH_Imports.Poke(Address, (uint)Convert.ToInt32(this.Value), 32);
                break;
            }

            case IFPIO.ObjectEnum.UShort:
            {
                RTH_Imports.Poke(Address, Convert.ToUInt16(this.Value), 16);
                break;
            }

            case IFPIO.ObjectEnum.UInt:
            {
                RTH_Imports.Poke(Address, Convert.ToUInt32(this.Value), 32);
                break;
            }

            case IFPIO.ObjectEnum.Float:
            {
                RTH_Imports.Poke(Address, RTH_Imports.ConvertFloat(Convert.ToSingle(this.Value)), 32);
                break;
            }

            case IFPIO.ObjectEnum.Unknown:
            {
                RTH_Imports.Poke(Address, RTH_Imports.ConvertFloat(Convert.ToSingle(this.Value)), 32);
                break;
            }

            case IFPIO.ObjectEnum.Byte:
            {
                RTH_Imports.Poke(Address, Convert.ToByte(this.Value), 8);
                break;
            }
            }
        }