elf

package
v0.0.0-...-4f60042 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ELF32Header

type ELF32Header struct {
	Mag0       byte
	Mag1       byte
	Mag2       byte
	Mag3       byte
	Class      byte
	Data       byte
	EIVersion  byte
	OsABI      byte
	ABIVersion byte
	Pad        [7]byte
	Type       uint16
	Machine    uint16
	EVersion   uint32
	// <32bit sizes>
	Entry uint32
	PhOff uint32
	Shoff int32
	// </32bit sizes>
	Flags     uint32
	EhSize    uint16
	PhEntSize uint16
	PhNum     uint16
	Shentsize uint16
	Shnum     uint16
	ShStrNdx  uint16
}

type ELF64Header

type ELF64Header struct {
	Mag0       byte
	Mag1       byte
	Mag2       byte
	Mag3       byte
	Class      byte
	Data       byte
	EIVersion  byte
	OsABI      byte
	ABIVersion byte
	Pad        [7]byte
	Type       uint16
	Machine    uint16
	EVersion   uint32
	// <64bit sizes>
	Entry uint64
	PhOff uint64
	Shoff int64
	// </64bit sizes>
	Flags     uint32
	EhSize    uint16
	PhEntSize uint16
	PhNum     uint16
	Shentsize uint16
	Shnum     uint16
	ShStrNdx  uint16
}

type File

type File struct {
	ELF64Header
	// contains filtered or unexported fields
}

func Open

func Open(file *os.File) (*File, error)

func (*File) Section

func (f *File) Section(name string) *Section

type Section

type Section struct {
	// contains filtered or unexported fields
}

func (*Section) Data

func (s *Section) Data() ([]byte, error)

func (*Section) Length

func (s *Section) Length() int

func (*Section) Offset

func (s *Section) Offset() int

type SectionHeader32

type SectionHeader32 struct {
	Shname uint32
	Shtype uint32
	// <32bit sizes>
	Shflags  uint32
	Shaddr   uint32
	Shoffset uint32
	Shsize   uint32
	// </32bit sizes>
	Shlink uint32
	Shinfo uint32
	// <32bit sizes>
	Shaddralign uint32
	Shentsize   uint32
}

type SectionHeader64

type SectionHeader64 struct {
	Shname uint32
	Shtype uint32
	// <64bit sizes>
	Shflags  uint64
	Shaddr   uint64
	Shoffset uint64
	Shsize   uint64
	// </64bit sizes>
	Shlink uint32
	Shinfo uint32
	// <64bit sizes>
	Shaddralign uint64
	Shentsize   uint64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL