Ejemplo n.º 1
0
 protected override void WriteDescriptor(ElfWriter writer)
 {
     if (BuildId != null)
     {
         writer.Write(BuildId);
     }
 }
Ejemplo n.º 2
0
 protected override void WriteDescriptor(ElfWriter writer)
 {
     if (Descriptor != null)
     {
         writer.Write(Descriptor);
     }
 }
Ejemplo n.º 3
0
 protected override void Write(ElfWriter writer)
 {
     if (Stream == null)
     {
         return;
     }
     writer.Write(Stream);
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
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);
         }
     }
 }
Ejemplo n.º 7
0
        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);
            }
        }
Ejemplo n.º 8
0
 protected override void Write(ElfWriter writer)
 {
 }