coff

package
v0.0.0-...-43d74b8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package coff provides COFF(Common Object File Format)-related functionalities.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSectionExists   = errors.New("section with given name already exists")
	ErrSectionNotFound = errors.New("section not found")
)

common errors

Functions

This section is empty.

Types

type File

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

File is a COFF file.

func New

func New() *File

New returns newly created COFF file.

func (*File) AddSection

func (f *File) AddSection(s Section) error

AddSection adds section s to file.

func (*File) Section

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

Section finds a section by its name and returns it if found.

func (*File) WriteTo

func (f *File) WriteTo(w io.Writer) (int64, error)

WriteTo writes COFF file data to w.

type Relocation

type Relocation interface {
	VirtualAddress() uint32
}

Relocation is a COFF relocation.

type Section

type Section interface {
	Name() string
	WriteTo(w io.Writer) (int64, error)
	Size() int
	Relocations() []Relocation
}

Section is a COFF section.

Jump to

Keyboard shortcuts

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