mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 18:09:47 +01:00
scripts: match on exe type over str in symbol-check.py
This commit is contained in:
parent
feee308401
commit
d1711a40b3
@ -254,18 +254,18 @@ def check_ELF_interpreter(binary) -> bool:
|
||||
return binary.concrete.interpreter == expected_interpreter
|
||||
|
||||
CHECKS = {
|
||||
'ELF': [
|
||||
lief.EXE_FORMATS.ELF: [
|
||||
('IMPORTED_SYMBOLS', check_imported_symbols),
|
||||
('EXPORTED_SYMBOLS', check_exported_symbols),
|
||||
('LIBRARY_DEPENDENCIES', check_ELF_libraries),
|
||||
('INTERPRETER_NAME', check_ELF_interpreter),
|
||||
],
|
||||
'MACHO': [
|
||||
lief.EXE_FORMATS.MACHO: [
|
||||
('DYNAMIC_LIBRARIES', check_MACHO_libraries),
|
||||
('MIN_OS', check_MACHO_min_os),
|
||||
('SDK', check_MACHO_sdk),
|
||||
],
|
||||
'PE' : [
|
||||
lief.EXE_FORMATS.PE: [
|
||||
('DYNAMIC_LIBRARIES', check_PE_libraries),
|
||||
('SUBSYSTEM_VERSION', check_PE_subsystem_version),
|
||||
]
|
||||
@ -276,7 +276,7 @@ if __name__ == '__main__':
|
||||
for filename in sys.argv[1:]:
|
||||
try:
|
||||
binary = lief.parse(filename)
|
||||
etype = binary.format.name
|
||||
etype = binary.format
|
||||
if etype == lief.EXE_FORMATS.UNKNOWN:
|
||||
print(f'{filename}: unknown executable format')
|
||||
retval = 1
|
||||
|
Loading…
Reference in New Issue
Block a user