Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PELinker"/> class.
        /// </summary>
        public PELinker()
        {
            this.dosHeader = new ImageDosHeader();
            this.ntHeaders = new ImageNtHeaders();
            this.SectionAlignment = SECTION_ALIGNMENT;
            this.LoadSectionAlignment = FILE_SECTION_ALIGNMENT;
            this.setChecksum = true;

            AddSection(new PELinkerSection(SectionKind.Text, @".text", this.BaseAddress + SectionAlignment));
            AddSection(new PELinkerSection(SectionKind.Data, @".data", 0));
            AddSection(new PELinkerSection(SectionKind.ROData, @".rodata", 0));
            AddSection(new PELinkerSection(SectionKind.BSS, @".bss", 0));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Linker"/> class.
        /// </summary>
        public Linker()
        {
            this.dosHeader = new ImageDosHeader();
            this.ntHeaders = new ImageNtHeaders();
            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 Section(SectionKind.Text, @".text", new IntPtr(this.BaseAddress + this.sectionAlignment)) },
                { SectionKind.Data, new Section(SectionKind.Data, @".data", IntPtr.Zero) },
                { SectionKind.ROData, new Section(SectionKind.ROData, @".rodata", IntPtr.Zero) },
                { SectionKind.BSS, new Section(SectionKind.BSS, @".bss", IntPtr.Zero) }
            };
        }