Example #1
0
        private void ReadTagBlock(DataBlock block, uint offset, uint entrySize, int align, bool sort)
        {
            // Read the count and pointer
            SeekToOffset(block, offset);
            var values  = StructureReader.ReadStructure(_reader, _tagBlockLayout);
            var count   = (int)values.GetInteger("entry count");
            var pointer = (uint)values.GetInteger("pointer");

            long expand = _cacheFile.PointerExpander.Expand(pointer);

            if (count <= 0 || !_cacheFile.MetaArea.ContainsBlockPointer(expand, (int)(count * entrySize)))
            {
                return;
            }

            var newBlock = ReadDataBlock(expand, (int)entrySize, count, align, sort);

            // Now create a fixup for the block
            var fixup = new DataBlockAddressFixup(pointer, (int)offset + _tagBlockLayout.GetFieldOffset("pointer"));

            block.AddressFixups.Add(fixup);

            // Add it to _tagBlocks so it'll be recursed into
            _tagBlocks.Add(newBlock);
        }
Example #2
0
        private void ReadDataReference(DataBlock block, uint offset, int align)
        {
            // Read the size and pointer
            SeekToOffset(block, offset);
            StructureValueCollection values = StructureReader.ReadStructure(_reader, _dataRefLayout);
            var  size    = (int)values.GetInteger("size");
            uint pointer = values.GetInteger("pointer");

            if (size > 0 && _cacheFile.MetaArea.ContainsBlockPointer(pointer, size))
            {
                // Read the block and create a fixup for it
                ReadDataBlock(pointer, size, 1, align);
                var fixup = new DataBlockAddressFixup(pointer, (int)offset + _dataRefLayout.GetFieldOffset("pointer"));
                block.AddressFixups.Add(fixup);
            }
        }
Example #3
0
        private void ReadReflexive(DataBlock block, uint offset, uint entrySize, int align)
        {
            // Read the count and pointer
            SeekToOffset(block, offset);
            StructureValueCollection values = StructureReader.ReadStructure(_reader, _reflexiveLayout);
            var  count   = (int)values.GetInteger("entry count");
            uint pointer = values.GetInteger("pointer");

            if (count > 0 && _cacheFile.MetaArea.ContainsBlockPointer(pointer, (int)(count * entrySize)))
            {
                DataBlock newBlock = ReadDataBlock(pointer, (int)entrySize, count, align);

                // Now create a fixup for the block
                var fixup = new DataBlockAddressFixup(pointer, (int)offset + _reflexiveLayout.GetFieldOffset("pointer"));
                block.AddressFixups.Add(fixup);

                // Add it to _reflexiveBlocks so it'll be recursed into
                _reflexiveBlocks.Add(newBlock);
            }
        }
Example #4
0
        private void ReadDataReference(DataBlock block, uint offset, int align)
        {
            // Read the size and pointer
            SeekToOffset(block, offset);
            var values  = StructureReader.ReadStructure(_reader, _dataRefLayout);
            var size    = (int)values.GetInteger("size");
            var pointer = (uint)values.GetInteger("pointer");

            long expand = _cacheFile.PointerExpander.Expand(pointer);

            if (size <= 0 || !_cacheFile.MetaArea.ContainsBlockPointer(expand, size))
            {
                return;
            }

            // Read the block and create a fixup for it
            ReadDataBlock(expand, size, 1, align, false);
            var fixup = new DataBlockAddressFixup(pointer, (int)offset + _dataRefLayout.GetFieldOffset("pointer"));

            block.AddressFixups.Add(fixup);
        }
Example #5
0
		private void ReadReflexive(DataBlock block, uint offset, uint entrySize, int align)
		{
			// Read the count and pointer
			SeekToOffset(block, offset);
			var values = StructureReader.ReadStructure(_reader, _tagBlockLayout);
			var count = (int) values.GetInteger("entry count");
			var pointer = values.GetInteger("pointer");

			if (count <= 0 || !_cacheFile.MetaArea.ContainsBlockPointer(pointer, (int) (count*entrySize))) return;

			var newBlock = ReadDataBlock(pointer, (int)entrySize, count, align);

			// Now create a fixup for the block
			var fixup = new DataBlockAddressFixup(pointer, (int) offset + _tagBlockLayout.GetFieldOffset("pointer"));
			block.AddressFixups.Add(fixup);

			// Add it to _reflexiveBlocks so it'll be recursed into
			_reflexiveBlocks.Add(newBlock);
		}
Example #6
0
		private void ReadDataReference(DataBlock block, uint offset, int align)
		{
			// Read the size and pointer
			SeekToOffset(block, offset);
			var values = StructureReader.ReadStructure(_reader, _dataRefLayout);
			var size = (int) values.GetInteger("size");
			var pointer = values.GetInteger("pointer");

			if (size <= 0 || !_cacheFile.MetaArea.ContainsBlockPointer(pointer, size)) return;

			// Read the block and create a fixup for it
			ReadDataBlock(pointer, size, 1, align);
			var fixup = new DataBlockAddressFixup(pointer, (int) offset + _dataRefLayout.GetFieldOffset("pointer"));
			block.AddressFixups.Add(fixup);
		}