Class NoteGnuBuildId

java.lang.Object
ghidra.app.util.bin.format.elf.info.ElfNote
ghidra.app.util.bin.format.elf.info.NoteGnuBuildId
All Implemented Interfaces:
ElfInfoItem

public class NoteGnuBuildId extends ElfNote
An ELF note that specifies the build-id (sha1/md5/etc hash or manually specified bytes that can be hex-ified) of the containing program.

The hex values of the build-id are useful to find an external debug file.

  • Field Details

  • Constructor Details

    • NoteGnuBuildId

      protected NoteGnuBuildId(int nameLen, String name, int vendorType, byte[] description)
  • Method Details

    • read

      public static NoteGnuBuildId read(ElfNote note, Program program) throws IOException
      Deserializes a NoteGnuBuildId from an already read generic Note.
      Parameters:
      note - generic Note
      program - context
      Returns:
      new NoteGnuBuildId instance, never null
      Throws:
      IOException - if data error
    • fromProgram

      public static NoteGnuBuildId fromProgram(Program program)
      Reads a NoteGnuBuildId from the standard ".note.gnu.build-id" section in the specified Program.
      Parameters:
      program - Program to read from
      Returns:
      new instance, or null if not found or data error
    • getNoteTypeName

      public String getNoteTypeName()
      Description copied from class: ElfNote
      Returns a string that describes this note's type, used when creating the default ElfNote.getProgramInfoKey() value.

      Specific Note subclasses can override this to return a better string than this default implementation, or can override the ElfNote.getProgramInfoKey() method.

      Overrides:
      getNoteTypeName in class ElfNote
      Returns:
      descriptive string
    • toStructure

      public StructureDataType toStructure(DataTypeManager dtm)
      Description copied from class: ElfNote
      Returns a Structure datatype that matches the format of this ElfNote, or null if this ElfNote shouldn't be represented/marked up.
      Overrides:
      toStructure in class ElfNote
      Parameters:
      dtm - DataTypeManager that will receive the structure
      Returns:
      StructureDataType that specifies the layout of the ElfNote, or null