public ResourceDirectoryBuilder(NetAssemblyBuilder builder, IOffsetConverter offsetConverter, ImageResourceDirectory rootDirectory)
        {
            if (builder == null)
                throw new ArgumentNullException("builder");
            if (offsetConverter == null)
                throw new ArgumentNullException("offsetConverter");
            if (rootDirectory == null)
                throw new ArgumentNullException("rootDirectory");

            _offsetConverter = offsetConverter;
            _rootDirectory = rootDirectory;

            _resourceDirectory = builder.Assembly.NtHeaders.OptionalHeader.DataDirectories[ImageDataDirectory.ResourceDirectoryIndex];

            Segments.Add(_directoryTablesBuilder = new DirectoryTablesBuilder(_resourceDirectory, offsetConverter));
            Segments.Add(_dataDirectoryTableBuilder = new DataDirectoryTablesBuilder(_dataTableBuilder, offsetConverter));
            Segments.Add(_dataTableBuilder);
        }
예제 #2
0
        public ResourceDirectoryBuilder(NetAssemblyBuilder builder, IOffsetConverter offsetConverter, ImageResourceDirectory rootDirectory)
        {
            if (builder == null)
            {
                throw new ArgumentNullException("builder");
            }
            if (offsetConverter == null)
            {
                throw new ArgumentNullException("offsetConverter");
            }
            if (rootDirectory == null)
            {
                throw new ArgumentNullException("rootDirectory");
            }

            _offsetConverter = offsetConverter;
            _rootDirectory   = rootDirectory;

            _resourceDirectory = builder.Assembly.NtHeaders.OptionalHeader.DataDirectories[ImageDataDirectory.ResourceDirectoryIndex];

            Segments.Add(_directoryTablesBuilder    = new DirectoryTablesBuilder(_resourceDirectory, offsetConverter));
            Segments.Add(_dataDirectoryTableBuilder = new DataDirectoryTablesBuilder(_dataTableBuilder, offsetConverter));
            Segments.Add(_dataTableBuilder);
        }