Exemple #1
0
 private byte[] ReadBuildIdNote(Reader noteReader)
 {
     if (noteReader != null)
     {
         var noteList = new ELFNoteList(noteReader);
         foreach (ELFNote note in noteList.Notes)
         {
             ELFNoteType type = note.Header.Type;
             if (type == ELFNoteType.PrpsInfo && note.Name.Equals("GNU"))
             {
                 return(note.Contents.Read(0, (uint)note.Contents.Length));
             }
         }
     }
     return(null);
 }
Exemple #2
0
        private ELFFileTable ReadFileTable()
        {
            foreach (ELFProgramSegment seg in _elf.Segments)
            {
                if (seg.Header.Type == ELFProgramHeaderType.Note)
                {
                    ELFNoteList noteList = new ELFNoteList(seg.Contents);
                    foreach (ELFNote note in noteList.Notes)
                    {
                        if (note.Header.Type == ELFNoteType.File)
                        {
                            return(new ELFFileTable(note.Contents));
                        }
                    }
                }
            }

            throw new BadInputFormatException("No ELF file table found");
        }
Exemple #3
0
 private byte[] ReadBuildID()
 {
     foreach (ELFProgramSegment segment in Segments)
     {
         if (segment.Header.Type == ELFProgramHeaderType.Note)
         {
             ELFNoteList noteList = new ELFNoteList(segment.Contents);
             foreach (ELFNote note in noteList.Notes)
             {
                 ELFNoteType type = note.Header.Type;
                 if (type == ELFNoteType.PrpsInfo && note.Name.Equals("GNU"))
                 {
                     return(note.Contents.Read(0, (uint)note.Contents.Length));
                 }
             }
         }
     }
     return(null);
 }