How to create a control-flow graph with Soot?

旧时模样 提交于 2019-12-25 11:28:22

问题


For a while I have been struggling with creating a control-flow graph with Soot and I kinda got lost in its tutorials. Rather than using Soot as an Eclipse plugin, I have been trying to use Soot as a library or API.

What I want to do is, I have a bunch of Java projects and I want to create/generate a control-flow graph of these projects. I also saw that there is a feature in Soot that I can generate control-flow graphs in "DOT" format, which is quite acceptable for me as well.

Any guide or sample of code that shows how to create/generate a control-flow graph with Soot would be great!


回答1:


You can create a method-local CFG by just creating a new ExceptionalUnitGraph, passing it the method's SootBody. The Soot Tutorial in the wiki shows you how to do that.

To get an inter-procedural CFG, i.e., an ICFG, you can use the Soot extension Heros: https://github.com/Sable/heros/blob/develop/src/heros/InterproceduralCFG.java



来源:https://stackoverflow.com/questions/44944837/how-to-create-a-control-flow-graph-with-soot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!