コード例 #1
0
ファイル: DirectoryEntry.cs プロジェクト: revel8n/rpftool
        public override void Read(BitsStream stream)
        {
            bool IsResourceFile = stream.ReadBool();
            long Offset = (long)stream.ReadBits(23);
            int Size = (int)stream.ReadBits(24);
            NameOffset = (int)stream.ReadBits(16);

            ContentEntryIndex = stream.ReadInt();
            ContentEntryCount = stream.ReadInt();
        }
コード例 #2
0
ファイル: FileEntry.cs プロジェクト: revel8n/rpftool
        public override void Read(BitsStream stream)
        {
            try
            {
                IsResourceFile = stream.ReadBool();
                Offset = (long)stream.ReadBits(23);
                SizeInArchive = (int)stream.ReadBits(24);
                NameOffset = (int)stream.ReadBits(16);

                Offset <<= 9;

                if (IsResourceFile)
                {
                    if (Size == 0xFFFFFF)
                    {
                        throw new Exception("Resource with size -1, not supported");
                    }
                    uint systemFlag = (uint)stream.ReadInt();
                    uint graphicsFlag = (uint)stream.ReadInt();

                    IsCompressed = false;
                    IsEncrypted = false;
                    Size = SizeInArchive;
                }
                else
                {
                    Size = stream.ReadInt();
                    IsEncrypted = stream.ReadInt() == 1;
                    IsCompressed = Size != 0 ? true : false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #3
0
ファイル: TOCEntry.cs プロジェクト: revel8n/rpftool
 internal static bool ReadAsDirectory(BitsStream stream)
 {
     bool dir = stream.ReadInt() == 2147483392;
     stream.Seek(stream.Position - 4);
     return dir;
 }