示例#1
0
        private void WriteProgramHeader64(ElfWriter writer, ref ElfSegment segment)
        {
            var hdr = new ElfNative.Elf64_Phdr();

            writer.Encode(out hdr.p_type, segment.Type.Value);
            writer.Encode(out hdr.p_offset, segment.Offset);
            writer.Encode(out hdr.p_vaddr, segment.VirtualAddress);
            writer.Encode(out hdr.p_paddr, segment.PhysicalAddress);
            writer.Encode(out hdr.p_filesz, segment.Size);
            writer.Encode(out hdr.p_memsz, segment.SizeInMemory);
            writer.Encode(out hdr.p_flags, segment.Flags.Value);
            writer.Encode(out hdr.p_align, segment.Alignment);

            writer.Write(hdr);
        }
示例#2
0
 protected override void Write(ElfWriter writer)
 {
     for (int i = 0; i < Parent.Segments.Count; i++)
     {
         var header = Parent.Segments[i];
         if (Parent.FileClass == ElfFileClass.Is32)
         {
             WriteProgramHeader32(writer, ref header);
         }
         else
         {
             WriteProgramHeader64(writer, ref header);
         }
     }
 }
示例#3
0
 protected abstract void WriteDescriptor(ElfWriter writer);
示例#4
0
 internal void WriteDescriptorInternal(ElfWriter writer)
 {
     WriteDescriptor(writer);
 }