Esempio n. 1
0
        public static CompressionType GetAlgorithm(VoidPtr addr, int length)
        {
            BinTag compTag = *(BinTag *)addr;

            if (compTag == YAZ0.Tag)
            {
                return(CompressionType.RunLengthYAZ0);
            }
            else if (compTag == YAY0.Tag)
            {
                return(CompressionType.RunLengthYAY0);
            }
            else
            {
                CompressionHeader *cmpr = (CompressionHeader *)addr;

                if (cmpr->ExpandedSize < length)
                {
                    return(CompressionType.None);
                }

                if (!cmpr->HasLegitCompression())
                {
                    return(CompressionType.None);
                }

                //Check to make sure we're not reading a tag
                if (IsTag((byte *)addr))
                {
                    return(CompressionType.None);
                }

                return(cmpr->Algorithm);
            }
        }
Esempio n. 2
0
 public BRESHeader(int size, int numSections)
 {
     _tag = Tag;
     _endian = 0xFEFF;
     _version = 0;
     _fileSize = (uint)size;
     _rootOffset = 0x10;
     _numSections = (ushort)numSections;
 }
Esempio n. 3
0
        public static uint GetExpandedLength(VoidPtr addr, int length)
        {
            BinTag compTag = *(BinTag *)addr;

            if (compTag == YAZ0.Tag)
            {
                return(((YAZ0 *)addr)->_unCompDataLen);
            }

            if (compTag == YAY0.Tag)
            {
                return(((YAY0 *)addr)->_unCompDataLen);
            }

            return(((CompressionHeader *)addr)->ExpandedSize);
        }
Esempio n. 4
0
 public WTE(short width, short height)
 {
     this.tag    = "WTE\0";
     this.width  = width;
     this.height = height;
 }
Esempio n. 5
0
 public ROOTHeader(int size, int numEntries)
 {
     _tag = Tag;
     _size = size;
     _master = new ResourceGroup(numEntries);
 }
Esempio n. 6
0
        internal static ResourceNode TryParse(DataSource source)
        {
            BinTag tag = ((RSTMHeader *)source.Address)->_header._tag;

            return(tag == RSTMHeader.Tag || tag == CSTMHeader.Tag || tag == FSTMHeader.Tag ? new RSTMNode() : null);
        }