Skip to content

fix(native): share ELF, PE, and Mach-O framing across artifact readers - #12156

Merged
morluto merged 11 commits into
mainfrom
audit/parser-native-formats
Nov 19, 2026
Merged

morluto merged 11 commits into
mainfrom
audit/parser-native-formats

Conversation

@morluto

@morluto morluto commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Native and standalone readers now share ELF dynamic and note framing, PE header geometry, and Mach-O load command and section bounds. Carrier-specific readers preserve their own evidence and recovery policy.

The PE COFF-header consolidation and ELF section-extent checks are included through #12173 and #12175. ELF dependency names remain available when the linked string table can be admitted independently of conflicting symbol bytes.

Fixes #12125
Fixes #12130
Fixes #12136
Fixes #12142
Fixes #12143

Refs #7024 and #10371. Includes the stacked PE positional COFF header owner (#12173) and ELF section extent admission (#12175). The existing exception-directory draft remains separate.

Contract and boundary impact

Fixtures establish passive artifact-reader behavior. Windows loader behavior and real app execution remain unverified.

Evidence and regression coverage

Focused tests cover shared headers, read boundaries, compressed or zero-filled spans, PE resource order and distant headers, and carrier classification. The ELF review regression retained incorrect dependency names when an agreeing section covered a mapping gap and a zero-fill overlap. The shared mapper now keeps those two facts together and the dependency reader leaves the names unknown. Symbol and version table extents also have to agree across their full mapping. When symbol rows are unreadable, the agreed section header still establishes its independently validated string-table link and can retain library names.

Validation performed

  • Focused tests on Node 24.22.1 passed 525 checks across 12 files at d52734613c, including the public ELF CLI, MCP boundary, shared mapping parity, and standalone, PE, and managed readers.
  • npm run check:fast, npm run docs:check, and git diff --check passed.
  • At the combined head d52734613c, all 140 focused ELF dependency, binary mapping, desktop ELF reader, and PE admission tests passed on Node 24.22.1.

Author readiness

Human owner: @morluto

  • 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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@morluto
morluto marked this pull request as ready for review November 19, 2026 02:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T03:20:58.373789Z d527346 New commits
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The follow-up changes appear safe to merge; no new blocking issues were found.

Summary

The PR shares ELF, PE, and Mach-O structure readers while keeping each artifact reader’s recovery rules.

  • ELF readers frame notes the same way across artifact types.
  • ELF dependency readers use shared table and mapping rules.
  • PE readers share header geometry and follow declared resource locations.
  • Mach-O readers share load-command and section-bound checks.

The earlier mapping-gap and zero-fill finding is addressed. No new actionable issues were found in the follow-up changes. This review checked source and regression coverage; it did not run tests or establish loader behavior.

Reviews (4) · Last reviewed commit: "fix(elf): check load-map agreement acros..." · Reviewed by Greptile

Comment thread src/native/elf/ElfDependencyParser.ts Resolved
* fix(elf): check load-map agreement across section extents

* fix(elf): preserve agreed section links across unreadable tables
@morluto
morluto enabled auto-merge (squash) November 19, 2026 03:27
@morluto
morluto merged commit 0b19b06 into main Nov 19, 2026
44 of 46 checks passed
@morluto
morluto deleted the audit/parser-native-formats branch November 19, 2026 03:49
@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

1 participant