https://github.com/saferwall/elf
:gem: Go library to parse Executable and Linkable Format (ELF) files.
https://github.com/saferwall/elf
binary-analysis elf elf-binaries elf-format elf-parser go golang parser
Last synced: 5 days ago
JSON representation
:gem: Go library to parse Executable and Linkable Format (ELF) files.
- Host: GitHub
- URL: https://github.com/saferwall/elf
- Owner: saferwall
- License: apache-2.0
- Created: 2021-03-13T13:38:36.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-06-27T02:36:16.000Z (over 1 year ago)
- Last Synced: 2024-06-27T04:38:45.606Z (over 1 year ago)
- Topics: binary-analysis, elf, elf-binaries, elf-format, elf-parser, go, golang, parser
- Language: Go
- Homepage: https://saferwall.com
- Size: 1.59 MB
- Stars: 36
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ELF File Format Parser
[](https://pkg.go.dev/github.com/saferwall/elf)  [](https://goreportcard.com/report/github.com/saferwall/elf) [](https://codecov.io/gh/saferwall/elf) 
**elf** is a go package for parsing Executable and Linkable Format (ELF). This package is designed for static malware analysis and reverse engineering.
## Install
You can install the ```elf``` package and its dependencies using the ```go get``` command.
```sh
go get github.com/saferwall/elf
```
## Usage
```go
package main
import (
"encoding/json"
"fmt"
"github.com/saferwall/elf"
)
func main() {
p, err := elf.New("/bin/ls")
defer p.CloseFile()
if err != nil {
panic(err)
}
err = p.Parse()
if err != nil {
panic(err)
}
jsonFile, err := p.DumpJSON()
if err != nil {
panic(err)
}
fmt.Println(jsonFile)
}
```
## References
- https://refspecs.linuxfoundation.org/elf/elf.pdf
- https://github.com/freebsd/freebsd-src/blob/main/sys/sys/elf_common.h
