[PR #4837] [MERGED] feat(elf): inspect PT_NOTE and SHT_NOTE tables #6438

Closed
opened 2026-10-31 01:14:27 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4837
Author: @mvanhorn
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix/elf-notes


📝 Commits (10+)

  • 3f8b998 feat(elf): inspect PT_NOTE and SHT_NOTE tables
  • 325de37 fix(elf): pad note name and descriptor to table alignment
  • da5d634 fix(elf): bound note parsing and share the architecture map
  • e289d01 Merge main to pick up current docs and checks
  • e3adf57 docs: list ELF notes in the translated READMEs
  • 0151a3f fix(elf): charge failed section-name scans to the text budget
  • 43974ac Merge main to resolve conflicts with current docs and tools
  • a67c319 fix(elf): hash and scan each repeated note descriptor once
  • 9b9d446 Merge main to resolve README table conflicts
  • a1ead5e fix(elf): reject note tables that extend past the file

📊 Changes

54 files changed (+2278 additions, -29 deletions)

View changed files

📝 .agents/skills/reverse-engineer-anything/SKILL.md (+6 -0)
📝 .agents/skills/reverse-engineer-anything/references/native-and-artifacts.md (+11 -0)
📝 README.md (+1 -0)
📝 docs/.vitepress/config.ts (+1 -0)
📝 docs/cli.md (+10 -0)
➕ docs/elf-notes.md (+53 -0)
📝 docs/index.md (+1 -1)
📝 docs/readme/README_ar.md (+1 -0)
📝 docs/readme/README_de.md (+1 -0)
📝 docs/readme/README_el.md (+1 -0)
📝 docs/readme/README_es.md (+1 -0)
📝 docs/readme/README_fa.md (+1 -0)
📝 docs/readme/README_fr.md (+1 -0)
📝 docs/readme/README_id.md (+1 -0)
📝 docs/readme/README_it.md (+1 -0)
📝 docs/readme/README_ja.md (+1 -0)
📝 docs/readme/README_ko.md (+1 -0)
📝 docs/readme/README_ml.md (+1 -0)
📝 docs/readme/README_pl.md (+1 -0)
📝 docs/readme/README_pt-BR.md (+1 -0)

...and 34 more files

📄 Description

Summary

Add inspect_elf_notes / inspect-elf-notes for one explicit local ELF32/ELF64
image. The workflow reads PT_NOTE program headers and SHT_NOTE sections
independently and returns owners, types, descriptor SHA-256, and GNU build-id,
ABI-tag, and gold-version fields when those descriptors match.

It does not execute the image or consult a package catalog. The same file range
may appear twice when both tables declare it. A missing table list is observed
absence of those declarations. Malformed ELF headers, truncated notes, and
exhausted budgets fail without partial success. ELF extended numbering is
unsupported.

Note name and descriptor padding follows the containing table's alignment
(4 or 8, with 0/1 treated as 4), measured from the start of each note, so
8-aligned .note.gnu.property entries in ordinary GNU/Linux binaries parse.

Usage

rea inspect-elf-notes /absolute/path/to/program --json

MCP: inspect_elf_notes with an absolute path.

Tests

  • npm run check:fast
  • npm run test:local -- domain, parser, and service tests, including 8-aligned PT_NOTE and SHT_NOTE fixtures (18 passed)
  • npm run test:focused -- CLI, MCP, and filesystem tests (7 passed)
  • Parsed /bin/ls, /usr/bin/env, and a gcc -Wl,--build-id binary: GNU property, build-id, and ABI-tag notes listed in both tables

Demo

demo

Author readiness

Human owner: @mvanhorn

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4837 **Author:** [@mvanhorn](https://github.com/mvanhorn) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix/elf-notes` --- ### 📝 Commits (10+) - [`3f8b998`](https://github.com/morluto/rea/commit/3f8b998020e6e905672bae2843c060cac958db8c) feat(elf): inspect PT_NOTE and SHT_NOTE tables - [`325de37`](https://github.com/morluto/rea/commit/325de379a65aa28a76adb00b6fab9c2e0eeb7008) fix(elf): pad note name and descriptor to table alignment - [`da5d634`](https://github.com/morluto/rea/commit/da5d6341d7f168a2a092ee6c82d092f54509957e) fix(elf): bound note parsing and share the architecture map - [`e289d01`](https://github.com/morluto/rea/commit/e289d01e22f7b85ddd75b32a0f91994d13b621f0) Merge main to pick up current docs and checks - [`e3adf57`](https://github.com/morluto/rea/commit/e3adf57f46deecf3849c771aac7049784de45c55) docs: list ELF notes in the translated READMEs - [`0151a3f`](https://github.com/morluto/rea/commit/0151a3fe663afd5807afef98c7839f19cc53ca98) fix(elf): charge failed section-name scans to the text budget - [`43974ac`](https://github.com/morluto/rea/commit/43974ac745fd3e30e076d4c94d76dd89f3390e1c) Merge main to resolve conflicts with current docs and tools - [`a67c319`](https://github.com/morluto/rea/commit/a67c319960677f26abc63e23a07028c5462fbeb8) fix(elf): hash and scan each repeated note descriptor once - [`9b9d446`](https://github.com/morluto/rea/commit/9b9d446544bc4d9c2f4ab85c391aa06e5a54d5ef) Merge main to resolve README table conflicts - [`a1ead5e`](https://github.com/morluto/rea/commit/a1ead5e59a2d8ba0a89ecf5d8ff75ec551dad7a6) fix(elf): reject note tables that extend past the file ### 📊 Changes **54 files changed** (+2278 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/reverse-engineer-anything/SKILL.md` (+6 -0) 📝 `.agents/skills/reverse-engineer-anything/references/native-and-artifacts.md` (+11 -0) 📝 `README.md` (+1 -0) 📝 `docs/.vitepress/config.ts` (+1 -0) 📝 `docs/cli.md` (+10 -0) ➕ `docs/elf-notes.md` (+53 -0) 📝 `docs/index.md` (+1 -1) 📝 `docs/readme/README_ar.md` (+1 -0) 📝 `docs/readme/README_de.md` (+1 -0) 📝 `docs/readme/README_el.md` (+1 -0) 📝 `docs/readme/README_es.md` (+1 -0) 📝 `docs/readme/README_fa.md` (+1 -0) 📝 `docs/readme/README_fr.md` (+1 -0) 📝 `docs/readme/README_id.md` (+1 -0) 📝 `docs/readme/README_it.md` (+1 -0) 📝 `docs/readme/README_ja.md` (+1 -0) 📝 `docs/readme/README_ko.md` (+1 -0) 📝 `docs/readme/README_ml.md` (+1 -0) 📝 `docs/readme/README_pl.md` (+1 -0) 📝 `docs/readme/README_pt-BR.md` (+1 -0) _...and 34 more files_ </details> ### 📄 Description ## Summary Add `inspect_elf_notes` / `inspect-elf-notes` for one explicit local ELF32/ELF64 image. The workflow reads `PT_NOTE` program headers and `SHT_NOTE` sections independently and returns owners, types, descriptor SHA-256, and GNU build-id, ABI-tag, and gold-version fields when those descriptors match. It does not execute the image or consult a package catalog. The same file range may appear twice when both tables declare it. A missing table list is observed absence of those declarations. Malformed ELF headers, truncated notes, and exhausted budgets fail without partial success. ELF extended numbering is unsupported. Note name and descriptor padding follows the containing table's alignment (4 or 8, with 0/1 treated as 4), measured from the start of each note, so 8-aligned `.note.gnu.property` entries in ordinary GNU/Linux binaries parse. ## Usage ```bash rea inspect-elf-notes /absolute/path/to/program --json ``` MCP: `inspect_elf_notes` with an absolute `path`. ## Tests - `npm run check:fast` - `npm run test:local --` domain, parser, and service tests, including 8-aligned PT_NOTE and SHT_NOTE fixtures (18 passed) - `npm run test:focused --` CLI, MCP, and filesystem tests (7 passed) - Parsed `/bin/ls`, `/usr/bin/env`, and a gcc `-Wl,--build-id` binary: GNU property, build-id, and ABI-tag notes listed in both tables ## Demo ![demo](https://raw.githubusercontent.com/mvanhorn/pr-demo-assets/main/rea/elf-notes/demo.gif) <video src="https://raw.githubusercontent.com/mvanhorn/pr-demo-assets/main/rea/elf-notes/demo.mp4" controls width="720"></video> ## Author readiness Human owner: @mvanhorn - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:14:27 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6438
No description provided.