teste / list_symbols.py
AlineIoste's picture
Update list_symbols.py
9b1247d verified
raw
history blame contribute delete
666 Bytes
import ctypes
import os
def list_symbols(library_path):
# Carregar a biblioteca
lib = ctypes.CDLL(library_path)
# Obter todos os símbolos da biblioteca
symbols = [symbol for symbol in dir(lib) if not symbol.startswith('_')]
return symbols
if __name__ == "__main__":
current_dir = os.path.dirname(os.path.abspath(__file__))
so_path = os.path.join(current_dir, "SynapseControl.cpython-310-x86_64-linux-gnu.so")
if os.path.exists(so_path):
symbols = list_symbols(so_path)
print("Symbols in the library:")
for symbol in symbols:
print(symbol)
else:
print("Library file not found.")