Class ElfCompressedSectionHeader

java.lang.Object
ghidra.app.util.bin.format.elf.ElfCompressedSectionHeader

public class ElfCompressedSectionHeader extends Object
Header at the beginning of an ELF compressed section.

See https://docs.oracle.com/cd/E53394_01/html/E54813/section_compression.html

 typedef struct {
      Elf32_Word      ch_type;
      Elf32_Word      ch_size;
      Elf32_Word      ch_addralign;
 } Elf32_Chdr;
 
 typedef struct {
      Elf64_Word      ch_type;
      Elf64_Word      ch_reserved;
      Elf64_Xword     ch_size;
      Elf64_Xword     ch_addralign;
 } Elf64_Chdr;
 
  • Field Details

  • Method Details

    • read

      public static ElfCompressedSectionHeader read(BinaryReader reader, ElfHeader elf) throws IOException
      Reads an Elf(32|64)_Chdr from the current position in the supplied stream.
      Parameters:
      reader - stream to read from
      elf - ElfHeader that defines the format of the binary
      Returns:
      new ElfCompressedSectionHeader instance, never null
      Throws:
      IOException - if error reading the header
    • getCh_type

      public int getCh_type()
      Returns the compression type, see ELFCOMPRESS_ZLIB.
      Returns:
      the compression type, see ELFCOMPRESS_ZLIB
    • getCh_size

      public long getCh_size()
      Returns the uncompressed size.
      Returns:
      the uncompressed size
    • getCh_addralign

      public long getCh_addralign()
      Returns the address alignment value..

      See ElfSectionHeader.getAddressAlignment()

      Returns:
      the address alignment value
    • getHeaderSize

      public int getHeaderSize()
      Returns the size of this header struct.
      Returns:
      the size of this header struct