Vul-LMGNN / vul-LMGGNN

Code for the paper - Source Code Vulnerability Detection: Combining Code Language Models and Code Property Graph
Apache License 2.0
25 stars 4 forks source link

Version Of Joern #3

Open initialWu opened 2 months ago

initialWu commented 2 months ago

Thanks for your work! I want to get an example of CPG, but when I tried to use your function:

cpg_file = process.joern_parse(joern_cli_dir, input_path, output_path, cpg_fname)
json_files = process.joern_create(joern_cli_dir, output_path, json_out, ['test_0.bin'])

I got the following output: image

Then I used your process command cpg.runScript in function joern_create of utils/process/cpg_generator.py in joern terminal, but I got this error: image

So I don't think I have the same version of Joern installed as yours. Can you please tell me which version you are using? The Joern I installed is Version: 2.0.357. The Joern document gives instruction of implementing scripts like This. So I tried to modify your graph-for-funcs.sc scripts, and added a cpgFile parameter(path of bin file obtained by joern-parse) and an importCpg call(following Joern Document) like :

@main def main(cpgFile: String): Json = {
  importCpg(cpgFile)
  GraphForFuncsResult(

But then I got more errors. image Could you please give me some help? Thanks.

YunFy26 commented 1 month ago

@initialWu Hello, When I used cpg.runScript, I get the same error. The Joern I installed is Version: 2.0.401 I'd like to know if you've solved this problem, and I'd be very grateful if you could give me a reply.

initialWu commented 3 weeks ago

@initialWu Hello, When I used cpg.runScript, I get the same error. The Joern I installed is Version: 2.0.401 I'd like to know if you've solved this problem, and I'd be very grateful if you could give me a reply.

The new version of Joern no longer supports cpg.runScript. I resolved this issue by directly running joern-cli with the --script parameter, following the methods described in Joern’s documentation. The provided scripts in the repository might require modifications in new version.

ChenglinW commented 3 weeks ago

I've got the same error after running the script, it might be caused by the absence of io.circe in scala3. Have you resolved the issue?

ChenglinW commented 2 weeks ago

I have resolved the issue by rewriting the script and rebuilding the joern, the problem is caused by lacking certain scala packages