コード例 #1
0
        public KOARBinaryReader GetBinaryReaderUncompressed()
        {
            KOARBinaryReader br = new KOARBinaryReader(_parent.Filename);

            br.SetOffset(_offset);
            return(br);
        }
コード例 #2
0
        public override byte[] GetBytes()
        {
            KOARBinaryReader br = new KOARBinaryReader(_filename);

            byte[] result = br.ReadAll();
            br.Close();
            return(result);
        }
コード例 #3
0
        public override byte[] GetBytes()
        {
            KOARBinaryReader br = GetBinaryReaderUncompressed();

            byte[] result = br.Read((int)_size);
            br.Close();
            return(result);
        }
コード例 #4
0
        private void ReadFileTable(KOARBinaryReader br)
        {
            _fileTable = new List <BigFileEntryBase>();

            Int32 count = br.ReadInt();

            for (int i = 0; i < count; i++)
            {
                var entry = new BigFileEntryInternal(this, br.ReadUInt(), br.ReadUInt(), br.ReadUInt(), br.ReadUInt(), br.ReadUInt());
                _fileTable.Add(entry);
            }
        }
コード例 #5
0
 private void ReadHeader(KOARBinaryReader br)
 {
     byte[] signature = br.Read(4);
     if (!signature.SequenceEqual(Big.SIGNATURE))
     {
         throw new IOException("big file signature doesn't match");
     }
     _version = br.ReadUInt();
     br.Read();     // 1
     BuildString = br.ReadString();
     br.ReadUInt(); // 0x20
 }
コード例 #6
0
        public void Load(String bigfile)
        {
            Filename = bigfile;

            KOARBinaryReader br = new KOARBinaryReader(bigfile);

            ReadHeader(br);
            ReadFileTable(br);

            br.Close();

            ReadAdditionalInfo();
        }
コード例 #7
0
ファイル: Symbols.cs プロジェクト: tmt01/KOAR-Tools
        public void Load(String name)
        {
            KOARBinaryReader br = new KOARBinaryReader(Path.Combine("symbols", name));

            _fileIDs      = new List <uint>();
            _symbol_names = new List <string>();

            var count = br.ReadInt();

            for (int i = 0; i < count; i++)
            {
                _fileIDs.Add(br.ReadUInt());
                _symbol_names.Add(br.ReadString());
            }

            br.Close();
        }
コード例 #8
0
        public static String RestoreHashedString(UInt32 hash)
        {
            if (_hash_table == null)
            {
                _hash_table = new Dictionary <uint, string>();
                KOARBinaryReader br = new KOARBinaryReader("data\\hash_table");
                var count           = br.ReadInt();
                for (int i = 0; i < count; i++)
                {
                    var h = br.ReadUInt();
                    var s = br.ReadString();
                    _hash_table[h] = s;
                }
                br.Close();
            }

            if (_hash_table.ContainsKey(hash))
            {
                return(_hash_table[hash]);
            }

            return(null);
        }
コード例 #9
0
        private void ReadAdditionalInfo()
        {
            // load names
            var lookup_names = this.Find(0xffffffff); // .\lookup_names_as_strings.bin

            if (lookup_names != null)
            {
                List <String> names = new List <string>();

                //var br = lookup_names.GetBinaryReader();
                var br = new KOARBinaryReader(lookup_names.GetStream());

                int count = br.ReadInt();
                br.ReadInt(); // skip count duplicate
                br.Read(3);   // skip ffff00

                for (int i = 0; i < count; i++)
                {
                    _fileTable[i].Filename = br.ReadString();
                }

                br.Close();
            }
        }