Page 1 of 1

Getting a Header

Posted: Wed Dec 10, 2008 4:39 pm
by {KaS} Korori
I almost got guerrilla in Visual Studio's. My problem is when i try to use a string as a header (I copied one from another) it does not work. So my question is that i know i have know have you use HEX but I am not familiar working with hex in Visual Studio.

I have C#/VB (2005/2008)

This is the code in hex
00000000000000000000000000000000000000000000000000000000000000000000000069746D63145E5590000000400000000000000000000000FF626C616D0000000110610F0180659C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042C800006974656D80BD0C0100000023FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000

Posted: Thu Dec 11, 2008 4:31 am
by xzodia
I'm assuming you want this to be constant in which case you'll need to declare it as a byte array.

Posted: Thu Dec 11, 2008 4:55 am
by -DeToX-

Code: Select all

        public static string BytesToHexString(byte[] data)
        {
            string hexString = "";
            for (int i = 0; i < data.Length; i++)
            {
                string dataStr = data[i].ToString("X");
                while (dataStr.Length != 2)
                {
                    dataStr = "0" + dataStr;
                }
                hexString += dataStr;
            }
            return hexString;
        }
        public static byte[] HexStringToBytes(string hexString)
        {
            List<byte> data = new List<byte>();
            for (int i = 0; i < hexString.Length; i+=2)
            {
                if (hexString.Length > i + 1)
                {
                    data.Add(byte.Parse(hexString[i] + hexString[i + 1].ToString(), System.Globalization.NumberStyles.HexNumber));
                }
            }
            return data.ToArray();
        }
These functions should give you helping hand in what you're doing.

Just go

byte[] data = HexStringToBytes("FF0077"); //FF0077 being our hexString.., replace it with your own.

Posted: Thu Dec 11, 2008 6:59 pm
by SpecOp44
I read the topic quickly and it look like "Getting head" or something. lol

And to stay on topic, the answer is that molecules aren't sub atomic if the boiling temperature is below 7C in hex.

Posted: Fri Dec 12, 2008 8:33 pm
by {KaS} Korori
Now the problem is getting the footer lol.