Skip to content

refactor(pe): share positional COFF header observation - #12173

Merged
morluto merged 1 commit into
audit/parser-native-formatsfrom
audit/parser-pe-coff-frame
Nov 19, 2026
Merged

morluto merged 1 commit into
audit/parser-native-formatsfrom
audit/parser-pe-coff-frame

Conversation

@morluto

@morluto morluto commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Summary

Share the positional PE signature and COFF observation across the native section directory and the PE resource and certificate header reader. The producer returns parsed COFF facts from one bounded frame. A standard PE whose header lies outside the DOS prefix now requires one request for the signature and COFF record.

This is the focused PE framing follow-up to #12156 and the duplicated header thread in #7024. The exception-directory feature remains in its existing draft.

Contract and boundary impact

Each reader keeps its current admission policy for overlapping DOS layouts, PE header extents, malformed declarations and unsupported formats. A short NE signature can still establish its Windows format without a complete PE COFF record. Resource RVA mapping and the certificate table's file-offset interpretation remain with their consumers. There is no package, CLI or MCP schema change.

Validation performed

  • The conformance regression failed on the previous head with reads of four and twenty bytes at the same declared frame. It passes with one 24-byte request. A separate case verifies a two-byte NE signature at the file end.
  • Eight focused suites passed 313 tests, including compiled CLI and stdio MCP PE resource inspection, PE certificates, native sections, SEA, and Deno.
  • npm run check:fast and git diff --check passed. The verification used authored fixtures and no live Windows loader or provider.

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.

@morluto
morluto marked this pull request as ready for review November 19, 2026 03:08
@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:10:07.268016Z d62f273 Draft marked ready
ℹ️ 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

[Medium impact] The reviewed changes appear safe to merge.

Summary

This refactor gives native sections and PE resource/certificate readers one shared reader for the PE signature and COFF header.

  • PE readers now share one read for the signature and COFF header.

No actionable issues found. No higher replacement PR is listed in the supplied stack. Tests were not run during this review.

Reviews (1) · Last reviewed commit: "refactor(pe): share positional COFF head..." · Reviewed by Greptile

@morluto
morluto merged commit 7bf32dc into audit/parser-native-formats Nov 19, 2026
1 check passed
@morluto
morluto deleted the audit/parser-pe-coff-frame branch November 19, 2026 03:12
morluto added a commit that referenced this pull request Nov 19, 2026
#12156)

* fix(elf): share dynamic table singleton validation

* fix(elf): share note storage and framing across readers

Refs #12130

* fix(elf): retain zero-filled load mapping ambiguity

Refs #12136

* fix(pe): share header extent admission

Refs #12143

* fix(macho): share embedded section backing checks

Refs #12142

* fix(pe): share header facts and validate resource directory order

* fix(macho): require complete carrier load command framing

* fix(pe): probe declared resource headers by file offset

* fix(elf): preserve zero-fill observations across mapping gaps

* refactor(pe): share positional COFF header observation (#12173)

* fix(elf): check load-map agreement across section extents (#12175)

* fix(elf): check load-map agreement across section extents

* fix(elf): preserve agreed section links across unreadable tables
@morluto morluto added the area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior label 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant