https://github.com/offlinehacker/buildid
Go package to extract build ID from ELF binaries
https://github.com/offlinehacker/buildid
Last synced: 3 months ago
JSON representation
Go package to extract build ID from ELF binaries
- Host: GitHub
- URL: https://github.com/offlinehacker/buildid
- Owner: offlinehacker
- License: apache-2.0
- Created: 2024-07-05T13:38:21.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-07-05T15:08:06.000Z (12 months ago)
- Last Synced: 2025-03-15T04:46:18.611Z (3 months ago)
- Language: Go
- Size: 3.85 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ELF Build ID Extractor
This project provides a Go package for extracting the build ID from ELF binaries on Linux systems.
## Description
The `buildid` package allows you to retrieve the build ID from an ELF binary file. It supports extracting the build ID using the following methods:
1. Reading the `.note.go.buildid` section for Go binaries.
2. Reading the `.note.gnu.build-id` section for binaries with GNU build ID.
3. Hashing the `.text` section if no build ID is found.## Usage
```go
import "github.com/offlinehacker/buildid"buildID, err := buildid.FromPath("path/to/binary")
if err != nil {
// Handle the error
}fmt.Println("Build ID:", buildID)
```## Platform Support
Please note that this package is intended for use on Linux systems only, as it relies on the ELF binary format.
## License
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for more information.
## Contributing
Contributions to this project are welcome. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the project's GitHub repository.
## Acknowledgments
This project is based on code from [parca-agent](https://github.com/parca-dev/parca-agent/tree/main/pkg/buildid)