Ejemplo n.º 1
0
        /// <inheritdoc />
        protected override void InitOffsets()
        {
            base.InitOffsets();

            _index  = new ExOffset <int>(0x00);
            _number = new ExOffset <int>(0x04);
        }
Ejemplo n.º 2
0
        protected override void InitOffsets()
        {
            base.InitOffsets();

            int curOff = 0x0;

            _data  = new ExOffset <UIntPtr>(curOff); curOff += ExMemory.PointerSize;
            _count = new ExOffset <int>(curOff); curOff += 0x04;
            _max   = new ExOffset <int>(curOff);
        }
Ejemplo n.º 3
0
        internal static int GetClassSize(List <ExOffset> offsets)
        {
            if (offsets.Count == 0)
            {
                return(0);
            }

            // Get Biggest Offset
            int biggestOffset = offsets.Max(off => off.Offset);

            // Get Biggest Offset in size (Good for unions offsets)
            int biggestOffSize = offsets.Where(off => off.Offset == biggestOffset).Max(off => off.Size);

            // Get Offset
            ExOffset offset = offsets.Find(off => off.Offset == biggestOffset && off.Size == biggestOffSize);

            if (offset is null)
            {
                throw new NullReferenceException("'offset' can not be null.");
            }

            return(biggestOffset + offset.Size);
        }