safeelf

package
v0.0.0-...-409fc48 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package safeelf provides safe (from panics) wrappers around ELF parsing

Index

Constants

View Source
const ELFCLASS32 = elf.ELFCLASS32
View Source
const ELFCLASS64 = elf.ELFCLASS64
View Source
const EM_AARCH64 = elf.EM_AARCH64
View Source
const EM_X86_64 = elf.EM_X86_64
View Source
const ET_DYN = elf.ET_DYN
View Source
const ET_EXEC = elf.ET_EXEC
View Source
const PF_W = elf.PF_W
View Source
const PF_X = elf.PF_X
View Source
const PT_LOAD = elf.PT_LOAD
View Source
const PT_TLS = elf.PT_TLS
View Source
const SHF_ALLOC = elf.SHF_ALLOC
View Source
const SHF_EXECINSTR = elf.SHF_EXECINSTR
View Source
const SHT_DYNSYM = elf.SHT_DYNSYM
View Source
const SHT_SYMTAB = elf.SHT_SYMTAB
View Source
const STB_GLOBAL = elf.STB_GLOBAL
View Source
const STT_FUNC = elf.STT_FUNC
View Source
const Sym32Size = elf.Sym32Size
View Source
const Sym64Size = elf.Sym64Size

Variables

View Source
var ErrNoSymbols = elf.ErrNoSymbols

Functions

This section is empty.

Types

type File

type File struct {
	*elf.File
}

File is a safe wrapper around *elf.File that handles any panics in parsing

func NewFile

func NewFile(r io.ReaderAt) (safe *File, err error)

NewFile reads an ELF safely.

Any panic during parsing is turned into an error. This is necessary since there are a bunch of unfixed bugs in debug/elf.

https://github.com/golang/go/issues?q=is%3Aissue+is%3Aopen+debug%2Felf+in%3Atitle

func Open

func Open(path string) (safe *File, err error)

Open reads an ELF from a file.

It works like NewFile, with the exception that safe.Close will close the underlying file.

func (*File) DWARF

func (se *File) DWARF() (d *dwarf.Data, err error)

DWARF is the safe version of elf.File.DWARF.

func (*File) DynamicSymbols

func (se *File) DynamicSymbols() (syms []Symbol, err error)

DynamicSymbols is the safe version of elf.File.DynamicSymbols.

func (*File) Symbols

func (se *File) Symbols() (syms []Symbol, err error)

Symbols is the safe version of elf.File.Symbols.

type Prog

type Prog = elf.Prog

type Section

type Section = elf.Section

type SectionIndex

type SectionIndex = elf.SectionIndex

type SectionType

type SectionType = elf.SectionType

type Symbol

type Symbol = elf.Symbol

Jump to

Keyboard shortcuts

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