示例#1
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();
        }
示例#2
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();
        }
示例#3
0
        public byte[] GetRawDataFromID(int RawID, int DataLength)
        {
            map.OpenIO();

            // Get our raw info
            RawInformation.RawEntry entry = GetRawEntryFromRawID(RawID);
            if (entry == null)
            {
                return(null);
            }
            RawInformation.RawLocation rl = rawLocations[entry.RawLocationsIndex];
            int index         = (rl.RawPoolIndexSingle == -1) ? rl.RawPoolIndexMultiple : rl.RawPoolIndexSingle;
            int offsetInPool  = (rl.RawPoolIndexSingle == -1) ? (int)rl.OffsetOfRawInPool : 0;
            int rawOffset     = (int)rawPools[index].RawOffset;
            int compressedLen = (int)rawPools[index].CompressedSize;
            int decompressLen = (int)rawPools[index].DecompressedSize;

            // Load our IO
            EndianIO io = (RawPools[index].ExternalMapIndex == -1) ? map.IO :
                          externalMaps[RawPools[index].ExternalMapIndex].io;

            // Open our IO and add our raw table offset
            io.In.SeekTo(0x470);
            int offset = rawOffset + io.In.ReadInt32();

            // Setup our output stream and deflater
            DeflateStream deflate = new DeflateStream(io.In.BaseStream,
                                                      CompressionMode.Decompress);
            BinaryReader br = new BinaryReader(deflate);

            // Goto our data and decompress it
            io.SeekTo(offset);
            byte[] buffer  = br.ReadBytes(decompressLen);
            byte[] dataNew = (DataLength == -1) ? new byte[decompressLen - offsetInPool] :
                             new byte[DataLength];
            int size = 0;

            if (DataLength != -1)
            {
                size = (offsetInPool + DataLength > buffer.Length) ? buffer.Length - offsetInPool : DataLength;
            }
            else
            {
                size = buffer.Length - offsetInPool;
            }
            Array.Copy(
                buffer, offsetInPool,
                dataNew, 0, size);

            map.CloseIO();
            // Now lets return our data
            return(dataNew);
        }
示例#4
0
        private void Read()
        {
            IO.SeekTo(0);

            // TODO
        }