示例#1
0
        public static void PokeRTHData(RTHData RTH_Data)
        {
            //If our XDKName is set
            if (AppSettings.Settings.XDKName == "")
            {
                throw new Exception(
                          "The Xbox Development Kit could not be connected to because it's means of connection were not set.");
            }
            //Initialize our XDC360
            XboxDebugCommunicator xdc = new XboxDebugCommunicator(AppSettings.Settings.XDKName);

            //Connect
            xdc.Connect();
            //Get our Xbox Memory Stream
            XboxMemoryStream xbms = xdc.ReturnXboxMemoryStream();
            //Initialize our Endian IO
            EndianIO IO = new EndianIO(xbms, EndianType.BigEndian);

            //Open our IO
            IO.Open();
            //Loop through every RTH Data Block
            for (int index = 0; index < RTH_Data.RTH_Data_Blocks.Count; index++)
            {
                //Go to that RTH Data Block's memory offset
                IO.Out.BaseStream.Position = RTH_Data.RTH_Data_Blocks[index].Memory_Offset;
                //Write our data
                IO.Out.Write(RTH_Data.RTH_Data_Blocks[index].Data_Block);
            }
            //Close our IO
            IO.Close();
            //Close our Xbox Memory Stream
            xbms.Close();
            //Disconnect from our Xbox Development Kit
            xdc.Disconnect();
        }
示例#2
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
         {
         }
     }
 }
示例#3
0
        public string getValue(uint offset, string type)
        {
            string hex = "X";
            object rn  = null;
            XboxDebugCommunicator Xbox_Debug_Communicator = new XboxDebugCommunicator(new XboxManager().DefaultConsole);

            //Connect
            if (Xbox_Debug_Communicator.Connected == false)
            {
                try
                {
                    Xbox_Debug_Communicator.Connect();
                }
                catch { }
            }

            XboxMemoryStream xbms = Xbox_Debug_Communicator.ReturnXboxMemoryStream();

            //Endian IO
            HaloReach3d.IO.EndianIO IO = new HaloReach3d.IO.EndianIO(xbms,
                                                                     HaloReach3d.IO.EndianType.BigEndian);
            IO.Open();
            IO.In.BaseStream.Position = offset;

            if (type == "String" | type == "string")
            {
                rn = IO.In.ReadString();
            }
            if (type == "Float" | type == "float")
            {
                rn = IO.In.ReadSingle();
            }
            if (type == "Double" | type == "double")
            {
                rn = IO.In.ReadDouble();
            }
            if (type == "Short" | type == "short")
            {
                rn = IO.In.ReadInt16().ToString(hex);
            }
            if (type == "Byte" | type == "byte")
            {
                rn = IO.In.ReadByte().ToString(hex);
            }
            if (type == "Long" | type == "long")
            {
                rn = IO.In.ReadInt32().ToString(hex);
            }
            if (type == "Quad" | type == "quad")
            {
                rn = IO.In.ReadInt64().ToString(hex);
            }

            IO.Close();
            xbms.Close();
            Xbox_Debug_Communicator.Disconnect();

            return(rn.ToString());
        }
示例#4
0
        /// <summary>
        /// Create a new instance of the XBDM Communicator
        /// </summary>
        /// <param name="deviceIdent">The Name of IP of the XBox Console running xbdm.</param>
        /// <param name="openConnection">Open a connection to the XBox Console</param>
        public Xbdm(string deviceIdent, bool openConnection = false)
        {
            DeviceIdent = deviceIdent;
            _xboxMemoryStream = new XboxMemoryStream(this);

            if (openConnection)
                Connect();
        }
示例#5
0
        private void ChangeHaloODSTFillMode()
        {
            //If the user didnt set the XDK name.
            if (AppSettings.Settings.XDKName == "")
            {
                //Show our error.
                MessageBox.Show(
                    "The Xbox Development Kit could not be connected to because it's means of connection were not set.");

                //Stop processing code in this stub.
                return;
            }

            //Initialize our Xbox Debug Communicator, with our XDK name/IP.
            XboxDebugCommunicator xdc = new XboxDebugCommunicator(AppSettings.Settings.XDKName);

            //Connect to our Xbox Debug Communicator.
            xdc.Connect();

            //Create an Xbox Memory Stream.
            XboxMemoryStream xbms = xdc.ReturnXboxMemoryStream();

            //Create an endian IO for our Memory Stream.
            EndianIO IO = new EndianIO(xbms, EndianType.BigEndian);

            //Open our IO.
            IO.Open();

            //Go to the address of the fillmode.
            IO.SeekTo(0x821A8C60);

            //If our solid item is checked.
            if (menuButtonItem32.Checked)
            {
                //Write our solid value.
                IO.Out.Write(0x38800000);
            }

            //Otherwise if our Point item is checked.
            else if (menuButtonItem33.Checked)
            {
                //Write our point value.
                IO.Out.Write(0x38800001);
            }

            //Otherwise if our Wireframe item is checked.
            else if (menuButtonItem34.Checked)
            {
                //Write our wireframe value.
                IO.Out.Write(0x38800025);
            }

            //Close our IO.
            IO.Close();

            //Disconnect from our Xbox.
            xdc.Disconnect();
        }
        private void buttonX9_Click(object sender, EventArgs e)
        {
            //If the Xbox_Debug_Communicator isn't null
            if (Xbox_Debug_Communicator != null)
            {
                //If it is connected..
                if (Xbox_Debug_Communicator.Connected)
                {
                    //Get our memory stream.
                    XboxMemoryStream xms = Xbox_Debug_Communicator.ReturnXboxMemoryStream();

                    //Create our IO
                    EndianIO IO = new EndianIO(xms, EndianType.BigEndian);

                    //Open our IO
                    IO.Open();

                    //Go to our offset
                    IO.In.BaseStream.Position = 0x3A00C000 + 0x1A874;

                    //Read our macbin
                    byte[] macbin = IO.In.ReadBytes(0x1D0);

                    //Close our IO
                    IO.Close();

                    //Create our savefiledialog
                    SaveFileDialog sfd = new SaveFileDialog();

                    //Set our filter
                    sfd.Filter = "Mac Bin(.bin)|*.bin";

                    //Show our dialog, if the result is OK
                    if (sfd.ShowDialog() == DialogResult.OK)
                    {
                        //Create our IO
                        IO = new EndianIO(new FileStream(sfd.FileName, FileMode.Create), EndianType.BigEndian);

                        //Open our IO
                        IO.Open();

                        //Write our macbin data.
                        IO.Out.Write(macbin);

                        //Close our IO
                        IO.Close();

                        //Show our messagebox
                        MessageBox.Show("Done.");
                    }
                    return;
                }
            }

            //We aren't connected
            MessageBox.Show("You are not connected.");
        }
示例#7
0
        /// <summary>
        ///     Create a new instance of the XBDM Communicator
        /// </summary>
        /// <param name="deviceIdent">The Name of IP of the XBox Console running xbdm.</param>
        /// <param name="openConnection">Open a connection to the XBox Console</param>
        public Xbdm(string deviceIdent, bool openConnection = false)
        {
            DeviceIdent  = deviceIdent;
            MemoryStream = new XboxMemoryStream(this);

            if (openConnection)
            {
                Connect();
            }
        }
示例#8
0
        private void menuButtonItem28_Activate_1(object sender, EventArgs e)
        {
            //Inverse our check.
            menuButtonItem28.Checked = !menuButtonItem28.Checked;

            //Change our debug hud text.

            //If the user didnt set the XDK name.
            if (AppSettings.Settings.XDKName == "")
            {
                //Show our error.
                MessageBox.Show(
                    "The Xbox Development Kit could not be connected to because it's means of connection were not set.");

                //Stop processing code in this stub.
                return;
            }

            //Initialize our Xbox Debug Communicator, with our XDK name/IP.
            XboxDebugCommunicator xdc = new XboxDebugCommunicator(AppSettings.Settings.XDKName);

            //Connect to our Xbox Debug Communicator.
            xdc.Connect();

            //Create an Xbox Memory Stream.
            XboxMemoryStream xbms = xdc.ReturnXboxMemoryStream();

            //Create an endian IO for our Memory Stream.
            EndianIO IO = new EndianIO(xbms, EndianType.BigEndian);

            //Open our IO.
            IO.Open();

            //Goto the Address of the jump to the debug text.
            IO.SeekTo(0x821978B0);

            //If our print cam info item is checked..
            if (menuButtonItem28.Checked)
            {
                //Write our ASM value indicating a no operation.
                IO.Out.Write(0x60000000);//Nop
            }
            //Otherwise
            else
            {
                //Write our jump offset.
                IO.Out.Write(0x419A01D8);
            }

            //Close our IO.
            IO.Close();

            //Disconnect from our xbox.
            xdc.Disconnect();
        }
示例#9
0
 private void menuBarItem2_BeforePopup(object sender, TD.SandBar.MenuPopupEventArgs e)
 {
     //If the XDK Name isn't blank
     if (AppSettings.Settings.XDKName != "")
     {
         //Initialize our Xbox Debug Communicator, with our Xbox Name
         XboxDebugCommunicator Xbox_Debug_Communicator = new XboxDebugCommunicator(AppSettings.Settings.XDKName);
         //Connect
         Xbox_Debug_Communicator.Connect();
         //Get the memoryStream
         XboxMemoryStream xbms = Xbox_Debug_Communicator.ReturnXboxMemoryStream();
         //Endian IO
         EndianIO IO = new EndianIO(xbms, EndianType.BigEndian);
         IO.Open();
         //Loop through every ident
         for (int i = 0; i < identGrid.Items.Count; i++)
         {
             //Get the offset
             int offset = int.Parse(identGrid.Items[i].SubItems[1].Text.Substring(2), System.Globalization.NumberStyles.HexNumber) + Map.MapHeader.mapMagic;
             try
             {
                 //Get the tagclass and name
                 string tagClass = identGrid.Items[i].SubItems[2].Text;
                 string tagName  = identGrid.Items[i].SubItems[3].Text;
                 //Get our tag ID
                 int tagID = Map.IndexItems[Map.GetTagIndexByClassAndName(tagClass, tagName)].Ident;
                 //Make our IO go to the offset
                 IO.Out.BaseStream.Position = offset;
                 //Write our tagclass
                 IO.Out.WriteAsciiString(tagClass, 4);
                 //Skip 8 bytes
                 IO.Out.BaseStream.Position += 8;
                 //Write our ID
                 IO.Out.Write(tagID);
             }
             catch
             {
             }
         }
         IO.Close();
         xbms.Close();
         //Disconnect
         Xbox_Debug_Communicator.Disconnect();
         MessageBox.Show("Done.");
     }
     else
     {
         //Show our error dialog
         MessageBox.Show("XDK Name/IP was not set. Please set it before continuing.");
         //Stop processing code.
         return;
     }
 }
示例#10
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);
         }
     }
 }
示例#11
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();
     }
 }
示例#12
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");
        }
示例#13
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (AppSettings.Settings.IP_and_XDK_Name == "")
     {
         OutputMessenger.OutputMessage("XDK Name not set. Please set it in settings before continuing.", this);
     }
     else
     {
         XboxDebugCommunicator communicator = new XboxDebugCommunicator(AppSettings.Settings.IP_and_XDK_Name);
         communicator.Connect();
         communicator.Freeze();
         XboxMemoryStream stream = communicator.ReturnXboxMemoryStream();
         EndianIO         nio    = new EndianIO(stream, EndianType.BigEndian);
         nio.Open();
         int    tagIndexByClassAndName = Map.GetTagIndexByClassAndName(cmbxClass.Text, cmbxName.Text);
         string str  = "Null";
         string name = "Null";
         if (tagIndexByClassAndName != -1)
         {
             str  = Map.Index_Items[tagIndexByClassAndName].Class;
             name = Map.Index_Items[tagIndexByClassAndName].Name;
         }
         for (int i = 0; i < IdentGrid.SelectedItems.Count; i++)
         {
             int num3 = int.Parse(IdentGrid.SelectedItems[i].SubItems[1].Text.Substring(2), NumberStyles.HexNumber) + Map.Map_Header.mapMagic;
             if (tagIndexByClassAndName != -1)
             {
                 nio.Out.BaseStream.Position = num3;
                 nio.Out.WriteAsciiString(str, 4);
             }
             nio.Out.BaseStream.Position = num3 + 12;
             if (tagIndexByClassAndName != -1)
             {
                 nio.Out.Write(Map.Index_Items[tagIndexByClassAndName].Ident);
             }
             else
             {
                 nio.Out.Write(-1);
             }
         }
         nio.Close();
         stream.Close();
         communicator.Unfreeze();
         communicator.Disconnect();
         OutputMessenger.OutputMessage("Sucessfully poked " + IdentGrid.SelectedItems.Count.ToString() + " tag references to: \"" + name + "." + str + "\"", IdentGrid);
     }
 }
示例#14
0
        public static void PokePatch(string originalMap, string patchPath)
        {
            XboxDebugCommunicator debugCommunicator = new XboxDebugCommunicator(AppSettings.Settings.IP_and_XDK_Name);

            if (!debugCommunicator.Connected)
            {
                try
                {
                    debugCommunicator.Connect();
                }
                catch
                {
                }
            }
            XboxMemoryStream xboxMemoryStream = debugCommunicator.ReturnXboxMemoryStream();

            debugCommunicator.Disconnect();
            HaloReach3d.IO.EndianIO endianIo = new HaloReach3d.IO.EndianIO((Stream)xboxMemoryStream, HaloReach3d.IO.EndianType.BigEndian);
            endianIo.Open();
            HaloMap haloMap = new HaloMap(originalMap);

            haloMap.ReloadMap();
            int mapMagic = haloMap.Map_Header.mapMagic;

            haloMap.CloseIO();
            BinaryReader binaryReader = new BinaryReader((Stream) new FileStream(patchPath, FileMode.Open, FileAccess.Read));

            try
            {
                while (binaryReader.BaseStream.Position != binaryReader.BaseStream.Length - 8L)
                {
                    int num   = binaryReader.ReadInt32();
                    int count = binaryReader.ReadInt32();
                    endianIo.Out.BaseStream.Position = (long)(num + mapMagic);
                    endianIo.Out.Write(binaryReader.ReadBytes(count));
                }
            }
            catch
            {
            }
            binaryReader.Close();
            endianIo.Close();
            xboxMemoryStream.Close();
        }
示例#15
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);
     }
 }
示例#16
0
        private void buttonX1_Click(object sender, EventArgs e)
        {
            //If the XDK Name isn't blank
            if (AppSettings.Settings.XDKName != "")
            {
                //Initialize our Xbox Debug Communicator, with our Xbox Name
                XboxDebugCommunicator Xbox_Debug_Communicator = new XboxDebugCommunicator(AppSettings.Settings.XDKName);
                //Connect
                Xbox_Debug_Communicator.Connect();

                //Get our memory stream
                XboxMemoryStream xbms = Xbox_Debug_Communicator.ReturnXboxMemoryStream();

                //Create our IO
                EndianIO IO = new EndianIO(xbms, EndianType.BigEndian);

                //Open our IO
                IO.Open();

                //If we are to remove soft barriers
                if (chkRemoveSoftBarriers.Checked)
                {
                }

                //Close our IO
                IO.Close();

                //Disconnect
                Xbox_Debug_Communicator.Disconnect();
                //Null our communicator
                Xbox_Debug_Communicator = null;
            }
            else
            {
                MessageBox.Show("No XDK Name is set. Please set it in settings before continuing.");
            }
        }
示例#17
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");
        }
示例#18
0
 public string PeekXbox(uint offset, string type)
 {
     if (isConnected)
     {
         string hex = "X";
         object rn  = null;
         if (xdkName != "")
         {
             if (!Xbox_Debug_Communicator.Connected)
             {
                 try
                 {
                     Xbox_Debug_Communicator.Connect();
                 }
                 catch
                 {
                 }
             }
             XboxMemoryStream        xbms = Xbox_Debug_Communicator.ReturnXboxMemoryStream();
             HaloReach3d.IO.EndianIO IO   = new HaloReach3d.IO.EndianIO(xbms, HaloReach3d.IO.EndianType.BigEndian);
             IO.Open();
             IO.In.BaseStream.Position = offset;
             if ((type == "String") | (type == "string"))
             {
                 rn = IO.In.ReadString();
             }
             if ((type == "Float") | (type == "float"))
             {
                 rn = IO.In.ReadSingle();
             }
             if ((type == "Double") | (type == "double"))
             {
                 rn = IO.In.ReadDouble();
             }
             if ((type == "Short") | (type == "short"))
             {
                 rn = IO.In.ReadInt16().ToString(hex);
             }
             if ((type == "Byte") | (type == "byte"))
             {
                 rn = IO.In.ReadByte().ToString(hex);
             }
             if ((type == "Long") | (type == "long"))
             {
                 rn = IO.In.ReadInt32().ToString(hex);
             }
             if ((type == "Quad") | (type == "quad"))
             {
                 rn = IO.In.ReadInt64().ToString(hex);
             }
             IO.Close();
             xbms.Close();
             return(rn.ToString());
         }
         MessageBox.Show("XDK Name/IP not set");
         return("No Console Detected");
     }
     else
     {
         Elysium.Notifications.NotificationManager.BeginTryPush("Error", "You are not connected to your XDK");
         return("Not Connected");
     }
 }
示例#19
0
        public void PokeXbox(Offset offsetData)
        {
            uint   offset   = Convert.ToUInt32(offsetData.Address, 0x10);
            string poketype = offsetData.Type;
            string amount   = offsetData.Value;

            if (isConnected)
            {
                try
                {
                    if (!Xbox_Debug_Communicator.Connected)
                    {
                        try
                        {
                            Xbox_Debug_Communicator.Connect();
                        }
                        catch
                        {
                        }
                    }
                    XboxMemoryStream        xbms = Xbox_Debug_Communicator.ReturnXboxMemoryStream();
                    HaloReach3d.IO.EndianIO IO   = new HaloReach3d.IO.EndianIO(xbms, HaloReach3d.IO.EndianType.BigEndian);
                    IO.Open();
                    IO.Out.BaseStream.Position = offset;
                    if (poketype == "Unicode String")
                    {
                        IO.Out.WriteUnicodeString(amount, amount.Length);
                    }
                    if (poketype == "ASCII String")
                    {
                        IO.Out.WriteUnicodeString(amount, amount.Length);
                    }
                    if ((poketype == "String") | (poketype == "string"))
                    {
                        IO.Out.Write(amount);
                    }
                    if ((poketype == "Float") | (poketype == "float"))
                    {
                        IO.Out.Write(float.Parse(amount));
                    }
                    if ((poketype == "Double") | (poketype == "double"))
                    {
                        IO.Out.Write(double.Parse(amount));
                    }
                    if ((poketype == "Short") | (poketype == "short"))
                    {
                        IO.Out.Write((short)Convert.ToUInt32(amount, 0x10));
                    }
                    if ((poketype == "Byte") | (poketype == "byte"))
                    {
                        IO.Out.Write((byte)Convert.ToUInt32(amount, 0x10));
                    }
                    if ((poketype == "Long") | (poketype == "long"))
                    {
                        IO.Out.Write((long)Convert.ToUInt32(amount, 0x10));
                    }
                    if ((poketype == "Quad") | (poketype == "quad"))
                    {
                        IO.Out.Write((long)Convert.ToUInt64(amount, 0x10));
                    }
                    if ((poketype == "Int") | (poketype == "int"))
                    {
                        IO.Out.Write(Convert.ToUInt32(amount, 0x10));
                    }
                    IO.Close();
                    xbms.Close();
                    Elysium.Notifications.NotificationManager.BeginTryPush("Poked", "Poked " + amount + " to 0x" + offset.ToString("X"));
                }
                catch
                {
                    Elysium.Notifications.NotificationManager.BeginTryPush("Error", "Couldn't poke XDK. ");
                }
            }
            else
            {
                Elysium.Notifications.NotificationManager.BeginTryPush("Error", "You are not connected to your XDK. ");
            }
        }
 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");
        }