Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PortableExecutableLinker"/> class.
        /// </summary>
        public PortableExecutableLinker()
        {
            this.dosHeader        = new IMAGE_DOS_HEADER();
            this.ntHeaders        = new IMAGE_NT_HEADERS();
            this.sectionAlignment = SECTION_ALIGNMENT;
            this.fileAlignment    = FILE_SECTION_ALIGNMENT;
            this.setChecksum      = true;

            // Create the default section set
            this.sections = new Dictionary <SectionKind, LinkerSection>()
            {
                { SectionKind.Text, new PortableExecutableLinkerSection(SectionKind.Text, @".text", new IntPtr(this.BaseAddress + this.sectionAlignment)) },
                { SectionKind.Data, new PortableExecutableLinkerSection(SectionKind.Data, @".data", IntPtr.Zero) },
                { SectionKind.ROData, new PortableExecutableLinkerSection(SectionKind.ROData, @".rodata", IntPtr.Zero) },
                { SectionKind.BSS, new PortableExecutableLinkerSection(SectionKind.BSS, @".bss", IntPtr.Zero) }
            };
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PortableExecutableLinker"/> class.
        /// </summary>
        public PortableExecutableLinker()
        {
            this.dosHeader = new IMAGE_DOS_HEADER();
            this.ntHeaders = new IMAGE_NT_HEADERS();
            this.sectionAlignment = SECTION_ALIGNMENT;
            this.fileAlignment = FILE_SECTION_ALIGNMENT;
            this.setChecksum = true;

            // Create the default section set
            this.sections = new Dictionary<SectionKind, LinkerSection>()
            {
                { SectionKind.Text, new PortableExecutableLinkerSection(SectionKind.Text, @".text", new IntPtr(this.BaseAddress + this.sectionAlignment)) },
                { SectionKind.Data, new PortableExecutableLinkerSection(SectionKind.Data, @".data", IntPtr.Zero) },
                { SectionKind.ROData, new PortableExecutableLinkerSection(SectionKind.ROData, @".rodata", IntPtr.Zero) },
                { SectionKind.BSS, new PortableExecutableLinkerSection(SectionKind.BSS, @".bss", IntPtr.Zero) }
            };
        }