diff options
author | fanquake <fanquake@gmail.com> | 2021-12-18 11:41:49 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-12-18 11:41:49 +0800 |
commit | d1711a40b30a3627d116d494a36a788701f0dd90 (patch) | |
tree | c4aabda437fb2f8817aae5610e0ed593e955c823 /contrib | |
parent | feee308401835456e00171e0b909c611c752d3e6 (diff) |
scripts: match on exe type over str in symbol-check.py
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/devtools/symbol-check.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py index ec3b7691e9..4b695b3530 100755 --- a/contrib/devtools/symbol-check.py +++ b/contrib/devtools/symbol-check.py @@ -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 |