Spaces:
Sleeping
Sleeping
Create list_symbols.py
Browse files- list_symbols.py +21 -0
list_symbols.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ctypes
|
2 |
+
import os
|
3 |
+
|
4 |
+
def list_symbols(library_path):
|
5 |
+
# Carregar a biblioteca
|
6 |
+
lib = ctypes.CDLL(library_path)
|
7 |
+
|
8 |
+
# Obter todos os símbolos da biblioteca
|
9 |
+
symbols = [symbol for symbol in dir(lib) if not symbol.startswith('_')]
|
10 |
+
return symbols
|
11 |
+
|
12 |
+
if __name__ == "__main__":
|
13 |
+
current_dir = os.path.dirname(os.path.abspath(__file__))
|
14 |
+
so_path = os.path.join(current_dir, "SynapseControl.cpython-38-x86_64-linux-gnu.so")
|
15 |
+
if os.path.exists(so_path):
|
16 |
+
symbols = list_symbols(so_path)
|
17 |
+
print("Symbols in the library:")
|
18 |
+
for symbol in symbols:
|
19 |
+
print(symbol)
|
20 |
+
else:
|
21 |
+
print("Library file not found.")
|