{"id":17650874,"url":"https://github.com/yalue/elf_reader","last_synced_at":"2025-05-07T03:20:28.681Z","repository":{"id":57483185,"uuid":"72865674","full_name":"yalue/elf_reader","owner":"yalue","description":"A Go library for reading and parsing ELF files","archived":false,"fork":false,"pushed_at":"2024-03-21T14:44:55.000Z","size":984,"stargazers_count":30,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T17:57:56.495Z","etag":null,"topics":["elf","elf-binaries","elf-files","elf-format","elf-header","elf-parser","elf64","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yalue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-04T16:31:08.000Z","updated_at":"2025-03-28T17:12:27.000Z","dependencies_parsed_at":"2024-11-09T08:01:06.268Z","dependency_job_id":"0550fdc5-1618-4231-b48a-8bfc37e28da1","html_url":"https://github.com/yalue/elf_reader","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yalue%2Felf_reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yalue%2Felf_reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yalue%2Felf_reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yalue%2Felf_reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yalue","download_url":"https://codeload.github.com/yalue/elf_reader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252804639,"owners_count":21806844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elf","elf-binaries","elf-files","elf-format","elf-header","elf-parser","elf64","golang"],"created_at":"2024-10-23T11:39:41.819Z","updated_at":"2025-05-07T03:20:28.623Z","avatar_url":"https://github.com/yalue.png","language":"Go","readme":"ELF Reader\n==========\n\nAbout\n-----\n\nThis library is for reading ELF files using the Go programming language. Go's\nstandard library already includes ELF-related functions, but these do not\ninclude some useful functionality for displaying or accessing some aspects of\nELF files out-of-the-box.\n\nThis library supports both big and little-endian 32- and 64-bit ELF files. You\ncan specifically read 32-bit files by calling `ParseELF32File(...)`, or 64-bit\nfiles by `ParseELF64File(...)`, or either type of file using\n`ParseELFFile(...)`. If you use the generic `ParseELFFile(...)` function, then\nyou can either use the returned `ELFFile` interface directly, or use type\nassertions to retrieve a 32-bit `*ELF32File` or a 64-bit `*ELF64File`.\n\nUsage\n-----\n\nThe following example shows how this library can be used to output section\nnames to standard output. For a more complete example of how to read\ninformation from an ELF file, see the command-line tool at\n`elf_view/elf_view.go`.\n\n```go\nimport (\n\t\"fmt\"\n\t\"github.com/yalue/elf_reader\"\n\t\"os\"\n)\n\nfunc main() {\n\t// Print the section names in /bin/bash. This code will work on both 32-bit\n\t// and 64-bit systems.\n\traw, e := os.ReadFile(\"/bin/bash\")\n\tif e != nil {\n\t\tfmt.Printf(\"Failed reading /bin/bash: %s\\n\", e)\n\t\treturn\n\t}\n\telf, e := elf_reader.ParseELFFile(raw)\n\tif e != nil {\n\t\tfmt.Printf(\"Failed parsing ELF file: %s\\n\", e)\n\t\treturn\n\t}\n\tcount := elf.GetSectionCount()\n\tfor i := uint16(0); i \u003c count; i++ {\n\t\tif i == 0 {\n\t\t\tfmt.Printf(\"Section 0: NULL section (no name)\\n\")\n\t\t\tcontinue\n\t\t}\n\t\tname, e := elf.GetSectionName(uint16(i))\n\t\tif e != nil {\n\t\t\tfmt.Printf(\"Failed getting section %d name: %s\\n\", i, e)\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Printf(\"Section %d name: %s\\n\", i, name)\n\t}\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyalue%2Felf_reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyalue%2Felf_reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyalue%2Felf_reader/lists"}