CGCL-codes / VulCNN

66 stars 14 forks source link

I'm stuck on part 4 and can't generate images with pdg #11

Open sanguiyh opened 1 year ago

sanguiyh commented 1 year ago

I'm stuck on part 4 and can't generate images with pdg The dot file was generated earlier, and sent2vec can also be run.

CVE_raw_000121004_CWE78_OS_Command_Injection__wchar_t_console_system_65_bad.Dot CVE_raw_000121006_CWE78_OS_Command_Injection__wchar_t_console_system_67_bad.Dot CVE_raw_000121007_CWE78_OS_Command_Injection__wchar_t_console_system_68_bad.Dot 

I wonder if the author has made the same error. When the image is generated, only the file name is printed out, and the expect branch is entered, and degree_channel, closeness_channel, katz_channel are not generated

try:
      pdg = graph_extraction(dot), this function
       …

expect:
         #Entered this branch when generating the image
         return None
截屏2023-07-04 16 22 18
Saquibirtiza commented 1 year ago

First I installed pygraphviz module on my system. Then I changed the graph_extraction function in ImageGeneration.py file as follows:: image This helped solve my issue. You can try and see if it helps in your case.

guilingxz commented 1 year ago

Missing modules in the code will not throw an exception, but directly return null. It is recommended to comment the branch statement and then check the error content.

caokeheng commented 7 months ago

ckh123@ubuntu:~/Desktop/VulCNN-main$ python3 ImageGeneration.py -i /home/ckh123/Desktop/VulCNN-main/pdgs111/Vul -o /home/ckh123/Desktop/VulCNN-main/outputs1/Vul -m /home/ckh123/Desktop/VulCNN-main/data_model/data_model.bin CVE_raw_000062516_CWE121_Stack_Based_Buffer_OverflowCWE129_connect_socket_01_bad CVE_raw_000062522_CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_07_bad CVE_raw_000062517_CWE121_Stack_Based_Buffer_OverflowCWE129_connect_socket_02_bad CVE_raw_000062521_CWE121_Stack_Based_Buffer_OverflowCWE129_connect_socket_06_bad CVE_raw_000062520_CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_05_bad CVE_raw_000062523_CWE121_Stack_Based_Buffer_OverflowCWE129_connect_socket_08_bad CVE_raw_000062518_CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_03_bad "7" [label = <(METHOD,FUN1)1> ] ^ Expected graph_stmt, found '[' (at char 23), (line:2, col:5) "7" [label = <(METHOD,FUN1)1> ] ^ Expected graph_stmt, found '[' (at char 23), (line:2, col:5) "7" [label = <(METHOD,FUN1)1> ] ^ Expected graph_stmt, found '[' (at char 23), (line:2, col:5) "7" [label = <(METHOD,FUN1)1> ] "7" [label = <(METHOD,FUN1)1> ] ^ Expected graph_stmt, found '[' (at char 23), (line:2, col:5) "7" [label = <(METHOD,FUN1)1> ] ^ Expected graph_stmt, found '[' (at char 23), (line:2, col:5) ^ Expected graph_stmt, found '[' (at char 23), (line:2, col:5) "7" [label = <(METHOD,FUN1)1> ] ^ Expected graph_stmt, found '[' (at char 23), (line:2, col:5) 这是我的报错,有人能帮我解决吗,谢谢

Byw111 commented 1 week ago

ckh123@ubuntu:~/Desktop/VulCNN-main$ python3 ImageGeneration.py -i /home/ckh123/Desktop/VulCNN-main/pdgs111/Vul -o /home/ckh123/Desktop/VulCNN-main/outputs1/Vul -m /home/ckh123/Desktop/VulCNN-main/data_model/data_model.bin CVE_raw_000062516_CWE121_Stack_Based_Buffer_OverflowCWE129_connect_socket_01_bad CVE_raw_000062522_CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_07_badCVE_raw_000062517_CWE121_Stack_Based_Buffer_OverflowCWE129_connect_socket_02_bad CVE_raw_000062521_CWE121_Stack_Based_Buffer_OverflowCWE129_connect_socket_06_bad CVE_raw_000062520_CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_05_bad CVE_raw_000062523_CWE121_Stack_Based_Buffer_OverflowCWE129_connect_socket_08_bad CVE_raw_000062518_CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_03_坏 “7” [label = <(METHOD,FUN1)1> ] ^预期graph_stmt,找到 '[' (在 char 23 处), (line:2, col:5) “7” [label = <(METHOD,FUN1)1> ] ^预期graph_stmt,找到 '[' (在 char 23 处), (line:2, col:5) “7” [label = <(METHOD,FUN1)1> ] ^预期graph_stmt,找到 '[' (在 char 23 处), (line:2, col:5) “7” [label = <(METHOD,FUN1)1> ]“7” [标签 = <(方法,FUN1)1> ] ^预期graph_stmt,找到 '[' (在 char 23 处), (line:2, col:5) “7” [label = <(METHOD,FUN1)1> ] ^预期graph_stmt,找到 '[' (在字符 23 处), (行:2, 列:5) ^ 预期graph_stmt,找到 '[' (在字符 23处), (行:2, 列:5) “7” [标签 = <(方法,FUN1)1> ] ^预期graph_stmt,找到 '[' (在 char 23),(line:2, col:5) 这是我的报错,有人能帮我解决吗,谢谢

ckh123@ubuntu:~/Desktop/VulCNN-main$ python3 ImageGeneration.py -i /home/ckh123/Desktop/VulCNN-main/pdgs111/Vul -o /home/ckh123/Desktop/VulCNN-main/outputs1/Vul -m /home/ckh123/Desktop/VulCNN-main/data_model/data_model.bin CVE_raw_000062516_CWE121_Stack_Based_Buffer_OverflowCWE129_connect_socket_01_bad CVE_raw_000062522_CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_07_badCVE_raw_000062517_CWE121_Stack_Based_Buffer_OverflowCWE129_connect_socket_02_bad CVE_raw_000062521_CWE121_Stack_Based_Buffer_OverflowCWE129_connect_socket_06_bad CVE_raw_000062520_CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_05_bad CVE_raw_000062523_CWE121_Stack_Based_Buffer_OverflowCWE129_connect_socket_08_bad CVE_raw_000062518_CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_03_坏 “7” [label = <(METHOD,FUN1)1> ] ^预期graph_stmt,找到 '[' (在 char 23 处), (line:2, col:5) “7” [label = <(METHOD,FUN1)1> ] ^预期graph_stmt,找到 '[' (在 char 23 处), (line:2, col:5) “7” [label = <(METHOD,FUN1)1> ] ^预期graph_stmt,找到 '[' (在 char 23 处), (line:2, col:5) “7” [label = <(METHOD,FUN1)1> ]“7” [标签 = <(方法,FUN1)1> ] ^预期graph_stmt,找到 '[' (在 char 23 处), (line:2, col:5) “7” [label = <(METHOD,FUN1)1> ] ^预期graph_stmt,找到 '[' (在字符 23 处), (行:2, 列:5) ^ 预期graph_stmt,找到 '[' (在字符 23处), (行:2, 列:5) “7” [标签 = <(方法,FUN1)1> ] ^预期graph_stmt,找到 '[' (在 char 23),(line:2, col:5) 这是我的报错,有人能帮我解决吗,谢谢

请问您解决了吗