Skip to content

Commit 8f4fed7

Browse files
hebastolaanwj
andcommitted
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>
1 parent 2bb6ab8 commit 8f4fed7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

contrib/guix/symbol-check.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ def check_PE_subsystem_version(binary) -> bool:
278278
return True
279279
return False
280280

281+
def check_PE_application_manifest(binary) -> bool:
282+
if not binary.has_resources:
283+
# No resources at all.
284+
return False
285+
286+
rm = binary.resources_manager
287+
return rm.has_manifest
288+
281289
def check_ELF_interpreter(binary) -> bool:
282290
expected_interpreter = ELF_INTERPRETER_NAMES[binary.header.machine_type][binary.abstract.header.endianness]
283291

@@ -307,6 +315,7 @@ def check_ELF_ABI(binary) -> bool:
307315
lief.EXE_FORMATS.PE: [
308316
('DYNAMIC_LIBRARIES', check_PE_libraries),
309317
('SUBSYSTEM_VERSION', check_PE_subsystem_version),
318+
('APPLICATION_MANIFEST', check_PE_application_manifest),
310319
]
311320
}
312321

0 commit comments

Comments
 (0)