exe

package
v0.0.0-...-df5f45c Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSymbolNotFound is returned when a symbol is requested that cannot be located
	ErrSymbolNotFound = errors.New("symbol not found")
	// ErrSectionNotFound is returned when a section is requested that cannot be located
	ErrSectionNotFound = errors.New("section not found")
)

Functions

This section is empty.

Types

type File

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

File represents an executable file

func New

func New(r io.ReaderAt) (*File, error)

New creates a new File instance

func (*File) ByteOrder

func (e *File) ByteOrder() binary.ByteOrder

ByteOrder returns the byte order (little or big endian)

func (*File) PCLNTabSection

func (e *File) PCLNTabSection() (Section, error)

PCLNTabSection returns the Go PCLN table section

func (*File) RODataSection

func (e *File) RODataSection() (Section, error)

RODataSection returns the read-only data section

func (*File) SectionContainingRange

func (e *File) SectionContainingRange(addrRange address.Range) (Section, error)

SectionContainingRange returns the section that fully contains the supplied range

func (*File) Symbol

func (e *File) Symbol(name string) (Symbol, error)

Symbol locates a symbol by name

func (*File) SymbolsForAddresses

func (e *File) SymbolsForAddresses(addrs []uint64) (map[uint64]Symbol, error)

SymbolsForAddresses locates at most one symbol for each address. Not every address may resolve to a symbol; in such cases the address will not feature in the returned map.

func (*File) TextSection

func (e *File) TextSection() (Section, error)

TextSection returns the text section

type Section

type Section struct {
	Name      string
	AddrRange address.Range
	io.ReaderAt
}

Section represents a particular section of a binary

func (Section) Data

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

Data returns the raw bytes for this particular section

type Symbol

type Symbol struct {
	Name      string
	AddrRange address.Range
}

Symbol represents a symbol compiled into an executable

Jump to

Keyboard shortcuts

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