Phase 1: bind delay-load imports at map time #1

Open
opened 2026-11-27 02:46:07 +00:00 by github-bot · 0 comments
Owner

@⁠FZNull on GitHub · 2026-11-22 07:15 UTC · original

Roadmap Phase 1 lists "Delay-load imports" as unchecked. src/loader/image.cpp today records delay modules only under delay_load_modules_untouched, while regular import slots are bound from the host resolver with an unresolved placeholder for the rest.

Proposal

  • For each delay descriptor that has a name table (pe::inspect already reports delay_imports entries with module, iat_rva and symbols), bind the IAT slots at map time exactly like the regular imports: write the resolved value from the resolver, or the same unresolved placeholder.
  • Extend the mapping report with delay slots, resolved, unresolved counts and per-symbol entries, keeping the existing status for descriptors without a name table.
  • Eager binding only: the mapper runs no code, so a lazy __delayLoadHelper path is out of scope for now.
  • Tests: extend tests/loader_image.cpp using the existing delay-load corpus fixture (synthetic), assert bound slots and counts, add a missing-symbol control, and keep a negative control where the resolver resolves nothing.

Layout and the RVA attribute bit follow the public Microsoft PE Format documentation for delay-load import descriptors. No game files, dumps or SDK content involved.

I can send a PR from a fork; opening this first per CONTRIBUTING. Questions welcome on whether eager binding at map time is the behavior you want.

**@⁠FZNull** on GitHub · 2026-11-22 07:15 UTC · [original](https://github.com/sammwyy/xvalkyrie/issues/1) Roadmap Phase 1 lists "Delay-load imports" as unchecked. `src/loader/image.cpp` today records delay modules only under `delay_load_modules_untouched`, while regular import slots are bound from the host resolver with an unresolved placeholder for the rest. **Proposal** - For each delay descriptor that has a name table (`pe::inspect` already reports `delay_imports` entries with `module`, `iat_rva` and `symbols`), bind the IAT slots at map time exactly like the regular imports: write the resolved value from the resolver, or the same unresolved placeholder. - Extend the mapping report with delay `slots`, `resolved`, `unresolved` counts and per-symbol entries, keeping the existing status for descriptors without a name table. - Eager binding only: the mapper runs no code, so a lazy `__delayLoadHelper` path is out of scope for now. - Tests: extend `tests/loader_image.cpp` using the existing delay-load corpus fixture (synthetic), assert bound slots and counts, add a missing-symbol control, and keep a negative control where the resolver resolves nothing. Layout and the RVA attribute bit follow the public Microsoft PE Format documentation for delay-load import descriptors. No game files, dumps or SDK content involved. I can send a PR from a fork; opening this first per CONTRIBUTING. Questions welcome on whether eager binding at map time is the behavior you want.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:46:07 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
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
github/sammwyy--xvalkyrie#1
No description provided.