Skip to content

Commit

Permalink
[Scripts] do no need qcow or snapshot bc PyPanda API will be used
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewQuijano committed Oct 19, 2024
1 parent 0e20d7e commit 250937c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ db
ipython
lockfile
numpy
pandare
pandare>=1.8.39
PyYAML
SQLAlchemy
tabulate
tabulate
2 changes: 1 addition & 1 deletion scripts/add_queries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ USAGE() {
}

set -e # Exit on error
set -x # Debug mode
# set -x # Debug mode

if [ $# -lt 1 ]; then
USAGE $0
Expand Down
3 changes: 2 additions & 1 deletion scripts/lava.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@

version="2.0.0"
trap '' PIPE
set -ex # Exit on error
set -e # Exit on error
# set -x # debug mode

USAGE() {
echo "$0 version $version"
Expand Down
12 changes: 4 additions & 8 deletions scripts/vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ def validate_project(project):
assert 'name' in project
# command line to run the target program (already instrumented with taint and attack queries)
assert 'command' in project
# path to guest qcow
assert 'qcow' in project
# name of snapshot from which to revert which will be booted & logged in as root
assert 'snapshot' in project
# path to tarfile for target (original source)
assert 'tarfile' in project
# namespace in db for prospective bugs
Expand Down Expand Up @@ -72,8 +68,8 @@ def parse_vars(host_json, project_name):
print("Your project config file is missing a required field:\n{}".format(e))
raise

for field, prefix in [("tarfile", "tar_dir"), ("qcow", "qcow_dir")]:
project[field] = host[prefix] + "/" + project[field]
for field, prefix in [("tarfile", "tar_dir")]:
project[field] = host[prefix] + os.path.sep + project[field]

for field, suffix in [("db", "db_suffix")]:
project[field] = project[field] + host[suffix]
Expand All @@ -93,9 +89,9 @@ def parse_vars(host_json, project_name):
name=project["name"], field=project[field]))

project["qemu"] = host["qemu"]
project["output_dir"] = host["output_dir"] + "/" + project["name"]
project["output_dir"] = host["output_dir"] + os.path.sep + project["name"]
project["directory"] = host["output_dir"]
project["config_dir"] = host["config_dir"] + "/" + project["name"]
project["config_dir"] = host["config_dir"] + os.path.sep + project["name"]

# Replace format strings in project configs
project["install"] = project["install"].format(config_dir=project["config_dir"])
Expand Down

0 comments on commit 250937c

Please sign in to comment.