buildinfo

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

README

This code is a copied and slightly modified subset of go/src/debug/buildinfo.

It contains logic for parsing Go binary files for the purpose of extracting module dependency and symbol table information.

Logic added by vulncheck is located in files with "additions_" prefix.

Within the originally named files, changed or added logic is annotated with a comment starting with "Addition:".

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSymbols = errors.New("no symbol section")

ErrNoSymbols represents non-existence of symbol table in binaries supported by buildinfo.

Functions

This section is empty.

Types

type Symbol

type Symbol struct {
	Pkg  string `json:"pkg,omitempty"`
	Name string `json:"name,omitempty"`
}

func ExtractPackagesAndSymbols

func ExtractPackagesAndSymbols(bin io.ReaderAt) ([]*packages.Module, []Symbol, *debug.BuildInfo, error)

ExtractPackagesAndSymbols extracts symbols, packages, modules from bin as well as bin's metadata.

If the symbol table is not available, such as in the case of stripped binaries, returns module and binary info but without the symbol info.

Jump to

Keyboard shortcuts

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