Represents the relocations data directory in a windows assembly image.
Наследование: FileSegment
Пример #1
0
        public static ImageRelocationDirectory FromReadingContext(ReadingContext context)
        {
            var directory      = new ImageRelocationDirectory();
            var relocDirectory =
                context.Assembly.NtHeaders.OptionalHeader.DataDirectories[
                    ImageDataDirectory.BaseRelocationDirectoryIndex];

            while (context.Reader.Position < context.Reader.StartPosition + relocDirectory.Size)
            {
                var block = BaseRelocationBlock.FromReadingContext(context);
                directory.Blocks.Add(block);
                context.Reader.Position += block.BlockSize - 2 * sizeof(uint);
            }

            return(directory);
        }
        public static ImageRelocationDirectory FromReadingContext(ReadingContext context)
        {
            var directory = new ImageRelocationDirectory();
            var relocDirectory =
                context.Assembly.NtHeaders.OptionalHeader.DataDirectories[
                    ImageDataDirectory.BaseRelocationDirectoryIndex];

            while (context.Reader.Position < context.Reader.StartPosition + relocDirectory.Size)
            {
                var block = BaseRelocationBlock.FromReadingContext(context);
                directory.Blocks.Add(block);
                context.Reader.Position += block.BlockSize - 2 * sizeof (uint);
            }

            return directory;
        }