Open altendky opened 4 years ago
It took a bit of tinkering, but I arrived at a process for generating Graphviz documents. Try this:
from macholib import MachO, MachOGraph
from altgraph import Dot
m = MachO.MachO("/bin/ls")
g = MachOGraph.MachOGraph()
g.run_file(m.filename)
# remove top-level graph node
g.removeNode(g.graph.node_list()[0])
dot = Dot.Dot(g.graph)
dot.save_dot("ls.dot")
dot.save_img("ls", file_type="pdf")
... and here's the resulting PDF: ls.pdf
python -m macholib.MachOGraph
doesn't seem to provide much output despiteotool -L
providing several system and relative path libraries. Is it missing something?My (next layer out) actual goal is to take a given executable or bundle and list out absolute paths to all 'libraries' it would link to if run (recursively) . This is part of https://github.com/altendky/pyqt5-tools/pull/43 where I am trying to collect many Qt applications and package them into a wheel.
Thanks for the library and any help with this scenario.