Skip to content
This repository has been archived by the owner on Apr 28, 2023. It is now read-only.

More CFG Graphing Examples #52

Closed
Manouchehri opened this issue May 18, 2016 · 2 comments
Closed

More CFG Graphing Examples #52

Manouchehri opened this issue May 18, 2016 · 2 comments

Comments

@Manouchehri
Copy link
Contributor

Right now there's very little documentation on how to use the NetworkX di-graph from angr. The current example in /docs/analyses/cfg.md that suggests print "This is the graph:", cfg.graph seems to print nothing.

Just using networkx.draw(...) will result in a horrible graph like this.

Any suggestions on how I could dump the graph to GraphML or JSON? Using json_graph.dumps(cfg.graph) results in TypeError("G is not a tree.").

@zardus
Copy link
Member

zardus commented May 20, 2016

json has no way to reference prior objects, so I don't think you'd be able to dump arbitrary graph structures. If we make the CFG nodes subclasses of ana.Storable, then we could use ANA's json serialization, but that's a bit of a pain to parse.

For graphing in general, check out https://github.com/axt/angr-utils. The graphs that it produces look pretty slick, and you might be able to grab some intermediate result from it for easier conversion to other formats.

@Manouchehri
Copy link
Contributor Author

What about GraphML?

Thanks! I missed that repo. I'll edit /docs/analyses/cfg.md to mention angr-utils.

@rhelmot rhelmot closed this as completed May 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants