/// TODO: print each path once this method is called, and /// (1) add each path (a sequence of node IDs) as a string into std::set<std::string> paths /// in the format "START: 1->2->4->5->END", where -> indicate an ICFGEdge connects two ICFGNode IDs /// bonus: dump and append each program path to a `ICFGPaths.txt` in the form of /// ‘{ln: number cl: number, fl:name} -> {ln: number, cl: number, fl: name} -> {ln:number, cl: number, fl: name} /// ln : line number cl: column number fl:file name for further learning, you can review the code in SVF, SVFUtil void TaintGraphTraversal::printICFGPath(std::vector<const ICFGNode *> &path){ } // TODO: Implement your code to parse the two lines from `SrcSnk.txt` in the form of // line 1 for sources "{ api1 api2 api3 }" // line 2 for sinks "{ api1 api2 api3 }" void TaintGraphTraversal::readSrcSnkFromFile(const string& filename){ } /// TODO: Checking aliases of the two variables at source and sink. For example: /// src instruction: actualRet = source(); /// snk instruction: sink(actualParm,...); /// return true if actualRet is aliased with any parameter at the snk node (e.g., via ander->alias(..,..)) bool TaintGraphTraversal::aliasCheck(const CallICFGNode *src, const CallICFGNode *snk) { return true; } 根据题目填这三个空
时间: 2024-03-07 20:52:29 浏览: 226
第一个方法 `printICFGPath` 需要实现的功能是将每个路径打印出来并且添加到一个 `std::set<std::string>` 中,路径的格式为 "START: 1->2->4->5->END"。
第二个方法 `readSrcSnkFromFile` 的功能是从指定文件中读取两行数据,第一行是源代码中的函数名称,第二行是污点泄露的函数名称,格式为 "{ api1 api2 api3 }"。
第三个方法 `aliasCheck` 的功能是检查源节点和污点节点的变量是否存在别名关系,如果存在则返回 true,否则返回 false。
阅读全文