From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:PE (Portable Executable)" |
|---|
| claim | "The certificate table is a sequence of 8-byte-aligned WIN_CERTIFICATE records {uint32 dwLength, uint16 wRevision (0x0200), uint16 wCertificateType (2 = PKCS_SIGNED_DATA), DER PKCS#7 bytes}; dwLength includes the 8-byte header." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:PE (Portable Executable)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "WIN_CERTIFICATE" |
|---|
| size_min | 8 |
|---|
| fields | | offset | 0 |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "dwLength" |
|---|
|
| offset | 4 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "wRevision" |
|---|
| notes | "0x0100 old, 0x0200 WIN_CERT_REVISION_2_0" |
|---|
|
| offset | 6 |
|---|
| size | 2 |
|---|
| type | "uint16" |
|---|
| name | "wCertificateType" |
|---|
| notes | "1 X509, 2 PKCS_SIGNED_DATA, 3 reserved, 4 TS_STACK_SIGNED" |
|---|
|
| offset | 8 |
|---|
| size | "dwLength - 8" |
|---|
| type | "bytes" |
|---|
| name | "bCertificate" |
|---|
| notes | "DER ContentInfo; next record at the next multiple of 8" |
|---|
|
|
|---|
| endianness | "little" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "parse_signature: reads length, revision, type, then length - 8 bytes, aligns the stream to 8" |
|---|
| repo | "https://github.com/lief-project/LIEF" |
|---|
| commit | "15777f106f6220046cf26ee99940d1f56751325e" |
|---|
| path | "src/PE/Parser.cpp" |
|---|
| lines | "1237-1310" |
|---|
|
| type | "source" |
|---|
| detail | "WIN_CERT_REVISION_2_0 0x0200, WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x0002; certificate loop and sigpos + siglen == filesize check" |
|---|
| repo | "https://github.com/mtrojnar/osslsigncode" |
|---|
| commit | "868d6e95c603a8057e89336f12fe12b5d2258e00" |
|---|
| path | "osslsigncode.h" |
|---|
| lines | "206-208" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "WIN_CERTIFICATE" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T08:09:43.033Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T16:36:49.590Z" |
|---|
| summary | "Byte order missing: LIEF reads dwLength, wRevision and wCertificateType as little-endian values from the PE file." |
|---|
| changed | |
|---|
|
|
|---|