diff options
| author | jakeefr <jakeefr@users.noreply.github.com> | 2026-11-22 09:44:09 +0000 |
|---|---|---|
| committer | jakeefr <jakeefr@users.noreply.github.com> | 2026-11-22 10:00:48 +0000 |
| commit | 32c2a232998ced3631813f4078d6b233ae677f97 (patch) | |
| tree | d1a1058801b11377e7f9666014b037ff5aa221ea /runtime/src/thread_stacks.cpp | |
| parent | c0ac5fd6518b3ba9fa66765b8b07099990dadd74 (diff) | |
pe_inspect: honour NumberOfRvaAndSizes, map RVAs by virtual span, read long import names
Three places where the report on an image could be wrong, each reproduced with a synthetic image:
- Data directories: all 16 slots were read whatever NumberOfRvaAndSizes said, so stale bytes past the count showed
up as .pdata functions, TLS callbacks or a relocation directory (has_relocs decides whether the image can load
away from its preferred base). A slot past the count is now empty, as in runtime/src/pe_loader.cpp.
- RVA to file offset: a section's span was max(VirtualSize, SizeOfRawData), so a section whose raw data is longer
than the span to the next one answered the next section's RVAs from its own raw tail. The span is VirtualSize
(SizeOfRawData when that is 0), as the loader maps it.
- Names stopped at 512 characters: a longer decorated import name became "?", and a DLL with a longer name lost
its entry. The bound is 4,096 characters.
tests/test_pe_inspect.py: nine new tests, seven of which fail on the old code. No game files; synthetic images only.
Diffstat (limited to 'runtime/src/thread_stacks.cpp')
0 files changed, 0 insertions, 0 deletions