Documentation ¶
Index ¶
Constants ¶
View Source
const ( MAGIC_SIZE uint8 = 4 EI_CLASS uint8 = 4 EI_DATA uint8 = 5 EI_VERSION uint8 = 6 EI_OSABI uint8 = 7 EI_ABIVERSION uint8 = 8 EI_PADDING uint8 = 9 )
View Source
const ELF_MAGIC = "\x7FELF"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ProgramFlag ¶
type ProgramFlag uint32
const ( PF_X ProgramFlag = 1 PF_W ProgramFlag = 2 PF_R ProgramFlag = 4 PF_MASKOS ProgramFlag = 0x0ff00000 PF_MASKPROC ProgramFlag = 0xf0000000 )
type ProgramHeader ¶
type ProgramHeader struct { Type ProgramHeaderType Flags ProgramFlag Offset uint64 Vaddr uint64 Paddr uint64 Filesz uint64 Memsz uint64 Align uint64 }
type ProgramHeaderType ¶
type ProgramHeaderType uint32
const ( PT_NULL ProgramHeaderType = 0 PT_LOAD ProgramHeaderType = 1 PT_DYNAMIC ProgramHeaderType = 2 PT_INTERP ProgramHeaderType = 3 PT_NOTE ProgramHeaderType = 4 PT_SHLIB ProgramHeaderType = 5 PT_PHDR ProgramHeaderType = 6 PT_TLS ProgramHeaderType = 7 PT_NUM ProgramHeaderType = 8 PT_LOOS ProgramHeaderType = 0x60000000 PT_GNU_EH_FRAME ProgramHeaderType = 0x6474e550 PT_GNU_STACK ProgramHeaderType = 0x6474e551 PT_GNU_RELRO ProgramHeaderType = 0x6474e552 PT_HIOS ProgramHeaderType = 0x6fffffff PT_LOPROC ProgramHeaderType = 0x70000000 PT_HIPROC ProgramHeaderType = 0x7fffffff )
type Section ¶
type Section struct { Header SectionHeader Name string Raw []byte }
type SectionFlag ¶
type SectionFlag uint64
const ( SHF_WRITE SectionFlag = 0x1 SHF_ALLOC SectionFlag = 0x2 SHF_EXECINSTR SectionFlag = 0x4 SHF_MERGE SectionFlag = 0x10 SHF_STRINGS SectionFlag = 0x20 SHF_INFO_LINK SectionFlag = 0x40 SHF_LINK_ORDER SectionFlag = 0x80 SHF_OS_NONCONFORMING SectionFlag = 0x100 SHF_GROUP SectionFlag = 0x200 SHF_TLS SectionFlag = 0x400 SHF_COMPRESSED SectionFlag = 0x800 SHF_MASKOS SectionFlag = 0x0ff00000 SHF_MASKPROC SectionFlag = 0xf0000000 SHF_ORDERED SectionFlag = 0x40000000 SHF_EXCLUDE SectionFlag = 0x80000000 )
type SectionHeader ¶
type SectionHeader struct { Name uint32 Type SectionHeaderType Flags SectionFlag Addr uint64 Offset uint64 Size uint64 Link uint32 Info uint32 Addralign uint64 EntSize uint64 }
type SectionHeaderType ¶
type SectionHeaderType uint32
const ( SHT_NULL SectionHeaderType = 0 SHT_PROGBITS SectionHeaderType = 1 SHT_SYMTAB SectionHeaderType = 2 SHT_STRTAB SectionHeaderType = 3 SHT_RELA SectionHeaderType = 4 SHT_HASH SectionHeaderType = 5 SHT_DYNAMIC SectionHeaderType = 6 SHT_NOTE SectionHeaderType = 7 SHT_NOBITS SectionHeaderType = 8 SHT_REL SectionHeaderType = 9 SHT_SHLIB SectionHeaderType = 10 SHT_DYNSYM SectionHeaderType = 11 SHT_INIT_ARRAY SectionHeaderType = 14 SHT_FINI_ARRAY SectionHeaderType = 15 SHT_PREINIT_ARRAY SectionHeaderType = 16 SHT_GROUP SectionHeaderType = 17 SHT_SYMTAB_SHNDX SectionHeaderType = 18 SHT_LOOS SectionHeaderType = 0x60000000 SHT_HIOS SectionHeaderType = 0x6fffffff SHT_LOPROC SectionHeaderType = 0x70000000 SHT_HIPROC SectionHeaderType = 0x7fffffff SHT_LOUSER SectionHeaderType = 0x80000000 SHT_HIUSER SectionHeaderType = 0xffffffff )
type Segment ¶
type Segment struct { Header ProgramHeader Raw []byte }
Click to show internal directories.
Click to hide internal directories.