Beispiel #1
0
 protected override void WriteDescriptor(ElfWriter writer)
 {
     if (BuildId != null)
     {
         writer.Write(BuildId);
     }
 }
Beispiel #2
0
 protected override void WriteDescriptor(ElfWriter writer)
 {
     if (Descriptor != null)
     {
         writer.Write(Descriptor);
     }
 }
Beispiel #3
0
 protected override void Write(ElfWriter writer)
 {
     if (Stream == null)
     {
         return;
     }
     writer.Write(Stream);
 }
        protected override void WriteDescriptor(ElfWriter writer)
        {
            NativeGnuNoteOS nativeGnuNote;

            writer.Encode(out nativeGnuNote.OS, (uint)OSKind);
            writer.Encode(out nativeGnuNote.MajorVersion, (uint)MajorVersion);
            writer.Encode(out nativeGnuNote.MinorVersion, (uint)MinorVersion);
            writer.Encode(out nativeGnuNote.SubMinorVersion, (uint)SubMinorVersion);
            writer.Write(nativeGnuNote);
        }
        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 override void Write(ElfWriter writer)
        {
            if (Size == 0)
            {
                return;
            }

            var sharedBuffer = ArrayPool <byte> .Shared.Rent((int)Size);

            Array.Clear(sharedBuffer, 0, sharedBuffer.Length);
            try
            {
                writer.Stream.Write(sharedBuffer, 0, (int)Size);
            }
            finally
            {
                ArrayPool <byte> .Shared.Return(sharedBuffer);
            }
        }
Beispiel #8
0
 protected override void Write(ElfWriter writer)
 {
 }