Example #1
0
 private bool IsHeaderRevered(PPTStatus status, PPTMemory memory)
 {
     if (status.LobbyMax > 2)
     {
         return(false);
     }
     return(memory.MyIndex != 0);
 }
Example #2
0
        public static IntPtr ReadOffset(this PPTMemory pm, IntPtr pOffset, params Int32[] offsets)
        {
            IntPtr candidate = pOffset;

            foreach (Int32 tokenOffset in offsets)
            {
                try
                {
                    candidate = new IntPtr(pm.ReadInt32(candidate) + tokenOffset);
                }
                catch
                {
                    throw new InvalidOperationException(string.Format("ReadOffset for {0} broken, ({1})", pOffset, tokenOffset));
                }
            }
            return(candidate);
        }
Example #3
0
        public static string ReadValidString(this PPTMemory pm, IntPtr pOffset, uint pSize, params Int32[] offsets)
        {
            string tempString = pm.ReadStringUnicode(pOffset, pSize, offsets);

            int escapeIndex = tempString.IndexOf("\u0000");

            if (escapeIndex > -1)
            {
                tempString = tempString.Remove(escapeIndex);
            }

            escapeIndex = tempString.IndexOf("\\u");
            if (escapeIndex > -1)
            {
                tempString = tempString.Remove(escapeIndex);
            }

            return(tempString);
        }
Example #4
0
 public static string ReadStringUnicode(this PPTMemory pm, IntPtr pOffset, uint pSize, params Int32[] offsets)
 {
     return(pm.ReadStringUnicode(pm.ReadOffset(pOffset, offsets), pSize));
 }
Example #5
0
 public static Int32 ReadInt16(this PPTMemory pm, IntPtr pOffset, params Int32[] offsets)
 {
     return(pm.ReadInt16(pm.ReadOffset(pOffset, offsets)));
 }
Example #6
0
 public static byte ReadByte(this PPTMemory pm, IntPtr pOffset, params Int32[] offsets)
 {
     return(pm.ReadByte(pm.ReadOffset(pOffset, offsets)));
 }
Example #7
0
        public static bool ReadBinary(this PPTMemory pm, int location, IntPtr pOffset, params Int32[] offsets)
        {
            byte tempByte = pm.ReadByte(pm.ReadOffset(pOffset, offsets));

            return((tempByte & (1 << location)) != 0);
        }
Example #8
0
 public static bool ReadBinary(this PPTMemory pm, int location, IntPtr pOffset)
 {
     return(pm.ReadBinary(location, pOffset, new int[] { }));
 }