如何使用 SOOT 在调用图上构建?或者有什么更好的程序可以做到这一点?我被发送到同样的五个页面寻找答案,但我找不到我要找的东西。 Eclipse 的插件版本也有问题。它安装正确,但当我想运行代码时我无法选择它。
以下是一些示例,包括 Java 的调用图。http://www.brics.dk/SootGuide/ http://www.brics.dk/SootGuide/
以及 apk 的调用图。https://github.com/secure-software-engineering/soot-infoflow/issues/38 https://github.com/secure-software-engineering/soot-infoflow/issues/38
如果您想获取点文件,您可以迭代调用图并以点格式写出内容,如下所示。
private static void visit(CallGraph cg, SootMethod method) {
String identifier = method.getSignature();
visited.put(method.getSignature(), true);
dot.drawNode(identifier);
// iterate over unvisited parents
Iterator<MethodOrMethodContext> ptargets = new Targets(cg.edgesInto(method));
if (ptargets != null) {
while (ptargets.hasNext()) {
SootMethod parent = (SootMethod) ptargets.next();
if (!visited.containsKey(parent.getSignature())) visit(cg, parent);
}
}
// iterate over unvisited children
Iterator<MethodOrMethodContext> ctargets = new Targets(cg.edgesOutOf(method));
if (ctargets != null) {
while (ctargets.hasNext()) {
SootMethod child = (SootMethod) ctargets.next();
dot.drawEdge(identifier, child.getSignature());
System.out.println(method + " may call " + child);
if (!visited.containsKey(child.getSignature())) visit(cg, child);
}
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)