From 2b815ef215ce72a93ca321db516a85f89bc2a3e1 Mon Sep 17 00:00:00 2001 From: "Chris H. Meyer" Date: Mon, 17 Aug 2026 16:29:46 +0200 Subject: [PATCH] Allow Absence of Security Data WinPE images created with Microsoft ImageX are not necessarily equipped with security data. This resulted in Wimboot failing to read the image content while other tools (e.g. wimlib-based tools like wiminfo) successfully parsed these images. The absence of security data might be signalled with a length of 0 in the security header, although we must still consider the minimum header length of 8 bytes in order to find the root directory entry. --- src/wim.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wim.c b/src/wim.c index ea5bf3c..7b7146d 100644 --- a/src/wim.c +++ b/src/wim.c @@ -450,6 +450,12 @@ int wim_path ( struct vdisk_file *file, struct wim_header *header, sizeof ( security ) ) ) != 0 ) return rc; + /* Special case: the header of an an empty security block + may contain a length of 0, although we must still consider a + minimum header length of 8 */ + if (security.len == 0) + security.len = sizeof(security); + /* Get root directory offset */ direntry->subdir = ( ( security.len + sizeof ( uint64_t ) - 1 ) & ~( sizeof ( uint64_t ) - 1 ) );