From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:PE (Portable Executable)" |
|---|
| claim | "On x64 the exception directory is an array of 12-byte RUNTIME_FUNCTION entries (BeginAddress, EndAddress, UnwindData, all RVAs) sorted by BeginAddress; UnwindData points to an UNWIND_INFO of Version:3/Flags:5, SizeOfProlog, CountOfCodes, FrameRegister:4/FrameOffset:4, an even-padded array of 2-byte unwind codes, then an optional handler RVA." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:PE (Portable Executable)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "RUNTIME_FUNCTION" |
|---|
| size | 12 |
|---|
| fields | | offset | 0 |
|---|
| size | 4 |
|---|
| type | "RVA" |
|---|
| name | "BeginAddress" |
|---|
|
| offset | 4 |
|---|
| size | 4 |
|---|
| type | "RVA" |
|---|
| name | "EndAddress" |
|---|
|
| offset | 8 |
|---|
| size | 4 |
|---|
| type | "RVA" |
|---|
| name | "UnwindData" |
|---|
| notes | "RVA of UNWIND_INFO: byte0 Version(3 bits) Flags(5: 1 EHANDLER, 2 UHANDLER, 4 CHAININFO); byte1 SizeOfProlog; byte2 CountOfCodes; byte3 FrameRegister(low 4) FrameOffset(high 4, x16); then codes padded to even count; then handler RVA when Flags & 3, or a chained RUNTIME_FUNCTION when Flags & 4" |
|---|
|
|
|---|
| endianness | "little" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "__RUNTIME_FUNCTION_format__, UnwindInfo class (bitfields, codes_cnt_max = (CountOfCodes + 1) & ~1, handler/FunctionEntry tail), unwind_info_flags" |
|---|
| repo | "https://github.com/erocarrera/pefile" |
|---|
| commit | "58186a92164842cf758822e067bc79c59b3c80d9" |
|---|
| path | "pefile.py" |
|---|
| lines | "365-371, 1804-1870, 2888-2891, 3796-3830" |
|---|
|
| 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 | "RUNTIME_FUNCTION and UNWIND_INFO (x64)" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T08:09:42.902Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T12:26:38.745Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read pefile.py: __RUNTIME_FUNCTION_format__ = three 'I' (BeginAddress, EndAddress, UnwindData) and unwind_info_flags UNW_FLAG_EHANDLER 1, UHANDLER 2, CHAININFO 4. I did not re-read the UnwindInfo bitfield/tail code. x64 only (ARM/ARM64 use different unwind records)." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T12:52:45.793Z" |
|---|
| summary | "Byte order set: pefile forces '<' (little) for every PE structure" |
|---|
| changed | |
|---|
|
|
|---|