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:
1 parent
2bb6ab8f1b
commit
8f4fed7ec7
1 file changed
+9
@@ -278,6 +278,14 @@ def check_PE_subsystem_version(binary) -> bool:
|
|||||||
return True
|
return True
|
||||||
return False
|
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:
|
def check_ELF_interpreter(binary) -> bool:
|
||||||
expected_interpreter = ELF_INTERPRETER_NAMES[binary.header.machine_type][binary.abstract.header.endianness]
|
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: [
|
lief.EXE_FORMATS.PE: [
|
||||||
('DYNAMIC_LIBRARIES', check_PE_libraries),
|
('DYNAMIC_LIBRARIES', check_PE_libraries),
|
||||||
('SUBSYSTEM_VERSION', check_PE_subsystem_version),
|
('SUBSYSTEM_VERSION', check_PE_subsystem_version),
|
||||||
|
('APPLICATION_MANIFEST', check_PE_application_manifest),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user