public ScreenshotForm()
        {
            InitializeComponent();
            Text = "Screenshot: " + DateTime.Now;
            XboxDebugCommunicator xdc = new XboxDebugCommunicator(AppSettings.Settings.IP_and_XDK_Name);

            xdc.Connect();
            Image image = XboxScreenshot.TakeScreenshot(xdc);

            try
            {
                xdc.Disconnect();
            }
            catch
            {
            }
            pictureBox1.Image    = XboxScreenshot.ResizeImage((Bitmap)image);
            pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
            if (AppSettings.Settings.SaveScreenshots)
            {
                if (AppSettings.Settings.ScreenShotLocation == "")
                {
                    MessageBox.Show("Please set a Save Location");
                    new SettingsForm().ShowDialog();
                }
                string str = $"{DateTime.Now:yyyy-MM-dd,hh-mm-ss}";
                pictureBox1.Image.Save(AppSettings.Settings.ScreenShotLocation + str + ".jpg", ImageFormat.Jpeg);
            }
            xdc.Disconnect();
        }
示例#2
0
        public ScreenshotForm()
        {
            InitializeComponent();
            //Set the text as the time now.
            // ReSharper disable DoNotCallOverridableMethodsInConstructor
            Text = "Screenshot: " + DateTime.Now;
            // ReSharper restore DoNotCallOverridableMethodsInConstructor

            //Initialize our Xbox Debug Communicator, with our Xbox Name
            XboxDebugCommunicator Xbox_Debug_Communicator = new XboxDebugCommunicator(AppSettings.Settings.XDKName);

            //Connect
            Xbox_Debug_Communicator.Connect();

            //Take our screenshot
            Image img = H3Screenshot.TakeScreenshot(Xbox_Debug_Communicator);

            //Disconnect
            Xbox_Debug_Communicator.Disconnect();


            //Set the pictureBox image as the provided image
            pictureBox1.Image = H3Screenshot.ResizeImage((Bitmap)img);
            //Set it to stretch the image to fit
            pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
        }
示例#3
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();
        }
示例#4
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
         {
         }
     }
 }
示例#5
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());
        }
示例#6
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();
        }
示例#7
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();
        }
示例#8
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;
     }
 }
示例#9
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);
         }
     }
 }
示例#10
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();
     }
 }
示例#11
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");
        }
示例#12
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);
     }
 }
示例#13
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();
        }
示例#14
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);
     }
 }
示例#15
0
        public static void PrintCamDebugInfo(bool printingCam)
        {
            string xboxName = AppSettings.Settings.IP_and_XDK_Name;

            if (xboxName != "")
            {
                XboxDebugCommunicator communicator = new XboxDebugCommunicator(xboxName);
                communicator.Connect();
                EndianIO nio = new EndianIO(communicator.ReturnXboxMemoryStream(), EndianType.BigEndian);
                nio.Open();
                communicator.Freeze();
                nio.Out.BaseStream.Position = 0x82191eecL;
                if (printingCam)
                {
                    nio.Out.Write(0x60000000);
                }
                else
                {
                    nio.Out.Write(0x419a01b0);
                }
                nio.Out.BaseStream.Position = 0x82191f04L;
                if (printingCam)
                {
                    nio.Out.Write(0x60000000);
                }
                else
                {
                    nio.Out.Write(0x419a01b0);
                }
                communicator.Unfreeze();
                nio.Close();
                communicator.Disconnect();
            }
            else
            {
                MessageBox.Show("XDK name not set. Please set it in settings before continuing.");
            }
        }
示例#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");
        }
        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");
        }
示例#19
0
        public static void LoadMap(LevelOption Level_Map, GameBuild build)
        {
            string xboxName = AppSettings.Settings.IP_and_XDK_Name;

            if (xboxName != "")
            {
                XboxDebugCommunicator communicator = new XboxDebugCommunicator(xboxName);
                try
                {
                    communicator.Connect();
                }
                catch (Exception ex)
                {
                    throw new Exception("Not Connected");
                }
                EndianIO nio = new EndianIO(communicator.ReturnXboxMemoryStream(), EndianType.BigEndian);
                nio.Open();
                communicator.Freeze();
                if (build == GameBuild.PreBeta)
                {
                    nio.Out.BaseStream.Position = 0x83b8dea8L;
                }
                else
                {
                    nio.Out.BaseStream.Position = 0x8357d140L;
                }
                nio.Out.WriteAsciiString(beta_mapScenarioPaths[(int)Level_Map], 0x100);
                if (build == GameBuild.PreBeta)
                {
                    nio.Out.BaseStream.Position = 0x83b7fe78L;
                }
                else
                {
                    nio.Out.BaseStream.Position = 0x8356f110L;
                }
                if (Level_Map <= LevelOption.boneyard)
                {
                    nio.Out.Write((int)AppSettings.Settings.Force_Load_MapType);
                }
                else
                {
                    byte[] buffer = new byte[4];
                    buffer[3] = 2;
                    nio.Out.Write(buffer);
                }
                if (build == GameBuild.PreBeta)
                {
                    nio.Out.BaseStream.Position = 0x83b7fe6eL;
                }
                else
                {
                    nio.Out.BaseStream.Position = 0x8356f106L;
                }
                nio.Out.Write((byte)1);
                communicator.Unfreeze();
                nio.Close();
                communicator.Disconnect();
            }
            else
            {
                MessageBox.Show("XDK name not set. Please set it in settings before continuing.");
            }
        }
示例#20
0
 public void Disconnect()
 {
     Xbox_Debug_Communicator.Disconnect();
     isConnected = false;
     Elysium.Notifications.NotificationManager.BeginTryPush("Success", "You are no longer connected to " + xdkName);
 }
 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
     {
     }
 }