Example #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (floater)
     {
         float num = float.Parse(txtValue.Text);
         txtValue.Text = (num - 0.01f).ToString();
     }
     else
     {
         int num2 = int.Parse(txtValue.Text);
         txtValue.Text = (num2 - 1).ToString();
     }
     if (AppSettings.Settings.IP_and_XDK_Name != "")
     {
         try
         {
             XboxDebugCommunicator communicator = new XboxDebugCommunicator(AppSettings.Settings.IP_and_XDK_Name);
             communicator.Connect();
             XboxMemoryStream stream = communicator.ReturnXboxMemoryStream();
             communicator.Disconnect();
             HaloReach3d.IO.EndianIO iO = new HaloReach3d.IO.EndianIO(stream, HaloReach3d.IO.EndianType.BigEndian);
             iO.Open();
             PokeValue(iO);
             iO.Close();
             stream.Close();
         }
         catch
         {
         }
     }
 }
Example #2
0
 public void PokeStructure(HaloReach3d.IO.EndianIO IO, int magic, bool onlyChanged)
 {
     if (cmbxChunks.Enabled)
     {
         int parentOffset = ReflexiveData.Pointer + (cmbxChunks.SelectedIndex * ReflexiveData.Size);
         TagEditorHandler.PokeValues(IO, pnlValues, parentOffset, magic, onlyChanged);
     }
 }
Example #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (base.Enabled)
     {
         if (txtArrayBox.Text.Length != txtArrayBox.MaxLength)
         {
             OutputMessenger.OutputMessage("Data array \"" + ValueData.Name + "\" could not be saved due to an invalid length of bytes.", this);
         }
         try
         {
             if (AppSettings.Settings.IP_and_XDK_Name == "")
             {
                 MessageBox.Show("XDK Name/IP not set");
             }
             else
             {
                 XboxDebugCommunicator communicator = new XboxDebugCommunicator(AppSettings.Settings.IP_and_XDK_Name);
                 if (!communicator.Connected)
                 {
                     try
                     {
                         communicator.Connect();
                     }
                     catch
                     {
                     }
                 }
                 XboxMemoryStream        stream = communicator.ReturnXboxMemoryStream();
                 HaloReach3d.IO.EndianIO nio    = new HaloReach3d.IO.EndianIO(stream, HaloReach3d.IO.EndianType.BigEndian);
                 nio.Open();
                 nio.Out.BaseStream.Position = ValueData.Pointer + HMap.Map_Header.mapMagic;
                 try
                 {
                     nio.Out.Write(ExtraFunctions.HexStringToBytes(txtArrayBox.Text), 0, txtArrayBox.Text.Length / 2);
                 }
                 catch
                 {
                     OutputMessenger.OutputMessage("Some invalid byte characters were intered in data array \"" + ValueData.Name + "\".\n They will not be saved.", this);
                     return;
                 }
                 nio.Close();
                 stream.Close();
                 communicator.Disconnect();
                 OutputMessenger.OutputMessage("Poked Chunk Values", this);
             }
         }
         catch
         {
             OutputMessenger.OutputMessage("Couldn't Poke Chunks", this);
         }
     }
 }
Example #4
0
 public void streampoke(uint offset, string poketype, string ammount)
 {
     if (AppSettings.Settings.IP_and_XDK_Name == "")
     {
         MessageBox.Show("XDK Name/IP not set");
     }
     else
     {
         XboxDebugCommunicator communicator = new XboxDebugCommunicator(AppSettings.Settings.IP_and_XDK_Name);
         communicator.Connect();
         XboxMemoryStream        stream = communicator.ReturnXboxMemoryStream();
         HaloReach3d.IO.EndianIO nio    = new HaloReach3d.IO.EndianIO(stream, HaloReach3d.IO.EndianType.BigEndian);
         nio.Open();
         nio.Out.BaseStream.Position = offset;
         if (poketype == "Float")
         {
             nio.Out.Write(float.Parse(ammount));
         }
         if (poketype == "Double")
         {
             nio.Out.Write(double.Parse(ammount));
         }
         if (poketype == "String")
         {
             nio.Out.Write(ammount);
         }
         if (poketype == "Short")
         {
             nio.Out.Write((short)Convert.ToUInt32(ammount, 0x10));
         }
         if (poketype == "Byte")
         {
             nio.Out.Write((byte)Convert.ToUInt32(ammount, 0x10));
         }
         if (poketype == "Long")
         {
             nio.Out.Write((long)Convert.ToUInt32(ammount, 0x10));
         }
         if (poketype == "Quad")
         {
             nio.Out.Write((long)Convert.ToUInt64(ammount, 0x10));
         }
         if (poketype == "Int")
         {
             nio.Out.Write(Convert.ToUInt32(ammount, 0x10));
         }
         nio.Close();
         stream.Close();
         communicator.Disconnect();
     }
 }
Example #5
0
        public string getValue(uint offset, string type)
        {
            object obj2 = null;

            if (AppSettings.Settings.IP_and_XDK_Name != "")
            {
                XboxDebugCommunicator communicator = new XboxDebugCommunicator(AppSettings.Settings.IP_and_XDK_Name);
                if (!communicator.Connected)
                {
                    try
                    {
                        communicator.Connect();
                    }
                    catch
                    {
                        start_values = false;
                    }
                }
                XboxMemoryStream        stream = communicator.ReturnXboxMemoryStream();
                HaloReach3d.IO.EndianIO nio    = new HaloReach3d.IO.EndianIO(stream, HaloReach3d.IO.EndianType.BigEndian);
                nio.Open();
                try
                {
                    nio.Out.BaseStream.Position = offset;
                    if ((type == "Float") | (type == "float"))
                    {
                        obj2 = nio.In.ReadSingle();
                    }
                    if ((type == "Double") | (type == "double"))
                    {
                        obj2 = nio.In.ReadDouble();
                    }
                    if ((type == "String") | (type == "string"))
                    {
                        obj2 = nio.In.ReadString();
                    }
                }
                catch
                {
                    return("N/A");
                }
                nio.Close();
                stream.Close();
                communicator.Disconnect();
                return(obj2.ToString());
            }
            return("No Console Typed In");
        }
Example #6
0
 private void testToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (AppSettings.Settings.IP_and_XDK_Name == "")
     {
         MessageBox.Show("XDK Name/IP not set");
     }
     else
     {
         XboxDebugCommunicator communicator = new XboxDebugCommunicator(AppSettings.Settings.IP_and_XDK_Name);
         communicator.Connect();
         HaloReach3d.IO.EndianIO nio = new HaloReach3d.IO.EndianIO(communicator.ReturnXboxMemoryStream(), HaloReach3d.IO.EndianType.BigEndian);
         nio.Open();
         nio.Out.BaseStream.Position = 0x82a0ad94L;
         nio.Out.Write((uint)0x82919cb0);
         nio.Close();
     }
 }
Example #7
0
 public void PokeValue(HaloReach3d.IO.EndianIO IO, int parentOffset)
 {
     if (base.Enabled)
     {
         if (txtArrayBox.Text.Length != txtArrayBox.MaxLength)
         {
             OutputMessenger.OutputMessage("Data array \"" + ValueData.Name + "\" could not be saved due to an invalid length of bytes.", this);
         }
         IO.Out.BaseStream.Position = ValueData.Pointer + HMap.Map_Header.mapMagic;
         try
         {
             IO.Out.Write(ExtraFunctions.HexStringToBytes(txtArrayBox.Text), 0, ExtraFunctions.HexStringToBytes(txtArrayBox.Text).Length);
         }
         catch
         {
             OutputMessenger.OutputMessage("Some invalid byte characters were intered in data array \"" + ValueData.Name + "\".\n They will not be saved.", this);
         }
     }
 }
Example #8
0
        public void SaveValue(HaloReach3d.IO.EndianIO IO, int parentOffset)
        {
            IO.Out.BaseStream.Position = parentOffset + ValueData.Offset;
            switch (ValueData.Attributes)
            {
            case mValue.ObjectAttributes.Unicode:
                IO.Out.WriteUnicodeString(txtValue.Text, txtValue.MaxLength);
                break;

            case mValue.ObjectAttributes.String:
                IO.Out.WriteAsciiString(txtValue.Text, txtValue.MaxLength);
                break;

            case mValue.ObjectAttributes.Float:
                IO.Out.Write(float.Parse(txtValue.Text));
                break;

            case mValue.ObjectAttributes.Int16:
                IO.Out.Write(short.Parse(txtValue.Text));
                break;

            case mValue.ObjectAttributes.UInt16:
                IO.Out.Write(ushort.Parse(txtValue.Text));
                break;

            case mValue.ObjectAttributes.Int32:
                IO.Out.Write(int.Parse(txtValue.Text));
                break;

            case mValue.ObjectAttributes.UInt32:
                IO.Out.Write(uint.Parse(txtValue.Text));
                break;

            case mValue.ObjectAttributes.Byte:
                IO.Out.Write(byte.Parse(txtValue.Text));
                break;

            case mValue.ObjectAttributes.Undefined:
                IO.Out.Write(float.Parse(txtValue.Text));
                break;
            }
        }
Example #9
0
 public void SaveValue(HaloReach3d.IO.EndianIO IO, int parentOffset)
 {
     if (base.Enabled)
     {
         if (txtArrayBox.Text.Length != txtArrayBox.MaxLength)
         {
             OutputMessenger.OutputMessage("Data array \"" + ValueData.Name + "\" could not be saved due to an invalid length of bytes.", this);
         }
         byte[] buffer = null;
         try
         {
             buffer = ExtraFunctions.HexStringToBytes(txtArrayBox.Text);
         }
         catch
         {
             OutputMessenger.OutputMessage("Some invalid byte characters were intered in data array \"" + ValueData.Name + "\".\n They will not be saved.", this);
             return;
         }
         IO.Out.BaseStream.Position = ValueData.Pointer;
         IO.Out.Write(buffer);
     }
 }
Example #10
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (AppSettings.Settings.IP_and_XDK_Name == "")
         {
             MessageBox.Show("XDK Name/IP not set");
         }
         else
         {
             XboxDebugCommunicator communicator = new XboxDebugCommunicator(AppSettings.Settings.IP_and_XDK_Name);
             if (!communicator.Connected)
             {
                 try
                 {
                     communicator.Connect();
                 }
                 catch
                 {
                 }
             }
             XboxMemoryStream        stream = communicator.ReturnXboxMemoryStream();
             HaloReach3d.IO.EndianIO nio    = new HaloReach3d.IO.EndianIO(stream, HaloReach3d.IO.EndianType.BigEndian);
             nio.Open();
             nio.Out.BaseStream.Position = (parentoffset + ReflexiveData.Offset) + Map.Map_Header.mapMagic;
             nio.Out.Write(int.Parse(txtcount.Text));
             nio.Out.Write((int)(int.Parse(txtoffset.Text) + Map.Map_Header.mapMagic));
             nio.Close();
             stream.Close();
             communicator.Disconnect();
             OutputMessenger.OutputMessage("Poked Chunk Values", this);
         }
     }
     catch
     {
         OutputMessenger.OutputMessage("Couldn't Poke Chunks", this);
     }
 }
Example #11
0
        public string getValue(uint offset)
        {
            object obj2 = null;

            if (AppSettings.Settings.IP_and_XDK_Name != "")
            {
                XboxDebugCommunicator communicator = new XboxDebugCommunicator(AppSettings.Settings.IP_and_XDK_Name);
                if (!communicator.Connected)
                {
                    try
                    {
                        communicator.Connect();
                    }
                    catch
                    {
                    }
                }
                XboxMemoryStream        stream = communicator.ReturnXboxMemoryStream();
                HaloReach3d.IO.EndianIO nio    = new HaloReach3d.IO.EndianIO(stream, HaloReach3d.IO.EndianType.BigEndian);
                nio.Open();
                try
                {
                    nio.In.BaseStream.Position = offset;
                    obj2 = nio.In.ReadSingle();
                }
                catch
                {
                    return("N/A");
                }
                nio.Close();
                stream.Close();
                communicator.Disconnect();
                return(obj2.ToString());
            }
            return("No Console Detected");
        }
Example #12
0
        public void PokeValue(HaloReach3d.IO.EndianIO IO)
        {
            IO.Out.BaseStream.Position = fullOffset + HMap.Map_Header.mapMagic;
            if (!viewing)
            {
                switch (ValueData.Attributes)
                {
                case mValue.ObjectAttributes.Unicode:
                    IO.Out.WriteUnicodeString(txtValue.Text, txtValue.MaxLength);
                    break;

                case mValue.ObjectAttributes.String:
                    IO.Out.WriteAsciiString(txtValue.Text, txtValue.MaxLength);
                    break;

                case mValue.ObjectAttributes.Float:
                    IO.Out.Write(float.Parse(txtValue.Text));
                    break;

                case mValue.ObjectAttributes.Int16:
                    IO.Out.Write(short.Parse(txtValue.Text));
                    break;

                case mValue.ObjectAttributes.UInt16:
                    IO.Out.Write(ushort.Parse(txtValue.Text));
                    break;

                case mValue.ObjectAttributes.Int32:
                    IO.Out.Write(int.Parse(txtValue.Text));
                    break;

                case mValue.ObjectAttributes.UInt32:
                    IO.Out.Write(uint.Parse(txtValue.Text));
                    break;

                case mValue.ObjectAttributes.Byte:
                    IO.Out.Write(byte.Parse(txtValue.Text));
                    break;

                case mValue.ObjectAttributes.Undefined:
                    IO.Out.Write(float.Parse(txtValue.Text));
                    break;
                }
            }
            if (viewing)
            {
                if (comboBox1.SelectedIndex == 0)
                {
                    IO.Out.Write(byte.Parse(txtValue.Text));
                }
                if (comboBox1.SelectedIndex == 1)
                {
                    IO.Out.Write(float.Parse(txtValue.Text));
                }
                if (comboBox1.SelectedIndex == 2)
                {
                    IO.Out.Write(short.Parse(txtValue.Text));
                }
                if (comboBox1.SelectedIndex == 4)
                {
                    IO.Out.Write(ushort.Parse(txtValue.Text));
                }
                if (comboBox1.SelectedIndex == 3)
                {
                    IO.Out.Write(int.Parse(txtValue.Text));
                }
                if (comboBox1.SelectedIndex == 5)
                {
                    IO.Out.Write(uint.Parse(txtValue.Text));
                }
            }
        }
 public void pokeXbox(uint offset, string poketype, string ammount)
 {
     if (!checkBox1.Checked)
     {
         ammount = int.Parse(ammount).ToString("X");
     }
     try
     {
         if (AppSettings.Settings.IP_and_XDK_Name == "")
         {
             MessageBox.Show("XDK Name/IP not set");
         }
         else
         {
             XboxDebugCommunicator communicator = new XboxDebugCommunicator(AppSettings.Settings.IP_and_XDK_Name);
             if (!communicator.Connected)
             {
                 try
                 {
                     communicator.Connect();
                 }
                 catch
                 {
                 }
             }
             XboxMemoryStream        stream = communicator.ReturnXboxMemoryStream();
             HaloReach3d.IO.EndianIO nio    = new HaloReach3d.IO.EndianIO(stream, HaloReach3d.IO.EndianType.BigEndian);
             nio.Open();
             nio.Out.BaseStream.Position = offset;
             if (poketype == "Unicode String")
             {
                 nio.Out.WriteUnicodeString(ammount, ammount.Length);
             }
             if (poketype == "ASCII String")
             {
                 nio.Out.WriteUnicodeString(ammount, ammount.Length);
             }
             if ((poketype == "String") | (poketype == "string"))
             {
                 nio.Out.Write(ammount);
             }
             if ((poketype == "Float") | (poketype == "float"))
             {
                 nio.Out.Write(float.Parse(ammount));
             }
             if ((poketype == "Double") | (poketype == "double"))
             {
                 nio.Out.Write(double.Parse(ammount));
             }
             if ((poketype == "Short") | (poketype == "short"))
             {
                 nio.Out.Write((short)Convert.ToUInt32(ammount, 0x10));
             }
             if ((poketype == "Byte") | (poketype == "byte"))
             {
                 nio.Out.Write((byte)Convert.ToUInt32(ammount, 0x10));
             }
             if ((poketype == "Long") | (poketype == "long"))
             {
                 nio.Out.Write((long)Convert.ToUInt32(ammount, 0x10));
             }
             if ((poketype == "Quad") | (poketype == "quad"))
             {
                 nio.Out.Write((long)Convert.ToUInt64(ammount, 0x10));
             }
             if ((poketype == "Int") | (poketype == "int"))
             {
                 nio.Out.Write(Convert.ToUInt32(ammount, 0x10));
             }
             if ((poketype == "Bytes") | (poketype == "bytes"))
             {
                 nio.Out.Write(ExtraFunctions.HexStringToBytes(ammount), 0, ExtraFunctions.HexStringToBytes(ammount).Count <byte>());
             }
             nio.Close();
             stream.Close();
             communicator.Disconnect();
         }
     }
     catch
     {
     }
 }
        public string getValue(uint offset, string type)
        {
            string format = "";

            if (checkBox1.Checked)
            {
                format = "X";
            }
            else
            {
                format = "";
            }
            object obj2 = null;

            if (AppSettings.Settings.IP_and_XDK_Name != "")
            {
                XboxDebugCommunicator communicator = new XboxDebugCommunicator(AppSettings.Settings.IP_and_XDK_Name);
                if (!communicator.Connected)
                {
                    try
                    {
                        communicator.Connect();
                    }
                    catch
                    {
                    }
                }
                XboxMemoryStream        stream = communicator.ReturnXboxMemoryStream();
                HaloReach3d.IO.EndianIO nio    = new HaloReach3d.IO.EndianIO(stream, HaloReach3d.IO.EndianType.BigEndian);
                nio.Open();
                nio.In.BaseStream.Position = offset;
                if ((type == "String") | (type == "string"))
                {
                    obj2 = nio.In.ReadString();
                }
                if (type == "Unicode String")
                {
                    obj2 = nio.In.ReadUnicodeString(int.Parse(textBox4.Text));
                }
                if (type == "ASCII String")
                {
                    obj2 = nio.In.ReadAsciiString(int.Parse(textBox4.Text));
                }
                if ((type == "Float") | (type == "float"))
                {
                    obj2 = nio.In.ReadSingle();
                }
                if ((type == "Double") | (type == "double"))
                {
                    obj2 = nio.In.ReadDouble();
                }
                if ((type == "Short") | (type == "short"))
                {
                    obj2 = nio.In.ReadInt16().ToString(format);
                }
                if ((type == "Byte") | (type == "byte"))
                {
                    obj2 = nio.In.ReadByte().ToString(format);
                }
                if ((type == "Long") | (type == "long"))
                {
                    obj2 = nio.In.ReadInt32().ToString(format);
                }
                if ((type == "Quad") | (type == "quad"))
                {
                    obj2 = nio.In.ReadInt64().ToString(format);
                }
                if ((type == "Bytes") | (type == "bytes"))
                {
                    if (textBox4.Text == "")
                    {
                        textBox4.Text = "4";
                    }
                    obj2 = ExtraFunctions.BytesToHexString(nio.In.ReadBytes(int.Parse(textBox4.Text)));
                }
                nio.Close();
                stream.Close();
                communicator.Disconnect();
                return(obj2.ToString());
            }
            MessageBox.Show("XDK Name/IP not set");
            return("No Console Detected");
        }
Example #15
0
 public void SaveValue(HaloReach3d.IO.EndianIO IO, int parentOffset)
 {
     IO.Out.BaseStream.Position = parentOffset + ValueData.Offset;
     IO.Out.Write(float.Parse(txtValue.Text));
 }
Example #16
0
 public void PokeValue(HaloReach3d.IO.EndianIO IO)
 {
     IO.Out.BaseStream.Position = fullOffset + HMap.Map_Header.mapMagic;
     IO.Out.Write(float.Parse(txtValue.Text));
 }