diff --git a/s2e_env/dat/config.yaml b/s2e_env/dat/config.yaml index 9ab46080..3f143982 100644 --- a/s2e_env/dat/config.yaml +++ b/s2e_env/dat/config.yaml @@ -111,13 +111,13 @@ required_versions: - 16 - 18 # images.json must have this version - guest_images: 2 + guest_images: 3 # Repo. Used for managing the S2E git repositories repo: url: https://storage.googleapis.com/git-repo-downloads/repo -# Directories that will automatically be built when running ``s2e init`` +# Directories that will automatically be created when running ``s2e init`` dirs: - build - images diff --git a/s2e_env/templates/bootstrap.sh b/s2e_env/templates/bootstrap.sh index a260f0ad..5e8a90c8 100644 --- a/s2e_env/templates/bootstrap.sh +++ b/s2e_env/templates/bootstrap.sh @@ -2,12 +2,12 @@ # # This file was automatically generated by s2e-env at {{ creation_time }} # -# This bootstrap file is used to control the execution of the Linux target -# program in S2E. +# This bootstrap script is used to control the execution of the target program +# in an S2E guest VM. # -# When you run launch-s2e.sh, the guest VM calls s2eget to fetch and execute this -# bootstrap script. This bootstrap script and the S2E config file determine how -# the target program is analyzed. +# When you run launch-s2e.sh, the guest VM calls s2eget to fetch and execute +# this bootstrap script. This bootstrap script and the S2E config file +# determine how the target program is analyzed. # set -x diff --git a/s2e_env/templates/instructions.txt b/s2e_env/templates/instructions.txt index e3761697..819b092b 100644 --- a/s2e_env/templates/instructions.txt +++ b/s2e_env/templates/instructions.txt @@ -18,7 +18,7 @@ include: {% endif %} {#############################################################################} -{% if dynamically_linked and image.group_name == 'linux' %} +{% if dynamically_linked and image.image_group == 'linux' %} s2e.so ====== @@ -113,4 +113,4 @@ If something does not run as expected, you can troubleshoot like this: * Run S2E in GDB using ./launch-s2e.sh debug ------- -Project {{ project_name }} created. +Project {{ project_dir }} created. diff --git a/s2e_env/templates/launch-s2e.sh b/s2e_env/templates/launch-s2e.sh index 0c46edf1..edf4f631 100644 --- a/s2e_env/templates/launch-s2e.sh +++ b/s2e_env/templates/launch-s2e.sh @@ -2,8 +2,8 @@ # # This file was automatically generated by s2e-env at {{ creation_time }} # -# This script can be used to run the S2E analysis. Additional QEMU command line -# arguments can be passed to this script at run time +# This script is used to run the S2E analysis. Additional QEMU command line +# arguments can be passed to this script at run time. # ENV_DIR="{{ env_dir }}" diff --git a/s2e_env/templates/s2e-config.lua b/s2e_env/templates/s2e-config.lua index 6296faf2..6c1ad11a 100644 --- a/s2e_env/templates/s2e-config.lua +++ b/s2e_env/templates/s2e-config.lua @@ -2,7 +2,8 @@ This is the main S2E configuration file ======================================= -This file was automatically generated by s2e-env at {{ creation_time }}. +This file was automatically generated by s2e-env at {{ creation_time }} + Changes can be made by the user where appropriate. ]]-- @@ -10,7 +11,7 @@ Changes can be made by the user where appropriate. -- This section configures the S2E engine. s2e = { logging = { - -- Possible values include "info", "warn", "debug", "none". + -- Possible values include "all", "debug", "info", "warn" and "none". -- See Logging.h in libs2ecore. console = "debug", logLevel = "debug", @@ -236,7 +237,7 @@ pluginsConfig.CUPASearcher = { -- Otherwise too frequent state switching may decrease performance. "batch", - {% if use_pov_generation %} + {% if enable_pov_generation %} -- This class is used with the Recipe plugin in order to prioritize -- states that have a high chance of containing a vulnerability. "group", diff --git a/s2e_env/utils/images.py b/s2e_env/utils/images.py index e9b77432..9afb7c1a 100644 --- a/s2e_env/utils/images.py +++ b/s2e_env/utils/images.py @@ -105,9 +105,10 @@ def _validate_version(descriptor, filename): version = descriptor.get('version') required_version = CONSTANTS['required_versions']['guest_images'] if version != required_version: - raise CommandError('Need version %s for %s. Make sure that you have ' - 'the correct revision of the guest-images ' - 'repository' % (required_version, filename)) + raise CommandError('%s versions do not match (s2e-env: %.2f, image: ' + '%.2f). Make sure that you have the correct ' + 'revision of the guest-images repository' % + (filename, required_version, version)) def get_image_templates(img_build_dir): @@ -144,6 +145,8 @@ def get_image_descriptor(image_dir): ret['path'] = os.path.join(image_dir, 'image.raw.s2e') return ret - except Exception: - raise CommandError('Unable to open image description %s. Check that ' - 'the image exists, was built, or downloaded' % img_json_path) + except CommandError: + raise + except Exception, e: + raise CommandError('Unable to open image description %s: %s' % + (img_json_path, e)) diff --git a/s2e_env/utils/templates.py b/s2e_env/utils/templates.py index 9568f579..fbbc0e9c 100644 --- a/s2e_env/utils/templates.py +++ b/s2e_env/utils/templates.py @@ -24,7 +24,7 @@ import os import stat -from jinja2 import Environment, FileSystemLoader +from jinja2 import Environment, FileSystemLoader, StrictUndefined from .memoize import memoize @@ -46,7 +46,7 @@ def _init_template_env(templates_dir=TEMPLATES_DIR): given directory. """ env = Environment(loader=FileSystemLoader(templates_dir), - autoescape=False) + autoescape=False, undefined=StrictUndefined) env.filters['datetimefilter'] = _datetimefilter return env