gpt4 book ai didi

java - WALA :“Could not create a entrypoint callsites:” 问题

转载 作者:行者123 更新时间:2023-12-02 05:56:59 26 4
gpt4 key购买 nike

我正在使用WALA进行静态分析,但遇到了一些问题。当我构建调用图时,某些 jar 存在以下问题:

Exception in thread "main" java.lang.IllegalStateException: Could not create a entrypoint callsites:

  1. [Moderate] class com.ibm.wala.ipa.cha.ClassHierarchy$ClassExclusion : No superclass found for Superclass name Lorg/eclipse/swt/dnd/ByteArrayTransfer

  2. [Moderate] class com.ibm.wala.ipa.cha.ClassHierarchy$ClassExclusion : No superclass found for Superclass name Lorg/eclipse/swt/widgets/Canvas

  3. [SEVERE] class com.ibm.wala.classLoader.BytecodeClass$ClassNotFoundWarning : Lorg/eclipse/swt/dnd/DragSourceListener

  4. [SEVERE] class com.ibm.wala.classLoader.BytecodeClass$ClassNotFoundWarning : Lorg/eclipse/swt/dnd/DropTargetListener

com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder.makeCallGraph(PropagationCallGraphBuilder.java:263)

wala 似乎无法获取 eclipse.swt 包的 .class 文件,因此我无法构建调用图来进行切片。您遇到过这样的问题吗?这个问题兄弟我很久了。问题Jar是这样的:http://mirror.bit.edu.cn/apache/commons/io/binaries/

WALA版本是1.4.3。我的代码是:

AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(jarPath, exFile);
ClassHierarchy cha = ClassHierarchyFactory.make(scope);

Iterable entrypoints = Util.makeMainEntrypoints(scope, cha);
AnalysisOptions options = new AnalysisOptions(scope, entrypoints);// the problem line
options.setReflectionOptions(ReflectionOptions.NONE);

那么,我该如何处理这个问题。非常非常感谢。

最佳答案

我想知道你的jarPath包含什么代码。因为我发现您的入口点是通过 makeMainEntrypoints 方法创建的,所以该方法要求您正在分析的二进制文件的源代码必须包含 main 方法。

如果它不包含main方法,您可以使用AllApplicationEntrypoints类来构建入口点,如下所示:

Iterable<Entrypoint> entrypoints = new AllApplicationEntrypoints(scope, cha);

关于java - WALA :“Could not create a entrypoint callsites:” 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56003762/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com