Vul-LMGNN / vul-LMGGNN

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

Version Of Joern #3

Closed initialWu closed 1 week ago

initialWu commented 6 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 5 months 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 5 months 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 5 months 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 4 months ago

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

ckj18 commented 1 month ago

Could you share the modified script?

Abdelrahman-405 commented 1 week ago

@ChenglinW can you provide the new script, plz?

Abdelrahman-405 commented 1 week ago

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

Can you help me to solve this problem please