1
Fork 0

Change test script to just print

This commit is contained in:
Jan-Erik Rediger 2023-12-09 19:18:26 +01:00
parent 25d945f084
commit 992506e516

37
test.py
View file

@ -1,28 +1,12 @@
import oelf import oelf
g = oelf.Object("test.py") g = oelf.Object("target/debug/liboelf.dylib")
g = oelf.Object("mylib.dylib") print(f"{g.header=}")
print(g.header) print(f"{g.name=}")
print(g.name)
print("symbols") print("symbols")
globsym = None for symbol in g.symbols():
start = -1 print(symbol)
end = 9999999999
for sym in g.symbols():
if "META" in sym.name and sym.is_global:
if globsym is None:
globsym = sym
start = sym.meta.n_value
for sym in g.symbols():
if sym.meta.n_value > start and sym.meta.n_value < end:
print(f"sym after the found one: {sym}")
end = sym.meta.n_value
print(f"found symbol {globsym.name} from {start} to {end}, size: {end-start}")
print(globsym)
print("libs") print("libs")
print(g.libs) print(g.libs)
@ -31,12 +15,13 @@ print("rpaths")
print(g.rpaths) print(g.rpaths)
print("exports") print("exports")
print(len(g.exports())) for export in g.exports():
print(export)
print("imports") print("imports")
print(len(g.imports())) for imp in g.imports():
print(imp)
print("sections") print("sections")
for section in g.sections():
for idx, section in enumerate(g.sections()): print(f"{section}")
print(f"{idx+1}. {section}")