From ba25f321e34556ff77e3135c92a77888a1361564 Mon Sep 17 00:00:00 2001 From: Yun Zheng Hu <468612+yunzheng@users.noreply.github.com> Date: Tue, 17 Nov 2026 16:41:59 +0100 Subject: [PATCH 1/2] Define ENCLAVE_SHORT_ID_LENGTH and ENCLAVE_LONG_ID_LENGTH The software enclave definitions in c_pe.py use these constants from winnt.h, but they were never defined. Before dissect.cstruct 5.0.dev16, the array sizes that use them were silently left unresolved, which gave IMAGE_ENCLAVE_IMPORT and IMAGE_ENCLAVE_CONFIG32/64 a dynamic size. Since fox-it/dissect.cstruct#184, loading the definition fails instead. Fixes #41 Co-Authored-By: Claude Opus 5.5 --- dissect/executable/pe/c_pe.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dissect/executable/pe/c_pe.py b/dissect/executable/pe/c_pe.py index 8714128..054257e 100644 --- a/dissect/executable/pe/c_pe.py +++ b/dissect/executable/pe/c_pe.py @@ -1785,6 +1785,9 @@ // Sofware enclave information // +#define ENCLAVE_SHORT_ID_LENGTH 16 +#define ENCLAVE_LONG_ID_LENGTH 32 + #define IMAGE_ENCLAVE_LONG_ID_LENGTH ENCLAVE_LONG_ID_LENGTH #define IMAGE_ENCLAVE_SHORT_ID_LENGTH ENCLAVE_SHORT_ID_LENGTH From ca49b734fa7f13f1cc847064c4a67bfea0d6dad8 Mon Sep 17 00:00:00 2001 From: Yun Zheng Hu <468612+yunzheng@users.noreply.github.com> Date: Tue, 17 Nov 2026 22:10:57 +0100 Subject: [PATCH 2/2] Change order of definitions --- dissect/executable/pe/c_pe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dissect/executable/pe/c_pe.py b/dissect/executable/pe/c_pe.py index 054257e..ec82c60 100644 --- a/dissect/executable/pe/c_pe.py +++ b/dissect/executable/pe/c_pe.py @@ -1785,8 +1785,8 @@ // Sofware enclave information // -#define ENCLAVE_SHORT_ID_LENGTH 16 #define ENCLAVE_LONG_ID_LENGTH 32 +#define ENCLAVE_SHORT_ID_LENGTH 16 #define IMAGE_ENCLAVE_LONG_ID_LENGTH ENCLAVE_LONG_ID_LENGTH #define IMAGE_ENCLAVE_SHORT_ID_LENGTH ENCLAVE_SHORT_ID_LENGTH