elfwriter

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DelveHeaderNoteType = 0x444C5645 // DLVE
	DelveThreadNodeType = 0x444C5654 // DLVT

	DelveHeaderTargetPidPrefix  = "Target Pid: "
	DelveHeaderEntryPointPrefix = "Entry Point: "
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Note

type Note struct {
	Type elf.NType
	Name string
	Data []byte
}

type WriteCloserSeeker

type WriteCloserSeeker interface {
	io.Writer
	io.Seeker
	io.Closer
}

WriteCloserSeeker is the union of io.Writer, io.Closer and io.Seeker.

type Writer

type Writer struct {
	Err   error
	Progs []*elf.ProgHeader
	// contains filtered or unexported fields
}

Writer writes ELF files.

func New

func New(w WriteCloserSeeker, fhdr *elf.FileHeader) *Writer

New creates a new Writer.

func (*Writer) Align

func (w *Writer) Align(align int64)

Align writes as many padding bytes as needed to make the current file offset a multiple of align.

func (*Writer) Here

func (w *Writer) Here() int64

Here returns the current seek offset from the start of the file.

func (*Writer) Write

func (w *Writer) Write(buf []byte)

func (*Writer) WriteNotes

func (w *Writer) WriteNotes(notes []Note) *elf.ProgHeader

WriteNotes writes notes to the current location, returns a ProgHeader describing the notes.

func (*Writer) WriteProgramHeaders

func (w *Writer) WriteProgramHeaders()

WriteProgramHeaders writes the program headers at the current location and patches the file header accordingly.

Jump to

Keyboard shortcuts

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