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); }
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); } } }
protected abstract void WriteDescriptor(ElfWriter writer);
internal void WriteDescriptorInternal(ElfWriter writer) { WriteDescriptor(writer); }