예제 #1
0
        private void ReadInteropPointer(DataBlock block, uint offset)
        {
            // Read the address
            SeekToOffset(block, offset);
            var address = _reader.ReadUInt32();

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

            if (!_cacheFile.MetaArea.ContainsBlockPointer(expand, 24))
            {
                return;
            }

            var newBlock = ReadDataBlock(expand, 24, 1, 16, false);

            ReadDataReference(newBlock, 0, 16);

            //get the type from the table
            uint loc    = block.OriginalAddress;
            long expLoc = _cacheFile.PointerExpander.Expand(loc) + offset;
            uint cont   = _cacheFile.PointerExpander.Contract(expLoc);

            ITagInterop a = _cacheFile.TagInteropTable.Where(p => p.Pointer == cont).FirstOrDefault();

            if (a == null)
            {
                return;
            }
            int type = a.Type;

            // Now create a fixup
            var fixup = new DataBlockInteropFixup(type, address, (int)offset);

            block.InteropFixups.Add(fixup);
        }
예제 #2
0
        private void ReadInteropPointer(DataBlock block, uint offset, int refCount, bool polyart)
        {
            // Read the address
            SeekToOffset(block, offset);
            var address = _reader.ReadUInt32();

            if (address == 0)
            {
                return;
            }

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

            int length = _dataRefLayout.Size * refCount + (polyart ? refCount * 4 : 0);

            if (!_cacheFile.MetaArea.ContainsBlockPointer(expand, length))
            {
                return;
            }

            var newBlock = ReadDataBlock(expand, length, 1, 16, false);

            for (int i = 0; i < refCount; i++)
            {
                ReadDataReference(newBlock, (uint)(i * (_dataRefLayout.Size + (polyart ? 4 : 0))), 16);
            }

            //get the type from the table
            uint loc    = block.OriginalAddress;
            long expLoc = _cacheFile.PointerExpander.Expand(loc) + offset;
            uint cont   = _cacheFile.PointerExpander.Contract(expLoc);

            ITagInterop a = _cacheFile.TagInteropTable.Where(p => p.Pointer == cont).FirstOrDefault();

            if (a == null)
            {
                return;
            }
            int type = a.Type;

            // Now create a fixup
            var fixup = new DataBlockInteropFixup(type, address, (int)offset);

            block.InteropFixups.Add(fixup);
        }