Documentation ¶
Overview ¶
Package buildid provides functionality to extract the build ID from ELF binaries on Linux systems.
The build ID is a unique identifier embedded in an ELF binary that helps identify the specific build of the binary.
Example usage:
package main import ( "fmt" "path/to/buildid" ) func main() { buildID, err := buildid.FromPath("path/to/binary") if err != nil { fmt.Println("Error:", err) return } fmt.Println("Build ID:", buildID) }
Note: This package is intended for use on Linux systems only, as it relies on the ELF binary format.
For more information and detailed documentation, please refer to the package's README file and source code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromELF ¶
FromELF returns the build ID for an ELF binary.
This method takes `elf.File` as an input and will attempt to extract buildid using different methods:
- Reading the ".note.go.buildid" section for Go binaries.
- Reading the ".note.gnu.build-id" section for binaries with GNU build ID.
- Hashing the ".text" section if no build ID is found.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.