Ejemplo n.º 1
0
 public NARC()
 {
     Header = new ArchiveHeader();
     FATB   = new FileAllocationTableBlock();
     FNTB   = new FilenameTableBlock();
     FIMG   = new FileImageBlock();
     FromFileSystem(new SFSDirectory("/", true)
     {
         DirectoryID = 0xF000
     });
 }
Ejemplo n.º 2
0
            public Header(FileReader reader)
            {
                reader.ByteOrder = Syroot.BinaryData.ByteOrder.LittleEndian;
                reader.ReadSignature(4, "NARC");

                ByteOrder = reader.ReadUInt16();
                reader.CheckByteOrderMark(ByteOrder);

                Version    = reader.ReadUInt16();
                FileSize   = reader.ReadUInt32();
                HeaderSize = reader.ReadUInt16();
                DataBlocks = reader.ReadUInt16();

                FATB = new FileAllocationTableBlock(reader);
                FNTB = new FileNameTable(reader);
                FIMG = new FileImageBlock(reader);
            }
Ejemplo n.º 3
0
        public NARC(byte[] Data)
        {
            EndianBinaryReader er = new EndianBinaryReader(new MemoryStream(Data), Endianness.LittleEndian);

            try
            {
                Header = new ArchiveHeader(er);
                FATB   = new FileAllocationTableBlock(er);
                FNTB   = new FilenameTableBlock(er);
                FIMG   = new FileImageBlock(er);
            }
            catch (SignatureNotCorrectException e)
            {
                MessageBox.Show(e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                er.Close();
            }
        }