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>
This commit is contained in:
Hennadii Stepanov
2025-05-15 13:58:13 +01:00
parent 2bb6ab8f1b
commit 8f4fed7ec7

View File

@@ -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),
]
}