Skip to content

feat(native): inspect offline ELF layout through pwntools - #1037

Merged
N0zoM1z0 merged 26 commits into
mainfrom
feat/binary-layout
Oct 8, 2026
Merged

N0zoM1z0 merged 26 commits into
mainfrom
feat/binary-layout

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Refs #969. General binary diagnostics; CTF is one showcase.

  • Add target-free inspect_binary_layout / inspect-binary-layout through unchanged BYO pwntools 4.15.0, pyelftools 0.33 and Unicorn 2.1.2. Initial profile: Linux x64, ELF64 x86-64 little-endian EXEC/DYN/REL.
  • Separate portable contracts, shared Evidence workflow, provider protocol and named CLI/MCP adapters. Return full results and normalized_result inline.
  • Preserve original section/segment/symbol/relocation identity, raw names/ranges and lossless numbers. Distinguish linked, section, TLS, alignment, absent and unresolved values; preserve RELR encoding and inferred offsets.
  • Bound dynamic tags and interpreter names; retain opaque dependency/path bytes with replacement-only display. Mitigation/GOT/PLT candidates and static Unicorn emulation remain separate from runtime behavior.
  • Own snapshots/process cleanup and preserve diagnostic truncation. Retain actual inherited limits or explicit unknowns. Interpret reserved memory/file-size exits only with matching failure-branch markers; bare launcher exits remain unverified. Preserve output through application cancellation and malformed-result errors.
  • Add provenance, guides and conditional real-tool CI. No engine installation, host configuration changes or target host launch. Recorded cores, GDB/pwndbg and instruction queries remain separate increments.

CLI / MCP

rea inspect-binary-layout ./selected.elf --json
{"name":"inspect_binary_layout","arguments":{"path":"/artifacts/selected.elf"}}

Verification

Current head: 1a740ea3, integrated with main 8d5c88f1 (including LLDB call observation). Catalog has136 tools; independent ELF diagnostics add one tool.

  • Domain/service/provider/SDK: 87 passed, one host skip. Latest-main catalog/contracts/CLI/MCP integration: 23 passed; seven advertised-schema checks passed.
  • npm run check:fast; npm run docs:check; regenerated metadata/documents and skill routing are current.
  • Fresh isolated installed proofs: 26 string-reference cases, 21 canonical-encoding cases, plus a separate five-case large MCP/reserved-index proof passed. The last21-case proof reproduced two earlier false successes. Package implementation matches source; inputs unchanged and descendants empty.
  • The earlier fixtures that used SHN_XINDEX for small indices were incorrectly considered valid; they are now malformed regressions. A genuine65,281-section fixture establishes actual large-index behavior. Its complete MCP result requires an explicitly enlarged SDK receive buffer and request timeout. Ordinary SDK-default cases remain covered.
  • Earlier resource/opaque-name proofs and CI are recorded separately. CI at 4ac0f1cb passed all30 checks, including146 public + four bootstrap cases. Current ordinary lane is149 public + four bootstrap; the optional large MCP lane is150 + four. All30 latest-head checks passed, including149 public + four bootstrap cases. Latest-head automated review completed with no new findings; all review threads resolved.
  • Fresh latest-main package smoke: four public ordinary/sectionless CLI/MCP cases and136-tool inventory passed. The bridge/provider/application bytes match source/dist. Large-result usability follow-up: [Feature] Add caller-selected views for large analysis results over MCP #1050.
  • Lower inherited memory/file/CPU limits, truncation, cancellation, launch failures and independent cleanup covered. Exec observations distinguish static Unicorn emulation from target host execution.

Hopper/Ghidra/LLDB were not run locally for this capability. No private game data, binary fixtures or reference clones committed/packaged.

@N0zoM1z0 N0zoM1z0 added enhancement New feature or request area: mcp MCP server, transport, and tool registration area: domain Domain logic, errors, and pure functions area: tests Test suite and verification labels Oct 8, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T06:19:40.495467Z 1a740ea Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@N0zoM1z0

N0zoM1z0 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0904e60ba8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@N0zoM1z0

N0zoM1z0 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27497895ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bridge/pwntools/layout.py Resolved
@N0zoM1z0

N0zoM1z0 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d17822e779

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bridge/pwntools/layout.py Resolved
@N0zoM1z0

N0zoM1z0 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35a0f5e343

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bridge/pwntools/layout.py Resolved
Comment thread bridge/pwntools/layout.py Resolved
Comment thread bridge/pwntools/layout.py Resolved
@N0zoM1z0

N0zoM1z0 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f87ed7321f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bridge/pwntools/layout.py Resolved
Comment thread bridge/pwntools/layout.py Resolved
@N0zoM1z0

N0zoM1z0 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b1713f0048

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bridge/pwntools/layout.py Resolved
@N0zoM1z0

N0zoM1z0 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 686ea0ee98

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@N0zoM1z0

N0zoM1z0 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80da8d3743

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bridge/pwntools/layout_impl.py Resolved
@N0zoM1z0

N0zoM1z0 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review the follow-up changes since 80da8d3, focusing on section-name table preflight, SHN_UNDEF, extended indices and the real regression fixtures. The previous full review findings are addressed; unchanged layers have already passed review and CI.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4ac0f1cb4d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bridge/pwntools/layout_impl.py Resolved
# Conflicts:
#	README_ar.md
#	README_ja.md
#	README_ko.md
#	README_zh.md
#	docs/product-catalog.json
#	docs/verification/managed-conformance-manifest.json
#	skills/reverse-engineer-anything/SKILL.md
@N0zoM1z0

N0zoM1z0 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review the follow-up changes since 4ac0f1c: raw/resolved SHN_XINDEX validation against the ELF ABI, source-owned canonical large-table fixtures, and the opt-in large-MCP verification lane. Main8d5c88f1 is integrated; unchanged layers have already passed full review/CI. Latest installed proofs and relevant integration checks are listed in the PR body.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 1a740ea368

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@N0zoM1z0 N0zoM1z0 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed final head 1a740ea3684d6aea87525daad4154973ac0b63f6 against main 8d5c88f1. No remaining blocking findings. All30 current-head checks passed, including the real installed CLI/MCP lane (149 public + four bootstrap cases), and the latest automated review completed without new findings. All review threads are resolved.

Verified the shared CLI/MCP Evidence boundary, input identity, exact uint64/raw-name preservation, resource failure markers, inherited limits, cancellation and owned cleanup. Latest local installed smoke passed four ordinary/sectionless CLI/MCP cases with the136-tool inventory; targeted malformed-input and genuine large-index MCP proofs passed separately. Original inputs remained unchanged; no descendants remained.

Scope remains Linux x64 ELF64 amd64 EXEC/DYN/REL through exact BYO upstream versions. Static Unicorn emulation is identified, and unknown runtime/mitigation/extended-symbol facets stay explicit. Large complete MCP output needs caller transport settings; it is opt-in in verification, with usability follow-up #1050. No Hopper/Ghidra/LLDB local claim is made. This is the ELF-layout increment of #969; pwndbg/recorded-core work remains open.

Ready to merge this exact head under the user's authorization.

@N0zoM1z0
N0zoM1z0 merged commit 4fc6565 into main Oct 8, 2026
30 checks passed
@N0zoM1z0
N0zoM1z0 deleted the feat/binary-layout branch October 8, 2026 06:22
kaoru0822-kitauji added a commit that referenced this pull request Oct 8, 2026
main now carries #1037 at skill version 30, so this branch moves to 31.
Regenerate the product catalog, conformance manifest, skill digest and
package metadata on top of it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
kaoru0822-kitauji added a commit that referenced this pull request Oct 8, 2026
main now carries #1037 at skill version 30, so this branch moves to 31.
Regenerate the product catalog, conformance manifest, skill digest and
package metadata on top of it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
kaoru0822-kitauji added a commit that referenced this pull request Oct 8, 2026
main now carries #1037 (skill version 30, reworded native binary row):
- README_ja/ar/ko/zh: take main's tables and count
  trace_dylib_resolution in the artifact graph row (5 -> 6).
- Skill: move to version 31.
- Regenerate the product catalog, conformance manifest, skill digest and
  package metadata (137 tools).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
kaoru0822-kitauji added a commit that referenced this pull request Oct 8, 2026
Bring in #927's merge of main (#1037 at skill version 30):
- README_ja/ar/ko/zh: keep the merged tables and count
  inspect_dyld_shared_cache in application workflows (13 -> 14).
- Skill: #927 now uses version 31, so this branch moves to 32.
- Regenerate the product catalog, conformance manifest, skill digest and
  package metadata (138 tools).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
* feat(native): inspect offline ELF layout through pwntools

* fix(build): prepare offline ELF verification on clean runners

* fix(native): preserve snapshot acquisition cancellation

* fix(native): handle sectionless ELF and retain decoder diagnostics

* test(native): verify malformed symbol table entry sizes

* fix(native): respect inherited limits and unused segment fields

* fix(native): preserve packed relocations and decoder launch constraints

* fix(native): validate symbol spans and preserve resource failures

* fix(native): preserve diagnostic completeness and memory failures

* fix(native): guard bridge imports against allocation failures

* fix(native): validate relocation symbol and section references

* fix(native): retain diagnostics through compounded cleanup failures

* fix(native): preserve unresolved relocation section references

* fix(native): bound linkage evidence and preserve CPU signal diagnostics

* fix(native): preserve file-size resource failure evidence

* fix(native): retain opaque linkage names and late cancellation output

* test(native): make CPU-limit fixture robust across runners

* fix(native): verify resource failure branches before interpreting exits

* fix(native): validate declared ELF string references

* fix(native): validate section-name table before decoding

* fix(native): enforce canonical ELF name-table escapes
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
main now carries morluto#1037 (skill version 30, reworded native binary row):
- README_ja/ar/ko/zh: take main's tables and count
  trace_dylib_resolution in the artifact graph row (5 -> 6).
- Skill: move to version 31.
- Regenerate the product catalog, conformance manifest, skill digest and
  package metadata (137 tools).
Iyanuoluwa007 pushed a commit to Iyanuoluwa007/rea that referenced this pull request Oct 21, 2026
Bring in morluto#927's merge of main (morluto#1037 at skill version 30):
- README_ja/ar/ko/zh: keep the merged tables and count
  inspect_dyld_shared_cache in application workflows (13 -> 14).
- Skill: morluto#927 now uses version 31, so this branch moves to 32.
- Regenerate the product catalog, conformance manifest, skill digest and
  package metadata (138 tools).
Iyanuoluwa007 pushed a commit to Iyanuoluwa007/rea that referenced this pull request Oct 21, 2026
main now carries morluto#1037 at skill version 30, so this branch moves to 31.
Regenerate the product catalog, conformance manifest, skill digest and
package metadata on top of it.
Iyanuoluwa007 pushed a commit to Iyanuoluwa007/rea that referenced this pull request Oct 21, 2026
main now carries morluto#1037 at skill version 30, so this branch moves to 31.
Regenerate the product catalog, conformance manifest, skill digest and
package metadata on top of it.
@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior provider: pwntools Analysis provider / engine: pwntools labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions area: mcp MCP server, transport, and tool registration area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: tests Test suite and verification enhancement New feature or request provider: pwntools Analysis provider / engine: pwntools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants