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; }