Skip to content

Commit

Permalink
Uodate the links in get data
Browse files Browse the repository at this point in the history
  • Loading branch information
Saikat Chakraborty committed Feb 1, 2021
1 parent 6758a69 commit bef6c92
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 115 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ bash build.sh
Once the build is successful, go to the folder you want to perform your experiment, create a folder named `raw_code` and create every functions in separate C files.
We followed the custom to file names `<name>_<VUL>.c`, wehre the `<VUL>` is the Vulnerability identifier of the function (0 for benign, 1 for vulnerable).

First, you have to extract the slices from the parsed code. Modify the [data_processing/extract_slices.ipynb](data_processing/extract_slices.ipynb) for extracting slice.
1. You have to extract the slices from the parsed code. Modify the [data_processing/extract_slices.ipynb](data_processing/extract_slices.ipynb) for extracting slice.
This will generate a file `<data_name>_full_data_with_slices.json` in your data directory.

Finally, run [data_processing/create_ggnn_data.py](data_processing/create_ggnn_data.py) for formatting data into different formats.
2. Run [data_processing/create_ggnn_data.py](data_processing/create_ggnn_data.py) for formatting data into different formats.

3. Update [data_processing/full_data_prep_script.ipynb](data_processing/full_data_prep_script.ipynb) to input to the GGNN.

### Running GGNN.

Expand Down
4 changes: 2 additions & 2 deletions data/get_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FILE=replication.zip
if [[ -f "$FILE" ]]; then
echo "$FILE exists, skipping download"
else
# https://drive.google.com/open?id=1PXfHY9OxO3NnbHqCUq3CJoTNm42G7sCZ
fileid="1PXfHY9OxO3NnbHqCUq3CJoTNm42G7sCZ"
# https://drive.google.com/file/d/1Mn0jLaZWiPFQ8ejzlz_zXnx_TcSzbwu1
fileid="1Mn0jLaZWiPFQ8ejzlz_zXnx_TcSzbwu1"
curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}" > /dev/null
curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${fileid}" -o ${FILE}
rm ./cookie
Expand Down
32 changes: 0 additions & 32 deletions data_processing/Untitled.ipynb

This file was deleted.

77 changes: 0 additions & 77 deletions data_processing/data_for_all.ipynb

This file was deleted.

4 changes: 2 additions & 2 deletions models/get_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FILE=models.zip
if [[ -f "$FILE" ]]; then
echo "$FILE exists, skipping download"
else
# https://drive.google.com/open?id=1plKRZ_tJZJQR7REr0QnTbBOw49Rh2ZNQ
fileid="1NT3xs7jBeKrHX4nMoLOATOxKy_zINp-V"
# https://drive.google.com/file/d/1gTgpgXGzSBlixNcUS-OaoXe8HxQXzaf0
fileid="1gTgpgXGzSBlixNcUS-OaoXe8HxQXzaf0"
curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}" > /dev/null
curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${fileid}" -o ${FILE}
rm ./cookie
Expand Down

0 comments on commit bef6c92

Please sign in to comment.