From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:PE (Portable Executable)" |
|---|
| claim | "PE resources (data directory 2) are a three-level tree (type, name/id, language) of 16-byte IMAGE_RESOURCE_DIRECTORY headers, each followed by NumberOfNamedEntries + NumberOfIdEntries 8-byte entries {uint32 Name; uint32 OffsetToData}. Name bit 31 set: the low 31 bits are the offset of a counted UTF-16 name, else the low 16 bits are an id. OffsetToData bit 31 set: offset of a subdirectory, else of a 16-byte data entry {RVA, Size, CodePage, Reserved}. All offsets are relative to the start of the resource directory." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:PE (Portable Executable)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "IMAGE_RESOURCE_DIRECTORY" |
|---|
| size | 16 |
|---|
| fields | | offset | 0 |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "Characteristics" |
|---|
|
| offset | 4 |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "TimeDateStamp" |
|---|
|
| offset | 8 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "MajorVersion" |
|---|
|
| offset | 10 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "MinorVersion" |
|---|
|
| offset | 12 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "NumberOfNamedEntries" |
|---|
| notes | "named entries come first" |
|---|
|
| offset | 14 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "NumberOfIdEntries" |
|---|
|
|
|---|
| endianness | "little" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "resource directory, entry and data entry formats; NameIsString = Name >> 31, DataIsDirectory = OffsetToData >> 31" |
|---|
| repo | "https://github.com/erocarrera/pefile" |
|---|
| commit | "58186a92164842cf758822e067bc79c59b3c80d9" |
|---|
| path | "pefile.py" |
|---|
| lines | "2576-2596, 4938-4943" |
|---|
|
| type | "source" |
|---|
| detail | "Structure.__init__: 'Format is forced little endian', __format_str__ = "<"" |
|---|
| repo | "https://github.com/erocarrera/pefile" |
|---|
| commit | "58186a92164842cf758822e067bc79c59b3c80d9" |
|---|
| path | "pefile.py" |
|---|
| lines | "942-945" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "IMAGE_RESOURCE_DIRECTORY" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T10:17:25.038Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T12:52:45.495Z" |
|---|
| summary | "Byte order set: pefile forces '<' (little) for every PE structure" |
|---|
| changed | |
|---|
|
|
|---|