Beispiel #1
0
        public static string ReadNullTermString(this XDevkit.IXboxConsole xbc, uint Address)
        {
            byte[]      buffer = new byte[1];
            uint        num    = 0;
            List <byte> list   = new List <byte>();

            while (true)
            {
                buffer = xbc.getMemory(Address + num, 1);
                if (buffer[0] == 0)
                {
                    UTF8Encoding encoding = new UTF8Encoding();
                    return(encoding.GetString(list.ToArray()));
                }
                list.Add(buffer[0]);
                num++;
            }
        }
Beispiel #2
0
 public static float ReadFloat(this XDevkit.IXboxConsole xbc, uint offset)
 {
     myBuffer = xbc.getMemory(offset, 4);
     Array.Reverse(myBuffer, 0, 4);
     return(BitConverter.ToSingle(myBuffer, 0));
 }
Beispiel #3
0
 public static byte ReadByte(this XDevkit.IXboxConsole xbc, uint offset)
 {
     myBuffer = xbc.getMemory(offset, 1);
     return(myBuffer[0]);
 }
Beispiel #4
0
 public static bool ReadBool(this XDevkit.IXboxConsole xbc, uint offset)
 {
     myBuffer = xbc.getMemory(offset, 1);
     return(myBuffer[0] != 0);
 }
Beispiel #5
0
 public static ulong ReadUInt64(this XDevkit.IXboxConsole xbc, uint offset)
 {
     myBuffer = xbc.getMemory(offset, 8);
     Array.Reverse(myBuffer, 0, 8);
     return(BitConverter.ToUInt64(myBuffer, 0));
 }
Beispiel #6
0
 public static string ReadString(this XDevkit.IXboxConsole xbc, uint offset, byte[] readBuffer)
 {
     readBuffer = xbc.getMemory(offset, (uint)readBuffer.Length);
     return(new string(Encoding.ASCII.GetChars(readBuffer)).Split(new char[1])[0]);
 }
Beispiel #7
0
 public static short ReadInt16(this XDevkit.IXboxConsole xbc, uint offset)
 {
     myBuffer = xbc.getMemory(offset, 2);
     Array.Reverse(myBuffer, 0, 2);
     return(BitConverter.ToInt16(myBuffer, 0));
 }