From 8f4fed7ec70093e2535423d63e9f9dd400c378ac Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 15 May 2025 13:58:13 +0100 Subject: [PATCH] symbol-check: Add check for application manifest in Windows binaries Check that the application manifest is present in all binaries. Co-authored-by: laanwj <126646+laanwj@users.noreply.github.com> --- contrib/guix/symbol-check.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/guix/symbol-check.py b/contrib/guix/symbol-check.py index 9bb5322e170..0d0e26c3ddd 100755 --- a/contrib/guix/symbol-check.py +++ b/contrib/guix/symbol-check.py @@ -278,6 +278,14 @@ def check_PE_subsystem_version(binary) -> bool: return True return False +def check_PE_application_manifest(binary) -> bool: + if not binary.has_resources: + # No resources at all. + return False + + rm = binary.resources_manager + return rm.has_manifest + def check_ELF_interpreter(binary) -> bool: expected_interpreter = ELF_INTERPRETER_NAMES[binary.header.machine_type][binary.abstract.header.endianness] @@ -307,6 +315,7 @@ lief.EXE_FORMATS.MACHO: [ lief.EXE_FORMATS.PE: [ ('DYNAMIC_LIBRARIES', check_PE_libraries), ('SUBSYSTEM_VERSION', check_PE_subsystem_version), + ('APPLICATION_MANIFEST', check_PE_application_manifest), ] }