Пример #1
0
        public SarcLoader(Stream data)
        {
            FileName = null;
            FilePath = string.Empty;

            stream = data;

            br         = new BinaryReader(stream);
            Magic      = new string(br.ReadChars(4));
            HeaderSize = br.ReadUInt16();
            Endianness = br.ReadUInt16();
            FileSize   = br.ReadUInt32();
            DataOffset = br.ReadUInt32();
            Unknown    = br.ReadUInt32();

            SFAT  = new SFAT(br);
            SFNT  = new SFNT(br);
            Valid = true;
        }
Пример #2
0
        /// <summary>
        /// Initializes a <see cref="SARC"/> from a file location.
        /// </summary>
        /// <param name="path"></param>
        public SarcLoader(string path)
        {
            FileName = Path.GetFileNameWithoutExtension(path);
            FilePath = Path.GetDirectoryName(path) ?? string.Empty;

            stream = File.OpenRead(path);

            br         = new BinaryReader(stream);
            Magic      = new string(br.ReadChars(4));
            HeaderSize = br.ReadUInt16();
            Endianness = br.ReadUInt16();
            FileSize   = br.ReadUInt32();
            DataOffset = br.ReadUInt32();
            Unknown    = br.ReadUInt32();

            SFAT  = new SFAT(br);
            SFNT  = new SFNT(br);
            Valid = true;
        }