Beispiel #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();
        }
Beispiel #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
         {
         }
     }
 }
Beispiel #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());
        }
Beispiel #4
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;
     }
 }
Beispiel #5
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);
         }
     }
 }
Beispiel #6
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();
     }
 }
Beispiel #7
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");
        }
 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);
     }
 }
Beispiel #9
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();
        }
Beispiel #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);
     }
 }
Beispiel #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");
        }
 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");
     }
 }
        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");
        }