contrib: add macOS fixup_chains check to security-check

Followup to #27676.
This commit is contained in:
fanquake
2023-06-29 11:09:18 +01:00
parent 3dca683cb7
commit 7f96638723
2 changed files with 21 additions and 10 deletions

View File

@ -158,6 +158,12 @@ def check_MACHO_NOUNDEFS(binary) -> bool:
'''
return binary.header.has(lief.MachO.HEADER_FLAGS.NOUNDEFS)
def check_MACHO_FIXUP_CHAINS(binary) -> bool:
'''
Check for use of chained fixups.
'''
return binary.has_dyld_chained_fixups
def check_MACHO_Canary(binary) -> bool:
'''
Check for use of stack canary
@ -208,6 +214,7 @@ BASE_PE = [
BASE_MACHO = [
('NOUNDEFS', check_MACHO_NOUNDEFS),
('Canary', check_MACHO_Canary),
('FIXUP_CHAINS', check_MACHO_FIXUP_CHAINS),
]
CHECKS = {