Example #1
0
        public override ArcFile TryOpen(ArcView file)
        {
            if (!file.Name.HasExtension(".dat"))
            {
                return(null);
            }
            int count = file.View.ReadInt32(0) ^ SignatureKey;

            if (!IsSaneCount(count))
            {
                return(null);
            }

            var scheme = QueryScheme(file.Name);

            if (null == scheme)
            {
                return(null);
            }

            using (var index = new NcIndexReader(file, count))
            {
                var file_map = ReadFilenameMap(scheme);
                var dir      = index.Read(file_map);
                if (null == dir)
                {
                    return(null);
                }
                return(new ArcDatArchive(file, this, dir, scheme.Hash));
            }
        }
Example #2
0
        public override ArcFile TryOpen(ArcView file)
        {
            uint key   = 0x8B6A4E5F;
            int  count = file.View.ReadInt32(4) ^ (int)key;

            if (!IsSaneCount(count))
            {
                return(null);
            }

            var scheme = QueryScheme(file.Name);

            if (null == scheme)
            {
                return(null);
            }

            using (var index = new NcIndexReader(file, count, key)
            {
                IndexPosition = 8
            })
            {
                var file_map = ReadFilenameMap(scheme);
                var dir      = index.Read(file_map);
                if (null == dir)
                {
                    return(null);
                }
                return(new ArcDatArchive(file, this, dir, scheme.Hash));
            }
        }
Example #3
0
        public override ArcFile TryOpen(ArcView file)
        {
            uint key   = 0x8B6A4E5F;
            int  count = file.View.ReadInt32(4) ^ (int)key;

            if (!IsSaneCount(count))
            {
                return(null);
            }

            var scheme = QueryScheme(file.Name);

            if (null == scheme)
            {
                return(null);
            }

            using (var index = new NcIndexReader(file, count, key)
            {
                IndexPosition = 8
            })
                return(index.Read(this, scheme));
        }
Example #4
0
        public override ArcFile TryOpen(ArcView file)
        {
            if (!file.Name.HasExtension(".dat"))
            {
                return(null);
            }
            int count = file.View.ReadInt32(0) ^ SignatureKey;

            if (!IsSaneCount(count))
            {
                return(null);
            }

            var scheme = QueryScheme(file.Name);

            if (null == scheme)
            {
                return(null);
            }

            using (var index = new NcIndexReader(file, count))
                return(index.Read(this, scheme));
        }