From 85a0bdfb3553a6c9edf676da201feff9c723c457 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 1 Nov 2024 19:58:07 +0000 Subject: [PATCH] update --- tools/symbol-check.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/symbol-check.py b/tools/symbol-check.py index 9e26561260..92357c0288 100755 --- a/tools/symbol-check.py +++ b/tools/symbol-check.py @@ -28,7 +28,7 @@ def get_exported_exports(library) -> list[str]: if library.format == lief.Binary.FORMATS.ELF: return [symbol.name for symbol in library.exported_symbols] elif library.format == lief.Binary.FORMATS.PE: - return [function.name for function in library.exported_functions] + return [entry.name for entry in library.get_export().entries] elif library.format == lief.Binary.FORMATS.MACHO: return [function.name[1:] for function in library.exported_functions] raise NotImplementedError(f"Unsupported format: {library.format}") @@ -50,6 +50,9 @@ def grep_expected_symbols() -> list[str]: def check_symbols(library, expected_exports) -> None: """Check that the library exports only the expected symbols.""" actual_exports = list(get_exported_exports(library)) + + print(f'actual exports are: {actual_exports}') + unexpected_exports = set(actual_exports) - set(expected_exports) if unexpected_exports != set(): raise UnexpectedExport(f"Unexpected exported symbols: {unexpected_exports}")