Package ghidra.app.util.bin.format.elf
Class ElfCompressedSectionHeader
java.lang.Object
ghidra.app.util.bin.format.elf.ElfCompressedSectionHeader
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the address alignment value.longReturns the uncompressed size.intReturns the compression type, see ELFCOMPRESS_ZLIB.intReturns the size of this header struct.static ElfCompressedSectionHeaderread(BinaryReader reader, ElfHeader elf) Reads an Elf(32|64)_Chdr from the current position in the supplied stream.
-
Field Details
-
ELFCOMPRESS_ZLIB
public static final int ELFCOMPRESS_ZLIB- See Also:
-
-
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 fromelf- ElfHeader that defines the format of the binary- Returns:
- new
ElfCompressedSectionHeaderinstance, 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..- Returns:
- the address alignment value
-
getHeaderSize
public int getHeaderSize()Returns the size of this header struct.- Returns:
- the size of this header struct
-