Repository navigation
Conversation
[Medium impact] The code changes appear safe to merge, with no blocking issue found. SummaryAdds legacy PE32 delay-import decoding and makes six delay-descriptor address fields nullable.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
D["Delay descriptor"] --> F{"Legacy VA form?"}
F -- No --> R["Use stored RVAs"]
F -- Yes --> P{"PE32?"}
P -- No --> U["Report unsupported_form"]
P -- Yes --> N["Normalize each address independently"]
N --> K["Keep readable facts; failed addresses become null"]
K --> S["Shared schema and Evidence"]
R --> S
S --> C["CLI and MCP"]
Reviews (3) · Last reviewed commit: "chore(pe): merge current main for PR val..." · Reviewed by Greptile |
BREAKING CHANGE: delay-descriptor RVA fields may be null when a legacy address cannot be normalized. Numeric zero still denotes an absent pointer.
|
TL;DR: All 72 tests in the 3 changed test files passed on each Node version. With the two source files swapped back to the merge base, 14 tests failed on each. I did not merge with current main or run the PE32 probe.
The 3 test files are The log for Node 24.22.1 names all 14 failing tests. Twelve are in The PR changes 7 files against the merge base: 3 test files and 4 others. The head is 187 commits behind main c78c8ae. CI on head dd4ee51, read live with
Not run
Test setupCommandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/native/pe/PeImportParser.test.ts tests/acceptance/peImportsCli.test.ts tests/boundary/mcp/peImportsMcp.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
|
@ArjenS-LA thanks for the PR — this branch has merge conflicts with |
Summary
Adds legacy PE32 delay-import decoding to
inspect-pe-imports/inspect_pe_imports. Previously every descriptor using virtual addresses was skipped as unsupported. Descriptor address fields and named thunks now normalize against the preferred image base; ordinal thunks retain their original interpretation.The partial-facts review finding is addressed in
0d0bb2da: each descriptor address is normalized independently. A bad optional module-handle, bound, or unload pointer no longer hides readable DLL/functions. Invalid addresses becomenullwith field-specific issues containing the original VA and source location. An invalid name pointer leaves the name unknown while preserving functions; an invalid required table pointer preserves descriptor facts with functions undecoded.The format follows the Microsoft PE specification and historical VC6 description. No related issue was found.
Contract and boundary impact
PeImportParserowns normalization once. Consumers use its parsed fields; no adapter-specific reinterpretation.nullwhen normalization fails:name_rva,import_address_table_rva,import_name_table_rva,module_handle_rva,bound_import_rva, andunload_information_table_rva. Consumers must handle unknown addresses instead of assuming numbers. Encoded zero still means absent; historical numeric reports remain accepted. Returning zero for an invalid pointer would falsely report absence.Expected effects:
Current branch validation (2026-11-05)
Merged upstream main
a7574d4274728fcb0a13414d6ae43f1597864d94into the existing branch indd4ee510. The local merge was conflict-free and retains the original focused PR diff.Windows x64, Node 24.22.1, npm 11.16.0:
npm run test:focused -- src/native/pe/PeImportParser.test.ts tests/acceptance/peImportsCli.test.ts tests/boundary/mcp/peImportsMcp.test.ts: 72 passed, covering parser, CLI and MCP behavior after rebuilding runtime/skill artifacts.npm run docs:check: passed, including generated metadata checks and 9 consistency tests.npm run check:fast: typecheck and lint passed; normal pre-push validation passed.git diff --check: passed. Commit hooks ran; their unrelated JavaScript import rewrite was removed from the unpublished merge, restoring the exact validated tree.Prior implementation validation
Prior head
0d0bb2da, Windows x64, Node 24.22.1, npm 11.16.0:npm run test:focused -- src/native/pe/PeImportParser.test.ts tests/acceptance/peImportsCli.test.ts tests/boundary/mcp/peImportsMcp.test.ts: 72 passed. Covers each invalid descriptor pointer, simultaneous optional failures, named/ordinal retention, zero-versus-null semantics, required-table failures, budgets, and standard imphash isolation.npm run check: passed, including type-aware lint (0 errors).npm run docs:check: passed, including generated metadata and 9 consistency tests.check:fast, andgit diff --check: passed; hooks preserved the validated file contents.Coverage limits: legacy cases use synthetic PE32 fixtures; no historical VC6-built binary or independent pefile runtime comparison was executed. The earlier unchanged filesystem test was blocked at Windows symlink creation (
EPERM); that lane was not rerun for this update. No performance claim.Author readiness
Human owner: @ArjenS-LA
Prepared with Codex assistance; opened as a draft for human review.