Skip to content

NumberOfRvaAndSizes is ignored when reading data directories #31

@IanLilleyT

Description

@IanLilleyT

Always reads 16 data directories, even when NumberOfRvaAndSizes is lower (SizeOfOptionalHeader is adjusted accordingly)

From the PE documentation:

Note that the number of directories is not fixed. Before looking for a specific directory, check the NumberOfRvaAndSizes field in the optional header.

Here's a simple executable showing the problem: test.exe (I had to add .txt to upload it here)

This file has two data directories. The rest are being interpreted from the section header, which starts at 0xD8 (notice how Resource Directory also thinks it's located at 0xD8).

image

Thanks for reading - this is a really nice tool!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions