Documentation
¶
Index ¶
- func DirName() string
- func Fatal(f string, args ...any)
- func FatalErr(what string, err error)
- func InOutFiles(inName, inSuffix, outName, outSuffix string) (string, string)
- func Module() string
- func OpenUSB(vendor, product usb.ID, busAddr string) (ctx *usb.Context, devs []*usb.Device, err error)
- func PadBytes(cache *[]byte, n int, b byte) []byte
- func Progress(pre string, cur, max, scale int, post string)
- func SetGOENV(always bool)
- func Warn(f string, args ...any)
- type Section
- type Sections
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirName ¶ added in v0.4.1
func DirName() string
DirName returns the last element of the path to the current working directory.
func InOutFiles ¶
InOutFiles infers the name of the input and output files from the name of the current working directory if the inName is an empty strings.
Types ¶
type Sections ¶
type Sections []*Section
func ReadBins ¶
ReadBins reads binary files acording to the description and returns them as a slice of sections.
func ReadELF ¶
ReadELF reads the loadable sections of the program and returns them as a slice. The order of the returned sections is unspecified. It returns at least one section or error.
func (Sections) Flatten ¶
Flatten flattens sections by writting their data to the provided io.Writer according to the Paddr field (before writting the sections are sorted using SortPaddr method). The gaps between sections are filled using the pad byte.
func (Sections) Size ¶
Size returns the total size of sections data. It may be less than the size of flatten binary because it doesn't take into account possible gaps between sections.
func (Sections) SortByPaddr ¶
func (ss Sections) SortByPaddr()
SortByPaddr sorts sections according to the Paddr field.