new commit - change strings
new commit - change strings
MODIFY
utils/autodict_ql/autodict-ql.py
utils/autodict_ql/autodict-ql.py
@@ -57,6 +57,7 @@ def copy_tokens(cur, tokenpath) :
subprocess.call(["cp " + cur + "/" + "memcmp-strs/*" + " " + cur + "/" + tokenpath + "/."] ,shell=True)
subprocess.call(["cp " + cur + "/" + "lits/*" + " " + cur + "/" + tokenpath + "/."] ,shell=True)
subprocess.call(["cp " + cur + "/" + "strtool-strs/*" + " " + cur + "/" + tokenpath + "/."] ,shell=True)
+ subprocess.call(["find "+tokenpath+" -size 0 -delete"],shell=True)

MODIFY
utils/autodict_ql/build-codeql.sh
utils/autodict_ql/build-codeql.sh
@@ -3,7 +3,6 @@ if [ -d "codeql-home" ]; then
echo "Exist !"
exit 1
fi
-sudo apt install build-essential libtool-bin python3-dev automake git vim wget -y
mkdir codeql-home
cd codeql-home
git clone https://github.com/github/codeql.git codeql-repo
@@ -12,6 +11,7 @@ wget https://github.com/github/codeql-cli-binaries/releases/download/v2.4.6/code
unzip codeql-linux64.zip
mv codeql codeql-cli
export "PATH=~/codeql-home/codeql-cli/:$PATH"
+echo "export PATH=~/codeql-home/codeql-cli/:$PATH" >> ~/.bashrc
codeql resolve languages
codeql resolve qlpacks
-echo "export PATH=~/codeql-home/codeql-cli/:$PATH" >> ~/.bashrc
\ No newline at end of file
+codeql
\ No newline at end of file

MODIFY
utils/autodict_ql/memcmp-strings.py
utils/autodict_ql/memcmp-strings.py
@@ -46,9 +46,8 @@ def do_string_analysis(corpdir, infile1):
str11 = str11.replace("\n","")
str11 = str11.lstrip()
str11 = str11.rstrip()
- print("all strings : %s" % str11)
str11 = str(str11)
- if ((" " in str11 ) or (")" in str11) or ("(" in str11)):
+ if ((" " in str11 ) or (")" in str11) or ("(" in str11) or ("<" in str11) or (">" in str11)) :
print("Space / Paranthesis String : %s" % str11)
else :
with open(corpdir+'/memcmp-str{0}'.format(n), 'w') as file:

MODIFY
utils/autodict_ql/readme.md
utils/autodict_ql/readme.md
@@ -31,13 +31,18 @@ You can write other CodeQL scripts to extract possible effective tokens if you t
## Usage
+Before proceed to installation make sure that you have the following packages by installing them :
+```shell
+sudo apt install build-essential libtool-bin python3-dev python3 automake git vim wget -y
+```
The usage of Autodict-QL is pretty easy. But let's describe it as :
-1. First of all, you need to have CodeQL installed on the system. we make this possible with `build-codeql.sh` bash script. This script will install CodeQL completety and will set the required environment variables for your system, so :
-
+1. First of all, you need to have CodeQL installed on the system. we make this possible with `build-codeql.sh` bash script. This script will install CodeQL completety and will set the required environment variables for your system.
+Do the following :
```shell
# chmod +x codeql-build.sh
-# sudo ./codeql-build.sh
+# ./codeql-build.sh
+# source ~/.bashrc
# codeql
```
Then you should get :

MODIFY
utils/autodict_ql/stan-strings.py
utils/autodict_ql/stan-strings.py
@@ -46,9 +46,8 @@ def do_string_analysis(corpdir, infile1):
str11 = str11.replace("\n","")
str11 = str11.lstrip()
str11 = str11.rstrip()
- print("all strings : %s" % str11)
str11 = str(str11)
- if ((" " in str11 ) or (")" in str11) or ("(" in str11)) or ("<" in str11) or (">" in str11) :
+ if ((" " in str11 ) or (")" in str11) or ("(" in str11) or ("<" in str11) or (">" in str11)) :
print("Space / Paranthesis String : %s" % str11)
else :
with open(corpdir+'/seed-str{0}'.format(n), 'w') as file:

MODIFY
utils/autodict_ql/strcmp-strings.py
utils/autodict_ql/strcmp-strings.py
@@ -46,9 +46,8 @@ def do_string_analysis(corpdir, infile1):
str11 = str11.replace("\n","")
str11 = str11.lstrip()
str11 = str11.rstrip()
- print("all strings : %s" % str11)
str11 = str(str11)
- if ((" " in str11 ) or (")" in str11) or ("(" in str11)):
+ if ((" " in str11 ) or (")" in str11) or ("(" in str11) or ("<" in str11) or (">" in str11)) :
print("Space / Paranthesis String : %s" % str11)
else :
with open(corpdir+'/strcmp-str{0}'.format(n), 'w') as file:

MODIFY
utils/autodict_ql/strncmp-strings.py
utils/autodict_ql/strncmp-strings.py
@@ -46,9 +46,8 @@ def do_string_analysis(corpdir, infile1):
str11 = str11.replace("\n","")
str11 = str11.lstrip()
str11 = str11.rstrip()
- print("all strings : %s" % str11)
str11 = str(str11)
- if ((" " in str11 ) or (")" in str11) or ("(" in str11)):
+ if ((" " in str11 ) or (")" in str11) or ("(" in str11) or ("<" in str11) or (">" in str11)) :
print("Space / Paranthesis String : %s" % str11)
else :
with open(corpdir+'/strncmp-str{0}'.format(n), 'w') as file:

new commit - change strings

new commit - change strings