cnznb / REMS

Data and Code of REMS
1 stars 0 forks source link

Does this repository implement the java method cpg extraction? #4

Open nhjclxc opened 7 months ago

nhjclxc commented 7 months ago

Hello, Does this repository implement the java method cpg extraction?

cnznb commented 7 months ago

Hello, yes, the repository implements the Java method CPG extraction. To execute the extraction, you need to install the Joern tool on a Linux system. Refer to the script at src/utils/get_dataset/get_cpg_dot.py for guidance on handling CPG data. For more information about Joern, please visit the official documentation at https://docs.joern.io/.

nhjclxc commented 7 months ago

Hello, yes, the repository implements the Java method CPG extraction. To execute the extraction, you need to install the Joern tool on a Linux system. Refer to the script at src/utils/get_dataset/get_cpg_dot.py for guidance on handling CPG data. For more information about Joern, please visit the official documentation at https://docs.joern.io/.

感谢回复,现在我没有linux,能否在win上实现java方法的cpg提取?这个cpg提取之后能否转化为dot格式文件?

cnznb commented 7 months ago

好像不太行,你要用joern的话,只能在linux上,你可以在虚拟机上实现,joern你只需要下载解压到虚拟机上就可以使用,关于提取的命令,参考脚本里有的,一般都是dot格式,那个参考脚本是批处理的脚本,还可以进一步处理dot数据,可以阅读下src/utils/get_dataset/下的README文件。

nhjclxc commented 7 months ago

好像不太行,你要用joern的话,只能在linux上,你可以在虚拟机上实现,joern你只需要下载解压到虚拟机上就可以使用,关于提取的命令,参考脚本里有的,一般都是dot格式,那个参考脚本是批处理的脚本,还可以进一步处理dot数据,可以阅读下src/utils/get_dataset/下的README文件。

那么也就是说,我要现在Linux系统上面把java源代码转化为cpg的dot格式文件,才能进行下一步的嵌入训练是吗?

cnznb commented 7 months ago

是的,flow embedding是需要用到图数据的,比如一个method哪些行之间有依赖关系,你先利用joern处理出dot文件,然后进一步处理成成对的行关系集,就可以使用Node2Vec等进行训练了;对于tree embedding,只需要拿到源代码,然后对于指定的method按行嵌入成向量即可。

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月16日(星期四) 下午3:13 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [cnznb/REMS] Does this repository implement the java method cpg extraction? (Issue #4)

好像不太行,你要用joern的话,只能在linux上,你可以在虚拟机上实现,joern你只需要下载解压到虚拟机上就可以使用,关于提取的命令,参考脚本里有的,一般都是dot格式,那个参考脚本是批处理的脚本,还可以进一步处理dot数据,可以阅读下src/utils/get_dataset/下的README文件。

那么也就是说,我要现在Linux系统上面把java源代码转化为cpg的dot格式文件,才能进行下一步的嵌入训练是吗?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

nhjclxc commented 7 months ago

是的,flow embedding是需要用到图数据的,比如一个method哪些行之间有依赖关系,你先利用joern处理出dot文件,然后进一步处理成成对的行关系集,就可以使用Node2Vec等进行训练了;对于tree embedding,只需要拿到源代码,然后对于指定的method按行嵌入成向量即可。 ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月16日(星期四) 下午3:13 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [cnznb/REMS] Does this repository implement the java method cpg extraction? (Issue #4) 好像不太行,你要用joern的话,只能在linux上,你可以在虚拟机上实现,joern你只需要下载解压到虚拟机上就可以使用,关于提取的命令,参考脚本里有的,一般都是dot格式,那个参考脚本是批处理的脚本,还可以进一步处理dot数据,可以阅读下src/utils/get_dataset/下的README文件。 那么也就是说,我要现在Linux系统上面把java源代码转化为cpg的dot格式文件,才能进行下一步的嵌入训练是吗? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

嗯是的,我是看到了你这里有cpg,我是想用cpg进行程序相似性检测,我拿到dot格式cpg之后就是向量表示,然后打算用GNN训练,应该就不用tree embedding了吧(因为我并不是做方法提取,我只想训练一个模型)?

cnznb commented 7 months ago

是这样的,gnn模型的输入应该是一张图加图上每个节点的特征,那你如果只把边送进去好像不太够,对于节点的特征你也需要考虑,如果你想好节点特征如何表示那是可以的

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月16日(星期四) 下午3:25 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [cnznb/REMS] Does this repository implement the java method cpg extraction? (Issue #4)

是的,flow embedding是需要用到图数据的,比如一个method哪些行之间有依赖关系,你先利用joern处理出dot文件,然后进一步处理成成对的行关系集,就可以使用Node2Vec等进行训练了;对于tree embedding,只需要拿到源代码,然后对于指定的method按行嵌入成向量即可。 … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月16日(星期四) 下午3:13 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [cnznb/REMS] Does this repository implement the java method cpg extraction? (Issue #4) 好像不太行,你要用joern的话,只能在linux上,你可以在虚拟机上实现,joern你只需要下载解压到虚拟机上就可以使用,关于提取的命令,参考脚本里有的,一般都是dot格式,那个参考脚本是批处理的脚本,还可以进一步处理dot数据,可以阅读下src/utils/get_dataset/下的README文件。 那么也就是说,我要现在Linux系统上面把java源代码转化为cpg的dot格式文件,才能进行下一步的嵌入训练是吗? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

嗯是的,我是看到了你这里有cpg,我是想用cpg进行程序相似性检测,我拿到dot格式cpg之后就是向量表示,然后打算用GNN训练,应该就不用tree embedding了吧(因为我并不是做方法提取,我只想训练一个模型)?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

nhjclxc commented 7 months ago

是这样的,gnn模型的输入应该是一张图加图上每个节点的特征,那你如果只把边送进去好像不太够,对于节点的特征你也需要考虑,如果你想好节点特征如何表示那是可以的 ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月16日(星期四) 下午3:25 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [cnznb/REMS] Does this repository implement the java method cpg extraction? (Issue #4) 是的,flow embedding是需要用到图数据的,比如一个method哪些行之间有依赖关系,你先利用joern处理出dot文件,然后进一步处理成成对的行关系集,就可以使用Node2Vec等进行训练了;对于tree embedding,只需要拿到源代码,然后对于指定的method按行嵌入成向量即可。 … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月16日(星期四) 下午3:13 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [cnznb/REMS] Does this repository implement the java method cpg extraction? (Issue #4) 好像不太行,你要用joern的话,只能在linux上,你可以在虚拟机上实现,joern你只需要下载解压到虚拟机上就可以使用,关于提取的命令,参考脚本里有的,一般都是dot格式,那个参考脚本是批处理的脚本,还可以进一步处理dot数据,可以阅读下src/utils/get_dataset/下的README文件。 那么也就是说,我要现在Linux系统上面把java源代码转化为cpg的dot格式文件,才能进行下一步的嵌入训练是吗? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> 嗯是的,我是看到了你这里有cpg,我是想用cpg进行程序相似性检测,我拿到dot格式cpg之后就是向量表示,然后打算用GNN训练,应该就不用tree embedding了吧(因为我并不是做方法提取,我只想训练一个模型)? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

感谢大佬的解答,希望后面进入实验阶段了请教大佬还能得到你的帮助,感谢大佬。

cnznb commented 7 months ago

好的,你加油,有问题随时联系

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月16日(星期四) 下午3:38 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [cnznb/REMS] Does this repository implement the java method cpg extraction? (Issue #4)

是这样的,gnn模型的输入应该是一张图加图上每个节点的特征,那你如果只把边送进去好像不太够,对于节点的特征你也需要考虑,如果你想好节点特征如何表示那是可以的 … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月16日(星期四) 下午3:25 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [cnznb/REMS] Does this repository implement the java method cpg extraction? (Issue #4) 是的,flow embedding是需要用到图数据的,比如一个method哪些行之间有依赖关系,你先利用joern处理出dot文件,然后进一步处理成成对的行关系集,就可以使用Node2Vec等进行训练了;对于tree embedding,只需要拿到源代码,然后对于指定的method按行嵌入成向量即可。 … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月16日(星期四) 下午3:13 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [cnznb/REMS] Does this repository implement the java method cpg extraction? (Issue #4) 好像不太行,你要用joern的话,只能在linux上,你可以在虚拟机上实现,joern你只需要下载解压到虚拟机上就可以使用,关于提取的命令,参考脚本里有的,一般都是dot格式,那个参考脚本是批处理的脚本,还可以进一步处理dot数据,可以阅读下src/utils/get_dataset/下的README文件。 那么也就是说,我要现在Linux系统上面把java源代码转化为cpg的dot格式文件,才能进行下一步的嵌入训练是吗? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> 嗯是的,我是看到了你这里有cpg,我是想用cpg进行程序相似性检测,我拿到dot格式cpg之后就是向量表示,然后打算用GNN训练,应该就不用tree embedding了吧(因为我并不是做方法提取,我只想训练一个模型)? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

感谢大佬的解答,希望后面进入实验阶段了请教大佬还能得到你的帮助,感谢大佬。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>